I would now like to power the joint that connects the two links. I would prefer to do this by applying joint torques because I'm trying to implement a research paper which applies joint torques to animate their multi body characters.
If I call btMultiBody::addJointTorque(0, F) to add torque to the joint created on multibody link 0, where F is my force, before every simulation step, it has no effect. I've tried small (1) and large (2000) values for F, and it makes no difference.
I can manage to make the joint move by creating a btMultiBodyJointMotor for my btMultiBody, and adding it to the dynamicsWorld's constraints:
Code: Select all
btMultiBodyJointMotor * con = new btMultiBodyJointMotor(multiBody,0,3,500000);
this->dynamicsWorld->addMultiBodyConstraint(con);
However this motor is setup by specifying a target velocity and the max force used to reach the target velocity, and as I said earlier, I would like a way to simply add joint torques so that I can more easily implement a research paper. It looks like btMultiBody::addJointTorque is the answer, but am I using it incorrectly, or is it not fully implemented yet?
P.S. I'm using Bullet 2.82 with debug drawing.