diff options
| author | robojumper <robojumper@gmail.com> | 2026-05-07 19:53:30 +0200 |
|---|---|---|
| committer | robojumper <robojumper@gmail.com> | 2026-05-07 19:53:30 +0200 |
| commit | d8744e1f34e9955d55a5605f939bdf0bf9d8a729 (patch) | |
| tree | 944f80d4d212332abeb1f7607396fc7c7a38a70d /include | |
| parent | ddb116187922a3f73ae3c97a136f499b7d724a2c (diff) | |
MTX/VEC cleanup
Diffstat (limited to 'include')
| -rw-r--r-- | include/d/col/c/c_m3d_g_lin.h | 2 | ||||
| -rw-r--r-- | include/m/m_vec.h | 7 | ||||
| -rw-r--r-- | include/nw4r/g3d/g3d_calcworld.h | 8 | ||||
| -rw-r--r-- | include/nw4r/math/math_types.h | 30 | ||||
| -rw-r--r-- | include/rvl/MTX/mtx.h | 1 |
5 files changed, 22 insertions, 26 deletions
diff --git a/include/d/col/c/c_m3d_g_lin.h b/include/d/col/c/c_m3d_g_lin.h index 8b1d9d46..629347f0 100644 --- a/include/d/col/c/c_m3d_g_lin.h +++ b/include/d/col/c/c_m3d_g_lin.h @@ -26,7 +26,7 @@ public: void CalcPos(mVec3_c *, f32) const; void CalcVec(Vec *pOut) const { - PSVECSubtract(mEnd, mStart, pOut); + VECSubtract(mEnd, mStart, pOut); } void SetStart(const mVec3_c &); diff --git a/include/m/m_vec.h b/include/m/m_vec.h index 0294dcca..6f0047b9 100644 --- a/include/m/m_vec.h +++ b/include/m/m_vec.h @@ -222,7 +222,7 @@ public: } f32 distance(const mVec3_c &to) const { - return EGG::Math<f32>::sqrt(PSVECSquareDistance(*this, to)); + return EGG::Math<f32>::sqrt(VECSquareDistance(*this, to)); } f32 squareDistance(const mVec3_c &to) const { return VEC3DistSq(*this, to); @@ -277,11 +277,6 @@ public: return EGG::Vector3f::angle(other); } - void offsetWithAngle(s16 yRot, f32 scale) { - this->x += nw4r::math::SinIdx(yRot) * scale; - this->z += nw4r::math::CosIdx(yRot) * scale; - } - static mVec3_c Zero; static mVec3_c Ex; static mVec3_c Ey; diff --git a/include/nw4r/g3d/g3d_calcworld.h b/include/nw4r/g3d/g3d_calcworld.h index b31ed72a..ce2f2fda 100644 --- a/include/nw4r/g3d/g3d_calcworld.h +++ b/include/nw4r/g3d/g3d_calcworld.h @@ -64,21 +64,21 @@ public: void SetScale(f32 x, f32 y, f32 z); void GetMtx(nw4r::math::MTX34 *out) { if (out != NULL) { - PSMTXCopy(*mpM, *out); + MTXCopy(*mpM, *out); } } void SetMtx(const nw4r::math::MTX34 *arg) { if (arg != NULL) { - PSMTXCopy(*arg, *mpM); + MTXCopy(*arg, *mpM); } else { - PSMTXIdentity(*mpM); + MTXIdentity(*mpM); } } // Not sure void SetMtxUnchecked(const nw4r::math::MTX34 *arg) { - PSMTXCopy(*arg, *mpM); + MTXCopy(*arg, *mpM); } private: diff --git a/include/nw4r/math/math_types.h b/include/nw4r/math/math_types.h index 282ea18a..7fb8172c 100644 --- a/include/nw4r/math/math_types.h +++ b/include/nw4r/math/math_types.h @@ -448,30 +448,30 @@ inline VEC3 *VEC3Sub(register VEC3 *out, register const VEC3 *a, register const } inline VEC3 *VEC3Cross(VEC3 *out, const VEC3 *a, const VEC3 *b) { - PSVECCrossProduct(*a, *b, *out); + VECCrossProduct(*a, *b, *out); return out; } inline f32 VEC3DistSq(const VEC3 *a, const VEC3 *b) { - return PSVECSquareDistance(*a, *b); + return VECSquareDistance(*a, *b); } inline f32 VEC3Len(const VEC3 *vec) { - return PSVECMag(*vec); + return VECMag(*vec); } inline VEC3 *VEC3Normalize(VEC3 *out, const VEC3 *in) { - PSVECNormalize(*in, *out); + VECNormalize(*in, *out); return out; } inline VEC3 *VEC3Transform(VEC3 *out, const MTX34 *mtx, const VEC3 *vec) { - PSMTXMultVec(*mtx, *vec, *out); + MTXMultVec(*mtx, *vec, *out); return out; } inline VEC3 *VEC3TransformCoord(VEC3 *out, const MTX34 *mtx, const VEC3 *vec) { - PSMTXMultVec(*mtx, *vec, *out); + MTXMultVec(*mtx, *vec, *out); return out; } @@ -496,21 +496,21 @@ MTX34 *MTX34RotAxisFIdx(MTX34 *mtx, const VEC3 *axis, f32 fidx); MTX34 *MTX34RotXYZFIdx(MTX34 *mtx, f32 fx, f32 fy, f32 fz); inline MTX34 *MTX34Copy(MTX34 *out, const MTX34 *in) { - PSMTXCopy(*in, *out); + MTXCopy(*in, *out); return out; } inline MTX34 *MTX34Identity(MTX34 *mtx) { - PSMTXIdentity(*mtx); + MTXIdentity(*mtx); return mtx; } inline u32 MTX34Inv(MTX34 *out, const MTX34 *in) { - return PSMTXInverse(*in, *out); + return MTXInverse(*in, *out); } inline u32 MTX34InvTranspose(MTX34 *pOut, const MTX34 *pIn) { - return PSMTXInvXpose(*pIn, *pOut); + return MTXInvXpose(*pIn, *pOut); } inline MTX34 *MTX34LookAt(MTX34 *mtx, const VEC3 *pos, const VEC3 *up, const VEC3 *target) { @@ -519,12 +519,12 @@ inline MTX34 *MTX34LookAt(MTX34 *mtx, const VEC3 *pos, const VEC3 *up, const VEC } inline MTX34 *MTX34Mult(MTX34 *out, const MTX34 *a, const MTX34 *b) { - PSMTXConcat(*a, *b, *out); + MTXConcat(*a, *b, *out); return out; } inline MTX34 *MTX34MultArray(MTX34 *out, const MTX34 *p1, const MTX34 *src, u32 len) { - PSMTXConcatArray(*p1, *src, *out, len); + MTXConcatArray(*p1, *src, *out, len); return out; } @@ -541,7 +541,7 @@ inline MTX34 *MTX34RotXYZRad(MTX34 *mtx, f32 rx, f32 ry, f32 rz) { } inline MTX34 *MTX34Scale(MTX34 *out, const VEC3 *scale, const MTX34 *in) { - PSMTXScaleApply(*in, *out, scale->x, scale->y, scale->z); + MTXScaleApply(*in, *out, scale->x, scale->y, scale->z); return out; } @@ -551,7 +551,7 @@ inline QUAT *MTX34ToQUAT(QUAT *quat, const MTX34 *mtx) { } inline MTX34 *MTX34Trans(MTX34 *out, const VEC3 *trans, const MTX34 *in) { - PSMTXTransApply(*in, *out, trans->x, trans->y, trans->z); + MTXTransApply(*in, *out, trans->x, trans->y, trans->z); return out; } @@ -569,7 +569,7 @@ MTX44 *MTX44Copy(MTX44 *dst, const MTX44 *src); * ******************************************************************************/ inline MTX34 *QUATToMTX34(MTX34 *mtx, const QUAT *quat) { - PSMTXQuat(*mtx, *quat); + MTXQuat(*mtx, *quat); return mtx; } diff --git a/include/rvl/MTX/mtx.h b/include/rvl/MTX/mtx.h index de5a32f4..2283df0c 100644 --- a/include/rvl/MTX/mtx.h +++ b/include/rvl/MTX/mtx.h @@ -31,6 +31,7 @@ typedef struct Quaternion { #define MTXIdentity PSMTXIdentity #define MTXCopy PSMTXCopy #define MTXConcat PSMTXConcat +#define MTXConcatArray PSMTXConcatArray #define MTXInverse PSMTXInverse #define MTXTranspose PSMTXTranspose #define MTXInverse PSMTXInverse |
