Class CollisionHandler
Definition
- Assembly:
- Tizen.NUI.Physics2D.dll
A collision handler is a set of 4 function callbacks for the different collision events that Chipmunk recognizes. Collision callbacks are closely associated with Arbiter objects. You should familiarize yourself with those as well. Note #1: Shapes tagged as sensors (Sensor == true) never generate collisions that get processed, so collisions between sensor shapes and other shapes will never call the post_solve() callback. They still generate begin() and separate() callbacks, and the pre_solve() callback is also called every frame even though there is no collision response. Note #2: pre_solve() callbacks are called before the sleeping algorithm runs. If an object falls asleep, its post_solve() callback won’t be called until it’s re-awoken.
public sealed class CollisionHandler
- Inheritance
-
objectCollisionHandler
Properties
View SourceBegin
This function is called when two shapes with types that match this collision handler begin colliding
Declaration
public Action<Arbiter, Space, object> Begin { get; set; }
Property Value
Type | Description |
---|---|
Action<, , ><Arbiter, Space, object> |
Data
User definable context pointer that is passed to all of the collision handler functions.
Declaration
public object Data { get; set; }
Property Value
Type | Description |
---|---|
object |
PostSolve
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.
Declaration
public Action<Arbiter, Space, object> PostSolve { get; set; }
Property Value
Type | Description |
---|---|
Action<, , ><Arbiter, Space, object> |
PreSolve
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.
Declaration
public Func<Arbiter, Space, object, bool> PreSolve { get; set; }
Property Value
Type | Description |
---|---|
Func<, , , ><Arbiter, Space, object, bool> |
Separate
This function is called when two shapes with types that match this collision handler stop colliding.
Declaration
public Action<Arbiter, Space, object> Separate { get; set; }
Property Value
Type | Description |
---|---|
Action<, , ><Arbiter, Space, object> |
TypeA
In the collision handler callback, the shape with this type will be the first argument. Read only.
Declaration
public int TypeA { get; }
Property Value
Type | Description |
---|---|
int |
TypeB
In the collision handler callback, the shape with this type will be the second argument. Read only.
Declaration
public int TypeB { get; }
Property Value
Type | Description |
---|---|
int |