CollisionHandler

cp. CollisionHandler

new CollisionHandler()

Source:
Collision handlers are user-defined objects to describe the behaviour of colliding objects.

Methods

begin(arb, space) → {boolean}

Source:
Collision begin event callback Returning false from a begin callback causes the collision to be ignored until the the separate callback is called when the objects stop colliding.
Parameters:
Name Type Description
arb Arbiter
space cp.Space
Returns:
Type
boolean

postSolve(arb, space)

Source:
Collision post-solve event function callback type.
Parameters:
Name Type Description
arb Arbiter
space cp.Space

preSolve(arb, space) → {boolean}

Source:
Collision pre-solve event callback Returning false from a pre-step callback causes the collision to be ignored until the next step.
Parameters:
Name Type Description
arb Arbiter
space cp.Space
Returns:
Type
boolean

separate(arb, space)

Source:
Collision separate event function callback type.
Parameters:
Name Type Description
arb Arbiter
space cp.Space