-
- All Superinterfaces:
Listener
- All Known Implementing Classes:
CollisionAdapter
@Deprecated public interface CollisionListener extends Listener
Deprecated.Deprecated in 4.0.0. Use the CollisionListener in the world package instead.Interface to listen for collision events.Events for a pair of bodies (as long as they pass the criteria for the event to be called) will be called in the following order:
- Collision detected by the broadphase:
collision(Body, BodyFixture, Body, BodyFixture)
- Collision detected by the narrowphase:
collision(Body, BodyFixture, Body, BodyFixture, Penetration)
- Contact manifold created by the manifold solver:
collision(Body, BodyFixture, Body, BodyFixture, Manifold)
- Contact constraint created:
collision(ContactConstraint)
CollisionListener
s will still be notified of that event, but subsequent events will not occur (this indicates that you didn't want the collision to be resolved later).Modification of the
World
is permitted in these methods. Modification of theBody
's fixtures is not permitted (adding/removing will cause a runtime exception).- Since:
- 1.0.0
- Version:
- 4.0.0
- Author:
- William Bittle
-
-
Method Summary
All Methods Instance Methods Abstract Methods Deprecated Methods Modifier and Type Method Description boolean
collision(Body body1, BodyFixture fixture1, Body body2, BodyFixture fixture2)
Deprecated.Called when twoBodyFixture
s are colliding as determined by theBroadphaseDetector
.boolean
collision(Body body1, BodyFixture fixture1, Body body2, BodyFixture fixture2, Manifold manifold)
Deprecated.Called when twoBodyFixture
s are colliding and a contactManifold
has been found.boolean
collision(Body body1, BodyFixture fixture1, Body body2, BodyFixture fixture2, Penetration penetration)
Deprecated.Called when twoBodyFixture
s are colliding as determined by theNarrowphaseDetector
.boolean
collision(ContactConstraint contactConstraint)
Deprecated.Called after aContactConstraint
has been created for a collision.
-
-
-
Method Detail
-
collision
boolean collision(Body body1, BodyFixture fixture1, Body body2, BodyFixture fixture2)
Deprecated.Called when twoBodyFixture
s are colliding as determined by theBroadphaseDetector
. *Body
objects can have manyConvex
Shape
s that make up their geometry. Because of this, this method may be called multiple times if two multi-fixturedBody
s are colliding.This method is called when the two
BodyFixture
'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 theBody
s are colliding, and not just their AABBs, use thecollision(Body, BodyFixture, Body, BodyFixture, Penetration)
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
collision(Body, BodyFixture, Body, BodyFixture, Penetration)
method is next in the sequence of collision events.- Parameters:
body1
- the firstBody
fixture1
- the firstBody
'sBodyFixture
body2
- the secondBody
fixture2
- the secondBody
'sBodyFixture
- Returns:
- boolean true if processing should continue for this collision
- Since:
- 3.2.0
-
collision
boolean collision(Body body1, BodyFixture fixture1, Body body2, BodyFixture fixture2, Penetration penetration)
Deprecated.Called when twoBodyFixture
s are colliding as determined by theNarrowphaseDetector
.Body
objects can have manyConvex
Shape
s that make up their geometry. Because of this, this method may be called multiple times if two multi-fixturedBody
s are colliding.Modification of the
Penetration
object is allowed. ThePenetration
object passed will be used to generate the contact manifold in theManifoldSolver
.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
collision(Body, BodyFixture, Body, BodyFixture, Manifold)
method is next in the sequence of collision events.- Parameters:
body1
- the firstBody
fixture1
- the firstBody
'sBodyFixture
body2
- the secondBody
fixture2
- the secondBody
'sBodyFixture
penetration
- thePenetration
between theShape
s- Returns:
- boolean true if processing should continue for this collision
-
collision
boolean collision(Body body1, BodyFixture fixture1, Body body2, BodyFixture fixture2, Manifold manifold)
Deprecated.Called when twoBodyFixture
s are colliding and a contactManifold
has been found.Body
objects can have manyConvex
Shape
s that make up their geometry. Because of this, this method may be called multiple times if two multi-fixturedBody
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.The
collision(ContactConstraint)
method is next in the sequence of collision events.- Parameters:
body1
- the firstBody
fixture1
- the firstBody
'sBodyFixture
body2
- the secondBody
fixture2
- the secondBody
'sBodyFixture
manifold
- the contactManifold
for the collision- Returns:
- boolean true if processing should continue for this collision
-
collision
boolean collision(ContactConstraint contactConstraint)
Deprecated.Called after aContactConstraint
has been created for a collision.Body
objects can have manyConvex
Shape
s that make up their geometry. Because of this, this method may be called multiple times if two multi-fixturedBody
s are colliding.Modification of the friction and restitution (both computed using the
CoefficientMixer
and sensor fields is allowed.Setting the tangent velocity of the
ContactConstraint
can create a conveyor effect.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.This is the last collision event before contact processing (via
ContactListener
s) occur.- Parameters:
contactConstraint
- the contact constraint- Returns:
- boolean true if processing should continue for this collision
- Since:
- 3.0.2
-
-