Only use the max motor impulse if it is positive (it defaults to -1).

This commit is contained in:
Cameron White
2015-08-27 16:03:02 -04:00
parent 29b251e81b
commit 86880a2795

View File

@@ -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;
}
}