Interface TimeOfImpactListener<T extends PhysicsBody>
-
- Type Parameters:
T
- thePhysicsBody
type
- All Superinterfaces:
WorldEventListener
- All Known Implementing Classes:
TimeOfImpactListenerAdapter
public interface TimeOfImpactListener<T extends PhysicsBody> extends WorldEventListener
Interface to listen for time of impact events.Time of impact events are events fired when a collision was missed by the discrete collision detection routines, and then caught by the continuous collision detection routines.
Modification of the
PhysicsWorld
is not permitted during these methods.- Since:
- 1.2.0
- Version:
- 4.2.1
- Author:
- William Bittle
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description boolean
collision(T body1, BodyFixture fixture1, T body2, BodyFixture fixture2)
Called before thePhysicsBody
s andBodyFixture
s are tested for a time of impact collision.boolean
collision(T body1, BodyFixture fixture1, T body2, BodyFixture fixture2, TimeOfImpact toi)
Called when a time of impact has been detected between two bodies.boolean
collision(T body1, T body2)
Called when a time of impact has been detected between two bodies during the broad-phase.boolean
collision(T body1, T body2, TimeOfImpact toi)
Called when the minimum time of impact has been found for the first body.
-
-
-
Method Detail
-
collision
boolean collision(T body1, T body2)
Called when a time of impact has been detected between two bodies during the broad-phase.Returning true from this method indicates that the collision of these two
PhysicsBody
s should be processed (solved).- Parameters:
body1
- the firstPhysicsBody
body2
- the secondPhysicsBody
- Returns:
- boolean true if the collision should be handled
- Since:
- 4.1.0
-
collision
boolean collision(T body1, BodyFixture fixture1, T body2, BodyFixture fixture2)
Called before thePhysicsBody
s andBodyFixture
s are tested for a time of impact collision.Returning true from this method indicates that the collision of these two
PhysicsBody
s should be tested.- Parameters:
body1
- the firstPhysicsBody
fixture1
- the firstPhysicsBody
'sFixture
body2
- the secondPhysicsBody
fixture2
- the firstPhysicsBody
'sFixture
- Returns:
- boolean true if the collision should be handled
- Since:
- 4.1.0
-
collision
boolean collision(T body1, BodyFixture fixture1, T body2, BodyFixture fixture2, TimeOfImpact toi)
Called when a time of impact has been detected between two bodies.Returning true from this method indicates that the collision of these two
PhysicsBody
s should be processed (solved).The values of the
toi
parameter can be changed in this method.- Parameters:
body1
- the firstPhysicsBody
fixture1
- the firstPhysicsBody
'sFixture
body2
- the secondPhysicsBody
fixture2
- the secondPhysicsBody
'sFixture
toi
- theTimeOfImpact
- Returns:
- boolean true if the collision should be handled
- Since:
- 2.0.0
-
collision
boolean collision(T body1, T body2, TimeOfImpact toi)
Called when the minimum time of impact has been found for the first body.Returning true from this method indicates that the collision of these two
PhysicsBody
s should be processed (solved).The values of the
toi
parameter can be changed in this method.- Parameters:
body1
- the firstPhysicsBody
body2
- the secondPhysicsBody
toi
- theTimeOfImpact
- Returns:
- boolean true if the collision should be handled
- Since:
- 4.2.1
-
-