addLocalForce/addLocalTorque

Not sure if I've missed/misunderstood something, but I had a suggestion for new API functions.



I notice that ODE has functions for adding relative forces/torques to bodies. I'm guessing that these apply forces/torques in local coordinate space? If so, I'm wondering if perhaps we could have methods for applying these forces locally, as it might make some code read a bit more cleanly? (I.e. I could addLocalForce(0, 0, 1) to simulate a simple thruster. Currently I'm getting the entity's direction, which is still fairly clean, but this might be slightly faster if it delegates the action to the physics engine.

We already have addForce which adds relative forces. The position of the force is given in world coordinates to avoid confusion about the local coordinates because they might be local to the physics node or to the geometry. The additional local-something methods are also not in the API to keep it small.

You can easily compute your world vectors from local vectors via localToWorld. Deferring this to the physics engine will hardly save anything.