A callback class for contact events. Contact events between two shapes will occur in following order:

  1. beginContact
  2. preSolve (before velocity update)
  3. postSolve (after velocity update)
  4. (repeats 2. and 3. every frame while the shapes are touching)
  5. endContact

Constructor

new()

Default constructor.

Methods

beginContact(c:Contact):Void

This is called when two shapes start touching each other. c is the contact of the two shapes.

endContact(c:Contact):Void

This is called when two shapes end touching each other. c is the contact of the two shapes.

postSolve(c:Contact):Void

This is called every frame after velocity solver iterations while two shapes are touching. c is the contact for the two shapes.

preSolve(c:Contact):Void

This is called every frame before velocity solver iterations while two shapes are touching. c is the contact for the two shapes.