diff options
Diffstat (limited to 'servers/physics')
-rw-r--r-- | servers/physics/joints/generic_6dof_joint_sw.cpp | 2 | ||||
-rw-r--r-- | servers/physics/joints/generic_6dof_joint_sw.h | 6 |
2 files changed, 3 insertions, 5 deletions
diff --git a/servers/physics/joints/generic_6dof_joint_sw.cpp b/servers/physics/joints/generic_6dof_joint_sw.cpp index 9b1a41e80d..60505c08c5 100644 --- a/servers/physics/joints/generic_6dof_joint_sw.cpp +++ b/servers/physics/joints/generic_6dof_joint_sw.cpp @@ -83,7 +83,7 @@ int G6DOFRotationalLimitMotorSW::testLimitValue(real_t test_value) { real_t G6DOFRotationalLimitMotorSW::solveAngularLimits( real_t timeStep, Vector3 &axis, real_t jacDiagABInv, BodySW *body0, BodySW *body1) { - if (needApplyTorques() == false) return 0.0f; + if (!needApplyTorques()) return 0.0f; real_t target_velocity = m_targetVelocity; real_t maxMotorForce = m_maxMotorForce; diff --git a/servers/physics/joints/generic_6dof_joint_sw.h b/servers/physics/joints/generic_6dof_joint_sw.h index b350546c5d..035525c9e6 100644 --- a/servers/physics/joints/generic_6dof_joint_sw.h +++ b/servers/physics/joints/generic_6dof_joint_sw.h @@ -118,14 +118,12 @@ public: //! Is limited bool isLimited() { - if (m_loLimit >= m_hiLimit) return false; - return true; + return (m_loLimit < m_hiLimit); } //! Need apply correction bool needApplyTorques() { - if (m_currentLimit == 0 && m_enableMotor == false) return false; - return true; + return (m_enableMotor || m_currentLimit != 0); } //! calculates error |