summaryrefslogtreecommitdiff
path: root/servers/physics/joints
diff options
context:
space:
mode:
authorAaron Franke <arnfranke@yahoo.com>2018-10-06 16:20:41 -0400
committerAaron Franke <arnfranke@yahoo.com>2018-10-06 16:20:41 -0400
commit4f7b33cdcfdcbc11bcc506018dff1b06db3cf3f6 (patch)
tree688f040a857c59629101076487c097da6bc5dff3 /servers/physics/joints
parent37386f112bafa9c4e94c342f6d5f04392a5623f7 (diff)
Remove redundant "== false" code
Some of this code has been re-organized. f
Diffstat (limited to 'servers/physics/joints')
-rw-r--r--servers/physics/joints/generic_6dof_joint_sw.cpp2
-rw-r--r--servers/physics/joints/generic_6dof_joint_sw.h6
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