From 69a9c3b68ef6700e39bf9f0110db65d5ea270e38 Mon Sep 17 00:00:00 2001 From: elijah-thomas774 Date: Fri, 14 Jun 2024 18:59:06 -0400 Subject: [PATCH] matched --- configure.py | 2 +- include/m/m_angle.h | 3 ++- include/m/m_mtx.h | 14 +++++++------- src/REL/d/t/d_t_sound_area.cpp | 11 +++++++---- 4 files changed, 17 insertions(+), 13 deletions(-) diff --git a/configure.py b/configure.py index 7782d9dd..2a889345 100644 --- a/configure.py +++ b/configure.py @@ -1063,7 +1063,7 @@ config.libs = [ Rel(NonMatching, "d_t_siren_time_attack", "REL/d/t/d_t_siren_time_attack.cpp"), Rel(NonMatching, "d_t_skyEnemy", "REL/d/t/d_t_skyEnemy.cpp"), Rel(NonMatching, "d_t_sound", "REL/d/t/d_t_sound.cpp"), - Rel(NonMatching, "d_t_sound_area", "REL/d/t/d_t_sound_area.cpp"), + Rel(Matching, "d_t_sound_area", "REL/d/t/d_t_sound_area.cpp"), Rel(NonMatching, "d_t_sound_area_mgr", "REL/d/t/d_t_sound_area_mgr.cpp"), Rel(NonMatching, "d_t_sparks2", "REL/d/t/d_t_sparks2.cpp"), Rel(NonMatching, "d_t_sparks", "REL/d/t/d_t_sparks.cpp"), diff --git a/include/m/m_angle.h b/include/m/m_angle.h index 832800a8..52c2408c 100644 --- a/include/m/m_angle.h +++ b/include/m/m_angle.h @@ -16,7 +16,6 @@ class mAng3_c { public: mAng3_c() {} - s16 x, y, z; mAng3_c(s16 fx, s16 fy, s16 fz) : x(fx), y(fy), z(fz) {} void set(s16 fx, s16 fy, s16 fz) { @@ -25,6 +24,8 @@ public: z = fz; } + mAng x, y, z; + static mAng3_c Zero; }; diff --git a/include/m/m_mtx.h b/include/m/m_mtx.h index f68c58ab..ee60b72d 100644 --- a/include/m/m_mtx.h +++ b/include/m/m_mtx.h @@ -10,16 +10,16 @@ class mMtx_c { public: - mMtx_c() {}; + mMtx_c(){}; /* 802f1660 */ mMtx_c(f32 xx, f32 xy, f32 xz, f32 xw, f32 yx, f32 yy, f32 yz, f32 yw, f32 zx, f32 zy, f32 zz, f32 zw); - /* 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. - /* 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. + /* 802f16b0 */ void XrotS(const mAng &angle); ///< Generates a rotation matrix for the X axis with the given angle. + /* 802f1770 */ void XrotM(const mAng &angle); ///< Rotates the matrix on the X axis by the given angle. + /* 802f17c0 */ void YrotS(const mAng &angle); ///< Generates a rotation matrix for the Y axis with the given angle. + /* 802f1880 */ void YrotM(const mAng &angle); ///< Rotates the matrix on the Y axis by the given angle. + /* 802f18d0 */ void ZrotS(const mAng &angle); ///< Generates a rotation matrix for the Z axis with the given angle. + /* 802f1990 */ void ZrotM(const mAng &angle); ///< Rotates the matrix on the Z axis by the given angle. /* 802f19e0 */ void ZXYrotS(mAng xRot, mAng yRot, mAng zRot); ///< Generates the matrix on the Y, X and Z axes by the given angles. diff --git a/src/REL/d/t/d_t_sound_area.cpp b/src/REL/d/t/d_t_sound_area.cpp index 6e74d26e..a4165a6c 100644 --- a/src/REL/d/t/d_t_sound_area.cpp +++ b/src/REL/d/t/d_t_sound_area.cpp @@ -127,10 +127,13 @@ bool dTgSndAr_c::checkAlg2(const mVec3_c &pos) { return false; } - mVec3_c diff = pos - position; f32 radius = scale.x * 100.0f; + mVec3_c diff = pos - position; - return diff.x * diff.x + diff.z * diff.z < radius * radius; + f32 dist = diff.x * diff.x + diff.z * diff.z; + f32 r2 = radius * radius; + + return !(dist > r2); } struct UnkStruct { @@ -143,8 +146,8 @@ struct UnkStruct { }; extern "C" void fn_80337EA0(UnkStruct *); -extern "C" void fn_80337EF0(UnkStruct *, mVec3_c&, mVec3_c&, f32); -extern "C" int fn_8032BFB0(UnkStruct *, EGG::Vector3f&, f32*, f32&, int); +extern "C" void fn_80337EF0(UnkStruct *, mVec3_c &, mVec3_c &, f32); +extern "C" int fn_8032BFB0(UnkStruct *, EGG::Vector3f &, f32 *, f32 &, int); // ??? bool dTgSndAr_c::checkAlg3(const mVec3_c &pos) {