Module org.dyn4j
Package org.dyn4j.world.listener
Class TimeOfImpactListenerAdapter<T extends PhysicsBody>
- Object
-
- TimeOfImpactListenerAdapter<T>
-
- Type Parameters:
T
- thePhysicsBody
type
- All Implemented Interfaces:
TimeOfImpactListener<T>
,WorldEventListener
public class TimeOfImpactListenerAdapter<T extends PhysicsBody> extends Object implements TimeOfImpactListener<T>
Convenience class for implementing theTimeOfImpactListener
interface.- Since:
- 1.2.0
- Version:
- 4.0.0
- Author:
- William Bittle
-
-
Constructor Summary
Constructors Constructor Description TimeOfImpactListenerAdapter()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
collision(T body1, BodyFixture fixture1, T body2, BodyFixture fixture2, TimeOfImpact toi)
Called when a time of impact has been detected between two bodies.
-
-
-
Method Detail
-
collision
public boolean collision(T body1, BodyFixture fixture1, T body2, BodyFixture fixture2, TimeOfImpact toi)
Description copied from interface:TimeOfImpactListener
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.- Specified by:
collision
in interfaceTimeOfImpactListener<T extends PhysicsBody>
- 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
-
-