I am trying to implement a ragdoll in Bullet Physics, mimicking one I created in a Maya plugin which uses PhysX. I have everything 1:1 besides constraint motors.
In physX, motors simply have linear and angular damping/stiffness and a target represented as a mat4 (position and rotation).
Ideally I'd be using btConeTwist
but it doesn't seem to have linear/angular motor settings so I have switched to btGeneric6DofConstraint
which does provide accessability, which I am setting as follows, I think it's correct...
// Angular
joint.dof6->getRotationalLimitMotor(0)->m_damping = joint.drive_angularDamping;
joint.dof6->getRotationalLimitMotor(1)->m_damping = joint.drive_angularDamping;
joint.dof6->getRotationalLimitMotor(2)->m_damping = joint.drive_angularDamping;
joint.dof6->getRotationalLimitMotor(0)->m_limitSoftness = (1 / joint.drive_angularStiffness);
joint.dof6->getRotationalLimitMotor(1)->m_limitSoftness = (1 / joint.drive_angularStiffness);
joint.dof6->getRotationalLimitMotor(2)->m_limitSoftness = (1 / joint.drive_angularStiffness);
// Linear
joint.dof6->getTranslationalLimitMotor()->m_damping = joint.drive_linearDampening;
joint.dof6->getTranslationalLimitMotor()->m_limitSoftness = (1 / joint.drive_linearStiffness);
The problem is I can not find any way to set the motor target. It must have one, that is a motor's sole purpose, rotating/translating a rigid body towards a target rotation/translation.
The Bullet docs are lacking to say the least, any insight or advice would be incredible.