I am currently working on animating ragdoll using motorized contraints, but i get an unexpected behaviour from the 6DOF constraint.
I setup my constraint this way :
Code: Select all
btTransform t1, t2;
t1.setIdentity(); t2.setIdentity();
t1.setOrigin(btVector3(0.7f,0.f,0.f));
t2.setOrigin(btVector3(-1.1f,0.f,0.f));
btGeneric6DofSpringConstraint* rc0 = new btGeneric6DofSpringConstraint(rigidbody1, rigidbody2,
t1, t2, false);
Code: Select all
btRotationalLimitMotor* rotLim = rc0->getRotationalLimitMotor(i);
rotLim->m_enableMotor = true;
rotLim->m_targetVelocity = 25.f;
What i don't understand is that all works fine when i do the following :
Code: Select all
btTransform t1, t2; // No change
t1.setIdentity(); t2.setIdentity(); // No change
t1.setOrigin(btVector3(0.7f,0.f,0.f)); // No change
t2.setOrigin(btVector3(-1.1f,0.f,0.f)); // No change
btGeneric6DofSpringConstraint* rc0 = new btGeneric6DofSpringConstraint(rigidbody2, rigidbody1,
t2, t1, false); // inversed the order
Note that in some cases it work's fine without doing any change. Can anyone explain to me what's wrong ?
Thanks.