public interface ContactListener
Notified when bodies in a PhysicsWorld start and stop touching. Register with
PhysicsWorld#addContactListener(ContactListener).
Callbacks fire from inside PhysicsWorld#step(float) – i.e. on the game loop
thread – so it is safe to read and update game state directly, but you must not
create or destroy bodies during the callback (defer that until after step
returns).
Methods
public abstract void beginContact(PhysicsContact contact) | Called when two fixtures begin touching. |
public abstract void endContact(PhysicsContact contact) | Called when two fixtures stop touching. |
Method details
beginContact
public abstract void beginContact(PhysicsContact contact)Called when two fixtures begin touching.
endContact
public abstract void endContact(PhysicsContact contact)Called when two fixtures stop touching.