From 86880a27951d9d88ca2c509b9aaba4f937abb66e Mon Sep 17 00:00:00 2001 From: Cameron White Date: Thu, 27 Aug 2015 16:03:02 -0400 Subject: [PATCH] Only use the max motor impulse if it is positive (it defaults to -1). --- src/BulletDynamics/ConstraintSolver/btConeTwistConstraint.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/BulletDynamics/ConstraintSolver/btConeTwistConstraint.cpp b/src/BulletDynamics/ConstraintSolver/btConeTwistConstraint.cpp index a7ed69f5c..09b7388b6 100644 --- a/src/BulletDynamics/ConstraintSolver/btConeTwistConstraint.cpp +++ b/src/BulletDynamics/ConstraintSolver/btConeTwistConstraint.cpp @@ -214,7 +214,7 @@ void btConeTwistConstraint::getInfo2NonVirtual (btConstraintInfo2* info,const bt } // m_swingCorrection is always positive or 0 info->m_lowerLimit[srow] = 0; - info->m_upperLimit[srow] = m_bMotorEnabled ? m_maxMotorImpulse : SIMD_INFINITY; + info->m_upperLimit[srow] = (m_bMotorEnabled && m_maxMotorImpulse >= 0.0f) ? m_maxMotorImpulse : SIMD_INFINITY; srow += info->rowskip; } }