CollisionHandler class

Struct that holds function callback pointers to configure custom collision handling. Collision handlers have a pair of types; when a collision occurs between two shapes that have these types, the collision handler functions are triggered.

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
typeA int
Collision type identifier of the first shape that this handler recognizes. In the collision handler callback, the shape with this type will be the first argument. Read only.
no setter
typeb int
Collision type identifier of the second shape that this handler recognizes. In the collision handler callback, the shape with this type will be the second argument. Read only.
no setter

Methods

begin(bool beginFunc(Arbiter arbiter, Space space)) → void
This function is called when two shapes with types that match this collision handler begin colliding.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
postSolve(void postSolveFunc(Arbiter arbiter, Space space)) → void
This function is called each step when two shapes with types that match this collision handler are colliding. It's called after the collision solver runs so that you can read back information about the collision to trigger events in your game.
preSolve(bool preSolveFunc(Arbiter arbiter, Space space)) → void
This function is called each step when two shapes with types that match this collision handler are colliding. It's called before the collision solver runs so that you can affect a collision's outcome.
separate(void separateFunc(Arbiter arbiter, Space space)) → void
This function is called when two shapes with types that match this collision handler stop colliding.
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited