Possible to override the effects of collisions?


#1

Is it possible to override the effects of collisions? For example, maybe I could supply a callback that nphysics calls whenever a collision occurs. That callback performs all velocity changes.


#2

This is currently not possible, but that’s an interesting feature that could be added.
Would you have an example of use-case for this? Having a concrete use-case in mind would help me design the public interface.

Also by “overriding the effects of collisions” do you also include position changes (due to nphysics trying to fix penetration)? Or would you find it more useful to just set the velocities yourself but let nphysics move the objects to fix penetrations?


#3

There are cases where a general-purpose physics engine does not cut it. For example, billiards simulation. Maybe in such cases there can be a way for the programmer to specify what happens after each collision without having to edit the code directly.