NVIDIAGameWorks / PhysX-3.4

NVIDIA PhysX SDK 3.4
https://www.nvidia.com/
2.34k stars 275 forks source link

How to handle external forces/loads on a revolute joint motor? #136

Open mimon opened 2 years ago

mimon commented 2 years ago

I have a revolute joint attached to an actor and set a velocity target in the motor. No problems, until when external forces resist the motor. The motor will only ever exert the amount force it would take to bring the mass of the actor it's attached to up to speed. It does not scale up the force to account for other actors attached, collisions or gravity. This means that it will likely never get to the desired speed even though it is not exerting all its allotted force. In my case I've set the max force to PX_MAX_F32. I have the same problem when I want the motor to keep the actor steady at velocity zero (given that it's got sufficient force to apply).

I'm trying to build cranes in my simulation and I don't know how to solve this the best way. Should I somehow implement my own motor that can handle external forces? Any other tips?

Cheers