This class is used as a delegate to recieve collision events.
Chipmunk works by having a single collision callback for a pair of colliding shapes. It doesn't work like Unity by sending messages like OnCollisionEnter() to all MonoBehaviors attached to the collider. Unity uses private API magic to be able to send those events efficiently. You can have multiple ChipmunkCollisionManager objects within a scene. There are four events you can catch that are described below. As an example, when you want to find out when a shape with a @ChipmunkShape.collisionType@ of "player"
begins colliding with one of @ChipmunkShape.collisionType@ "monster"
, you would need to make a ChipmunkBegin_player_monster()
method on a manager in the scene.
ChipmunkBegin_type1_type2 | Called on the first fixed time step that two shapes with the given @ChipmunkShape.collisionType@s begin colliding. |
ChipmunkPreSolve_type1_type2 | Called each fixed time step for two shapes with the given @ChipmunkShape.collisionType@s before the solver runs. |
ChipmunkPostSolve_type1_type2 | Called each fixed time step for two shapes with the given @ChipmunkShape.collisionType@s after the solver runs. |
ChipmunkSeparate_type1_type2 | Called on the first fixed time step after two shapes with the given @ChipmunkShape.collisionType@s have stopped colliding. |