This commit is contained in:
robojumper
2024-06-13 18:18:40 +02:00
parent e7a7f794d4
commit f80927177a
4 changed files with 45 additions and 5 deletions
+1 -1
View File
@@ -3677,7 +3677,7 @@ __dt__11ActorOnRailFv = .text:0x800A66D0; // type:function size:0x40
fn_800A6710 = .text:0x800A6710; // type:function size:0x18
fn_800A6730 = .text:0x800A6730; // type:function size:0xBC
fn_800A67F0 = .text:0x800A67F0; // type:function size:0xBC
fn_800A68B0 = .text:0x800A68B0; // type:function size:0x58
getPntPosForIndex__11ActorOnRailFi = .text:0x800A68B0; // type:function size:0x58
fn_800A6910 = .text:0x800A6910; // type:function size:0x2B4
fn_800A6BD0 = .text:0x800A6BD0; // type:function size:0x74
fn_800A6C50 = .text:0x800A6C50; // type:function size:0x110
+1 -1
View File
@@ -17,7 +17,7 @@ public:
/* 802f16b0 */ void XrotS(mAng angle); ///< Generates a rotation matrix for the X axis with the given angle.
/* 802f1770 */ void XrotM(mAng angle); ///< Rotates the matrix on the X axis by the given angle.
/* 802f17c0 */ void YrotS(mAng angle); ///< Generates a rotation matrix for the Y axis with the given angle.
/* 802f1880 */ void YrotM(s16 &angle); ///< Rotates the matrix on the Y axis by the given angle.
/* 802f1880 */ void YrotM(s16 &angle); ///< Rotates the matrix on the Y axis by the given angle.
/* 802f18d0 */ void ZrotS(mAng angle); ///< Generates a rotation matrix for the Z axis with the given angle.
/* 802f1990 */ void ZrotM(mAng angle); ///< Rotates the matrix on the Z axis by the given angle.
+2
View File
@@ -17,6 +17,8 @@ public:
/* 800A6D90 */
bool init(int pathIndex, int roomId, int pathSubtype);
/* 800A68B0 */
mVec3_c *getPntPosForIndex(int index);
};
#endif
+41 -3
View File
@@ -65,7 +65,6 @@ int dTgSndAr_c::actorExecute() {
link->setBit_field_0xE8(params & 0xFF);
}
if (lbl_80575D58 != nullptr) {
// Halp
mVec3_c pos = lbl_80575D58->v;
if (checkPosInArea(pos) && lbl_805756EC != nullptr) {
lbl_805756EC->bgmFlags |= 1 << (params & 0xFF);
@@ -96,6 +95,7 @@ bool dTgSndAr_c::checkPosInArea(mVec3_c &pos) {
inline bool inRange(f32 val, f32 tolerance) {
return (-tolerance <= val && val <= tolerance);
}
// Box
bool dTgSndAr_c::checkAlg0(const mVec3_c &pos) {
mVec3_c c2 = pos;
@@ -129,8 +129,46 @@ bool dTgSndAr_c::checkAlg2(const mVec3_c &pos) {
mVec3_c diff(pos.x - position.x, pos.z - position.z, scale.x * 100.0f);
return diff.x * diff.x + diff.y * diff.y <= diff.x * diff.z;
return diff.x * diff.x + diff.y * diff.y <= diff.z * diff.z;
}
struct UnkStruct {
/* 0x00 */ mVec3_c vec;
/* 0x0C */ mVec3_c vec2;
/* 0x18 */ u32 unk;
/* 0x1C */ f32 field_0x1C;
/* 0x20 */ u8 field_0x20;
/* 0x24 */ u32 field_0x24;
};
extern "C" void fn_80337EA0(UnkStruct *);
extern "C" void fn_80337EF0(UnkStruct *, mVec3_c&, mVec3_c&, f32);
extern "C" int fn_8032BFB0(UnkStruct *, mVec3_c&, f32*, f32&, int);
// ???
bool dTgSndAr_c::checkAlg3(const mVec3_c &pos) {}
bool dTgSndAr_c::checkAlg3(const mVec3_c &pos) {
f32 q[4];
UnkStruct unk;
f32 radius = scale.x * 100.0f;
radius = radius * radius;
mVec3_c a = pos;
fn_80337EA0(&unk);
mVec3_c b = *mRail.getPntPosForIndex(0);
mVec3_c c = *mRail.getPntPosForIndex(1);
fn_80337EF0(&unk, b, c, scale.x * 100.0f);
f32 d;
if (fn_8032BFB0(&unk, a, q, d, 0)) {
return d < radius;
} else {
f32 distSq = PSVECSquareDistance(unk.vec, pos);
if (distSq < radius) {
return true;
} else {
distSq = PSVECSquareDistance(unk.vec2, pos);
return distSq < radius;
}
}
}