diff options
| author | robojumper <robojumper@gmail.com> | 2026-05-07 21:23:47 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-05-07 21:23:47 +0200 |
| commit | f7b4c029fd5176e817e3de7209727480c445a3d2 (patch) | |
| tree | 9cddc9fa36ec13e7dac76c54d74257c61fe20b47 /src/JSystem/JParticle/JPAMath.cpp | |
| parent | ddb116187922a3f73ae3c97a136f499b7d724a2c (diff) | |
| parent | f4d163797f3c21e5a705b75043e0a8fbe7dc2460 (diff) | |
Merge pull request #313 from robojumper/vec-mtx-cleanup
Cleanup
Diffstat (limited to 'src/JSystem/JParticle/JPAMath.cpp')
| -rw-r--r-- | src/JSystem/JParticle/JPAMath.cpp | 54 |
1 files changed, 15 insertions, 39 deletions
diff --git a/src/JSystem/JParticle/JPAMath.cpp b/src/JSystem/JParticle/JPAMath.cpp index 8d3eba27..d3e072a8 100644 --- a/src/JSystem/JParticle/JPAMath.cpp +++ b/src/JSystem/JParticle/JPAMath.cpp @@ -1,8 +1,3 @@ -// -// Generated By: dol2asm -// Translation Unit: JPAMath -// - #include "JSystem/JParticle/JPAMath.h" #include "JSystem/JMath/JMath.h" @@ -10,8 +5,6 @@ #include "egg/math/eggVector.h" #include "nw4r/math/math_triangular.h" -/* 80280588-802806C0 27AEC8 0138+00 0/0 1/1 0/0 .text JPAGetDirMtx__FRCQ29JGeometry8TVec3<f>PA4_f - */ void JPAGetDirMtx(EGG::Vector3f const& param_0, f32 (*param_1)[4]) { 1.0f; // probably some dummy function @@ -42,7 +35,6 @@ void JPAGetDirMtx(EGG::Vector3f const& param_0, f32 (*param_1)[4]) { param_1[2][3] = 0.0f; } -/* 802806C0-80280734 27B000 0074+00 0/0 1/1 0/0 .text JPAGetYZRotateMtx__FssPA4_f */ void JPAGetYZRotateMtx(s16 angleY, s16 angleZ, f32 (*param_2)[4]) { f32 cosy = nw4r::math::CosIdx(angleY); f32 cosz = nw4r::math::CosIdx(angleZ); @@ -56,13 +48,9 @@ void JPAGetYZRotateMtx(s16 angleY, s16 angleZ, f32 (*param_2)[4]) { param_2[1][2] = (siny * sinz); param_2[2][0] = -siny; param_2[2][2] = cosy; - param_2[2][3] = 0.0f; - param_2[2][1] = 0.0f; - param_2[1][3] = 0.0f; - param_2[0][3] = 0.0f; + param_2[0][3] = param_2[1][3] = param_2[2][1] = param_2[2][3] = 0.0f; } -/* 80280734-802807E0 27B074 00AC+00 0/0 6/6 11/11 .text JPAGetXYZRotateMtx__FsssPA4_f */ void JPAGetXYZRotateMtx(s16 x, s16 y, s16 z, Mtx mtx) { f32 cosx = nw4r::math::CosIdx(x); f32 cosy = nw4r::math::CosIdx(y); @@ -75,37 +63,26 @@ void JPAGetXYZRotateMtx(s16 x, s16 y, s16 z, Mtx mtx) { mtx[2][0] = -siny; mtx[2][1] = sinx * cosy; mtx[2][2] = cosx * cosy; - f32 sinxsinz; - f32 cosxcosz; - f32 cosxsinz; - f32 sinxcosz; - cosxsinz = cosx * sinz; - sinxcosz = sinx * cosz; - mtx[0][1] = sinxcosz * siny - cosxsinz; - mtx[1][2] = cosxsinz * siny - sinxcosz; - sinxsinz = sinx * sinz; - cosxcosz = cosx * cosz; - mtx[0][2] = sinxsinz + cosxcosz * siny; - mtx[1][1] = cosxcosz + sinxsinz * siny; - mtx[2][3] = 0.0f; - mtx[1][3] = 0.0f; - mtx[0][3] = 0.0f; + f32 f30 = cosx * sinz; + f32 f29 = sinx * cosz; + mtx[0][1] = f29 * siny - f30; + mtx[1][2] = f30 * siny - f29; + f30 = sinx * sinz; + f29 = cosx * cosz; + mtx[0][2] = f30 + f29 * siny; + mtx[1][1] = f29 + f30 * siny; + mtx[0][3] = mtx[1][3] = mtx[2][3] = 0.0f; } -/* 802807E0-80280808 27B120 0028+00 0/0 11/11 71/71 .text - * JPASetRMtxTVecfromMtx__FPA4_CfPA4_fPQ29JGeometry8TVec3<f> */ -void JPASetRMtxTVecfromMtx(f32 const (*param_0)[4], f32 (*param_1)[4], EGG::Vector3f *param_2) { +void JPASetRMtxTVecfromMtx(f32 const (*param_0)[4], f32 (*param_1)[4], + EGG::Vector3f* param_2) { EGG::Vector3f dummy; JPASetRMtxSTVecfromMtx(param_0, param_1, &dummy, param_2); } -/* 80280808-80280984 27B148 017C+00 1/1 1/1 53/53 .text - * JPASetRMtxSTVecfromMtx__FPA4_CfPA4_fPQ29JGeometry8TVec3<f>PQ29JGeometry8TVec3<f> */ -void JPASetRMtxSTVecfromMtx( - f32 const (*param_0)[4], f32 (*param_1)[4], EGG::Vector3f *param_2, EGG::Vector3f *param_3 -) { - EGG::Vector3f aTStack_54; - aTStack_54.set(param_0[0][0], param_0[1][0], param_0[2][0]); +void JPASetRMtxSTVecfromMtx(f32 const (*param_0)[4], f32 (*param_1)[4], + EGG::Vector3f* param_2, EGG::Vector3f* param_3) { + EGG::Vector3f aTStack_54(param_0[0][0], param_0[1][0], param_0[2][0]); param_2->x = aTStack_54.length(); aTStack_54.set(param_0[0][1], param_0[1][1], param_0[2][1]); param_2->y = aTStack_54.length(); @@ -133,7 +110,6 @@ void JPASetRMtxSTVecfromMtx( param_3->set(param_0[0][3], param_0[1][3], param_0[2][3]); } -/* 80280984-80280A48 27B2C4 00C4+00 0/0 2/1 0/0 .text JPACalcKeyAnmValue__FfUsPCf */ f32 JPACalcKeyAnmValue(f32 param_0, u16 param_1, f32 const* param_2) { if (param_0 < param_2[0]) { return param_2[1]; |
