Module org.dyn4j
Package org.dyn4j.world.listener
Interface BoundsListener<T extends CollisionBody<E>,E extends Fixture>
-
- Type Parameters:
T
- theCollisionBody
typeE
- theFixture
type
- All Superinterfaces:
WorldEventListener
- All Known Implementing Classes:
BoundsListenerAdapter
public interface BoundsListener<T extends CollisionBody<E>,E extends Fixture> extends WorldEventListener
Represents an object that is notified when aCollisionBody
goes out ofBounds
.NOTE: Modification of the simulation in these methods can cause unexpected behavior.
- Since:
- 1.0.0
- Version:
- 4.0.0
- Author:
- William Bittle
- See Also:
Bounds
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
outside(T body)
Method called when aCollisionBody
is outside theBounds
of a simulation.
-
-
-
Method Detail
-
outside
void outside(T body)
Method called when aCollisionBody
is outside theBounds
of a simulation.The
CollisionBody
must be fully outside the bounds defined in the world. This means that all the fixtures are outside the bounds.When this is detected the
CollisionBody
is set to disabled and is effectively ignored until moved back within the bounds and enabled again.Typically this event is used to clean up bodies that have strayed from the simulation, but be aware that the removal of the body cannot be done here. Instead it must be done after the simulation step completes.
- Parameters:
body
- theCollisionBody
outside theBounds
-
-