My simple test looks like this at the beginning:
P DDDDD
S
S
S
The left body is static, the right one is moved by gravity and is rotating around the point P (like a clock). The angle is starting at -90. If i only use the right body for the hinge, the limits are working fine. But if I use both bodies, the right body accelerates when the limit is reached, instead of stopping.
Code: Select all
mBtHinge = new btHingeConstraint(
*ColBody->getBulletRigidBody (),
*DynColBody->getBulletRigidBody (),
OgreBulletCollisions::OgreBtConverter::to(Vector3(0,70,0)),
OgreBulletCollisions::OgreBtConverter::to(Vector3(0, +70, 0)),
OgreBulletCollisions::OgreBtConverter::to(Vector3(0,0,1)),
OgreBulletCollisions::OgreBtConverter::to(Vector3(0,0,1)));
/*
// this is working fine
mBtHinge = new btHingeConstraint(DynColBody->getBulletRigidBody(),
OgreBulletCollisions::OgreBtConverter::to(Vector3(0,70,0)),
OgreBulletCollisions::OgreBtConverter::to(Vector3(0,0,1)));
*/
mWorld->getBulletDynamicsWorld()->addConstraint(mBtHinge, true);
mBtHinge->setLimit(Math::DegreesToRadians(-140.0),Math::DegreesToRadians(-85.0),0.9f,0.3f,1.0f);