fix for btGeneric6DofConstraint, when the btRotationalLimitMotor goes over PI or under -PI.
See http://bulletphysics.org/Bullet/phpBB3/viewtopic.php?f=9&t=5046&p=27113#p27113 Thanks zlash for the fix/report and Flix for the reminder.
This commit is contained in:
@@ -130,12 +130,20 @@ int btRotationalLimitMotor::testLimitValue(btScalar test_value)
|
||||
{
|
||||
m_currentLimit = 1;//low limit violation
|
||||
m_currentLimitError = test_value - m_loLimit;
|
||||
if(m_currentLimitError>SIMD_PI)
|
||||
m_currentLimitError-=SIMD_2_PI;
|
||||
else if(m_currentLimitError<-SIMD_PI)
|
||||
m_currentLimitError+=SIMD_2_PI;
|
||||
return 1;
|
||||
}
|
||||
else if (test_value> m_hiLimit)
|
||||
{
|
||||
m_currentLimit = 2;//High limit violation
|
||||
m_currentLimitError = test_value - m_hiLimit;
|
||||
if(m_currentLimitError>SIMD_PI)
|
||||
m_currentLimitError-=SIMD_2_PI;
|
||||
else if(m_currentLimitError<-SIMD_PI)
|
||||
m_currentLimitError+=SIMD_2_PI;
|
||||
return 2;
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user