Match MarioActor::updateRotationInfo

This commit is contained in:
Headpenguin 2023-06-29 20:20:25 -04:00
parent 723f89bffd
commit 3ea32bf3ea
2 changed files with 35 additions and 4 deletions

View File

@ -249,10 +249,6 @@ namespace JGeometry {
return f;
}
Vec multToVec(T scalar) {
}
TVec3<T> operator/(T) const;
bool operator==(const TVec3<T> &);
@ -669,6 +665,12 @@ namespace JGeometry {
}
}
inline void multAssignInline(T scalar) {
x *= scalar;
y *= scalar;
z *= scalar;
}
T x, y, z;
};

View File

@ -210,3 +210,32 @@ XjointTransform* MarioActor::getJointCtrl(const char *name) const {
XanimeCore *core = _234 -> _c -> mCore;
return core -> getJointTransform(MR::getJointIndex(this, name));
}
void MarioActor::updateRotationInfo() {
TRot3f stack_44;
PSMTXConcat(getBaseMtx(), _e3c.toMtxPtr(), stack_44.toMtxPtr());
MR::makeRTFromMtxPtr(NULL, &mRotation, stack_44.toMtxPtr(), true);
if(mRotation.z > 90f && mRotation.x > 90f) {
f32 diff = 180f - mRotation.y;
mRotation.z = 0f;
mRotation.y = diff;
mRotation.x = 0f;
}
stack_44.getEuler(_318);
_318.multAssignInline(57.2957763672f);
stack_44.getEuler(_324);
_324.multAssignInline(57.2957763672f);
if(MR::isSameDirection(_240, _230 -> _208, .01f)) _a18 = mRotation;
else {
TPos3f stack_14;
TVec3f stack_8 = -_240;
MR::makeMtxUpFront(&stack_14, stack_8, _230 -> _208);
MR::makeRTFromMtxPtr(NULL, &_a18, stack_14.toMtxPtr(), true);
if(_a18.z > 90f && _a18.x > 90f) {
f32 diff = 180f - _a18.y;
_a18.z = 0f;
_a18.y = diff;
_a18.x = 0f;
}
}
}