Class CollisionListenerAdapter<T extends CollisionBody<E>,E extends Fixture>
- Object
-
- CollisionListenerAdapter<T,E>
-
- Type Parameters:
T
- theCollisionBody
typeE
- theFixture
type
- All Implemented Interfaces:
CollisionListener<T,E>
,WorldEventListener
public class CollisionListenerAdapter<T extends CollisionBody<E>,E extends Fixture> extends Object implements CollisionListener<T,E>
Convenience class for implementing theCollisionListener
interface.This class can be used to implement only the methods desired instead of all the methods contained in the
CollisionListener
interface.By default this class allows processing to continue for all collision events.
- Since:
- 1.0.0
- Version:
- 4.0.0
- Author:
- William Bittle
-
-
Constructor Summary
Constructors Constructor Description CollisionListenerAdapter()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
collision(BroadphaseCollisionData<T,E> collision)
Called when twoFixture
s are colliding as determined by theBroadphaseDetector
.boolean
collision(ManifoldCollisionData<T,E> collision)
boolean
collision(NarrowphaseCollisionData<T,E> collision)
Called when twoFixture
s are colliding as determined by theNarrowphaseDetector
.
-
-
-
Method Detail
-
collision
public boolean collision(BroadphaseCollisionData<T,E> collision)
Description copied from interface:CollisionListener
Called when twoFixture
s are colliding as determined by theBroadphaseDetector
.CollisionBody
objects can have manyConvex
Shape
s that make up their geometry. Because of this, this method may be called multiple times if two multi-fixturedCollisionBody
s are colliding.This method is called when the two
Fixture
's expandedAABB
s are overlapping. Visually the bodies may not appear to be colliding (which is a valid case). If you need to make sure theCollisionBody
s are colliding, and not just their AABBs, use theCollisionListener.collision(NarrowphaseCollisionData)
method.Return false from this method to stop processing of this collision. Other
CollisionListener
s will still be notified of this event, however, no further collision or contact events will occur for this pair.The
CollisionListener.collision(NarrowphaseCollisionData)
method is next in the sequence of collision events.- Specified by:
collision
in interfaceCollisionListener<T extends CollisionBody<E>,E extends Fixture>
- Parameters:
collision
- the broadphase collision data- Returns:
- boolean true if processing should continue for this collision
-
collision
public boolean collision(NarrowphaseCollisionData<T,E> collision)
Description copied from interface:CollisionListener
Called when twoFixture
s are colliding as determined by theNarrowphaseDetector
.CollisionBody
objects can have manyConvex
Shape
s that make up their geometry. Because of this, this method may be called multiple times if two multi-fixturedCollisionBody
s are colliding.Return false from this method to stop processing of this collision. Other
CollisionListener
s will still be notified of this event, however, no further collision or contact events will occur for this pair.The
CollisionListener.collision(ManifoldCollisionData)
method is next in the sequence of collision events.- Specified by:
collision
in interfaceCollisionListener<T extends CollisionBody<E>,E extends Fixture>
- Parameters:
collision
- the narrowphase collision data- Returns:
- boolean true if processing should continue for this collision
-
collision
public boolean collision(ManifoldCollisionData<T,E> collision)
Description copied from interface:CollisionListener
Called when twoFixture
s are colliding and a contactManifold
has been found.CollisionBody
objects can have manyConvex
Shape
s that make up their geometry. Because of this, this method may be called multiple times if two multi-fixturedCollisionBody
s are colliding.Modification of the
Manifold
object is allowed. TheManifold
is used to create contact constraints.Return false from this method to stop processing of this collision. Other
CollisionListener
s will still be notified of this event, however, no further collision or contact events will occur for this pair.- Specified by:
collision
in interfaceCollisionListener<T extends CollisionBody<E>,E extends Fixture>
- Parameters:
collision
- the manifold collision data- Returns:
- boolean true if processing should continue for this collision
-
-