summaryrefslogtreecommitdiff
path: root/src/KingSystem/Physics/RigidBody/physRigidBody.cpp
diff options
context:
space:
mode:
authorThePixelGamer <thepixelmaster2354@gmail.com>2024-07-26 18:00:57 -0500
committerThePixelGamer <thepixelmaster2354@gmail.com>2024-07-26 18:00:57 -0500
commitde0fd08acc676caad7dd2f445f221473d7cd4b75 (patch)
tree0808bc291b399ccbe9c8fe00b328f94a8da04aff /src/KingSystem/Physics/RigidBody/physRigidBody.cpp
parent96f611fa5d1c2704d91e5c490662ec8c0a741279 (diff)
Update libraries and adjust code to match again
Diffstat (limited to 'src/KingSystem/Physics/RigidBody/physRigidBody.cpp')
-rw-r--r--src/KingSystem/Physics/RigidBody/physRigidBody.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/KingSystem/Physics/RigidBody/physRigidBody.cpp b/src/KingSystem/Physics/RigidBody/physRigidBody.cpp
index 5a67d445..175dac29 100644
--- a/src/KingSystem/Physics/RigidBody/physRigidBody.cpp
+++ b/src/KingSystem/Physics/RigidBody/physRigidBody.cpp
@@ -84,9 +84,9 @@ bool RigidBody::initMotionAccessorForDynamicMotion(sead::Heap* heap) {
hkMatrix3 inertia;
body->getInertiaLocal(inertia);
- param.inertia = {sead::Mathf::max(inertia(0, 0), MinInertia),
- sead::Mathf::max(inertia(1, 1), MinInertia),
- sead::Mathf::max(inertia(2, 2), MinInertia)};
+ param.inertia = {sead::Mathf::clampMin(inertia(0, 0), MinInertia),
+ sead::Mathf::clampMin(inertia(1, 1), MinInertia),
+ sead::Mathf::clampMin(inertia(2, 2), MinInertia)};
param.center_of_mass = toVec3(body->getCenterOfMassLocal());
param.linear_damping = body->getLinearDamping();
param.angular_damping = body->getAngularDamping();
@@ -126,9 +126,9 @@ bool RigidBody::createMotion(hkpMaxSizeMotion* motion, MotionType motion_type,
case MotionType::Dynamic: {
hkMatrix3f inertia_local;
- inertia_local.m_col0.set(sead::Mathf::max(param.inertia.x, MinInertia), 0, 0);
- inertia_local.m_col1.set(0, sead::Mathf::max(param.inertia.y, MinInertia), 0);
- inertia_local.m_col2.set(0, 0, sead::Mathf::max(param.inertia.z, MinInertia));
+ inertia_local.m_col0.set(sead::Mathf::clampMin(param.inertia.x, MinInertia), 0, 0);
+ inertia_local.m_col1.set(0, sead::Mathf::clampMin(param.inertia.y, MinInertia), 0);
+ inertia_local.m_col2.set(0, 0, sead::Mathf::clampMin(param.inertia.z, MinInertia));
hkpRigidBody::createDynamicRigidMotion(
hkpMotion::MOTION_DYNAMIC, position, rotation, param.mass, inertia_local,
@@ -1630,7 +1630,7 @@ bool RigidBody::isEntityMotionFlag80On() const {
void RigidBody::setColImpulseScale(float scale) {
if (!isEntity())
return;
- scale = sead::Mathf::max(scale, 0.0);
+ scale = sead::Mathf::clampMin(scale, 0.0);
getEntityMotionAccessor()->setColImpulseScale(scale);
}