PxD6Joint Drive Force

I have a simple drive on a pxD6Joint. I am using this as a revolute joint with the twist degree of freedom. And I want to know the force applied by the drive. How do I get that value? Lets say, that for actor0, actor1, constraints frames all have the same orientation but different location with the twist along the x axis. I tried doing a joint->getConstraint()->getForce(force, torque). But that does not appear to include the force generated by the drive. So lets say, I project the torque onto the actor1’s xaxis, the value is always zero. But the drive is clearly exerting a non-zero torque as my mechanism is moving as expected.

Is there any way I can extract this piece of information?


The problem appears to be that only the joint forces for locked axes are reported. Any limits or drives do not report the applied force. I haven’t been able to establish yet what the reason is for this.

If you search the codebase for the code that sets the following flag:


you should see that this depends on Px1DConstraintFlag::eOUTPUT_FORCE.

You should be able to get the forces reported for all constraints by ensuring that either DY_SC_FLAG_OUTPUT_FORCE is raised on the flags in the constraint rows or that Px1DConstraintFlag::eOUTPUT_FORCE is raised for all rows by the joint shaders.

Please let me know if this resolves your issue.