blaze.dynamics.worldCallbacks
- ContactFilter
_defaultFilter
;
- The default contact filter.
- class
ContactListener
;
- Implement this class to get collision results. You can use these results for
things like sounds and game logic. You can also get contact results by
traversing the contact lists after the time step. However, you might miss
some contacts because continuous physics leads to sub-stepping.
Additionally you may receive multiple callbacks for the same contact in a
single time step.
You should strive to make your callbacks efficient because there may be
many callbacks per time step.
Warning:
The contact separation is the last computed value.
Warning:
You cannot create/destroy Box2D entities inside these callbacks.
- abstract void
add
(ContactPoint point);
- Called when a contact point is added. This includes the geometry
and the forces.
- abstract void
persist
(ContactPoint point);
- Called when a contact point persists. This includes the geometry
and the forces.
- abstract void
remove
(ContactPoint point);
- Called when a contact point is removed. This includes the last
computed geometry and forces.
- abstract void
result
(ContactResult point);
- Called after a contact point is solved.
- class
DestructionListener
;
- Joints and shapes are destroyed when their associated
body is destroyed. Implement this listener so that you
may nullify references to these joints and shapes.
- abstract void
sayGoodbye
(Joint joint);
- Called when any joint is about to be destroyed due
to the destruction of one of its attached bodies.
- abstract void
sayGoodbye
(Shape shape);
- Called when any shape is about to be destroyed due
to the destruction of its parent body.
- class
BoundaryListener
;
- This is called when a body's shape passes outside of the world boundary.
- abstract void
violation
(Body rBody);
- This is called for each body that leaves the world boundary.
Warning:
you can't modify the world inside this callback.
- class
ContactFilter
;
- Implement this class to provide collision filtering. In other words, you can implement
this class if you want finer control over contact creation.
- bool
shouldCollide
(Shape shape1, Shape shape2);
- Returns:
true if contact calculations should be performed between these two shapes.
Warning:
for performance reasons this is only called when the AABBs begin to overlap.
Note:
If you implement your own collision filter you may want to build from this implementation.
- bool
rayCollide
(Object userData, Shape shape);
- Returns:
true if the given shape should be considered for ray intersection
- ContactFilter
defaultFilter
;
- The default contact filter.
|