rapier
rapier copied to clipboard
Add the ability to query rapier for force effects
Sometimes it's important to be able to predict what effect applying a force or impulse to a body will have before actually applying it. It would be nice to to have a dry run version of apply_impulse_at_point
which returns the torque the body will experience. A slightly more involved version might be to have a way to create a dry run version of an existing RigidBody which you can then apply many forces to and at the end query it for the total force and torque it experienced.
A motivating example: Say I have a player designed space ship with arbitrarily placed engines. In order to plan how to fire the engines to produce a desired motion I have to be able to predict what effect the engines would have before I actually apply the forces. Currently I have to build a (admittedly not very complicated) model of the body and forces outside of rapier in order to do that planning which adds an opportunity for error and some friction.
Semi-related: dimforge/rapier#324 (that issue should maybe have been opened here instead).