Interface CollisionListener

All Superinterfaces:
java.util.EventListener
Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

@FunctionalInterface
public interface CollisionListener
extends java.util.EventListener
This listener provides callbacks for collision events on ICollisionEntity.
  • Method Summary

    Modifier and TypeMethodDescription
    voidcollisionResolved​(CollisionEvent event)
    This method gets called after a collision has been resolved with the related ICollisionEntity.
  • Method Details

    • collisionResolved

      void collisionResolved​(CollisionEvent event)
      This method gets called after a collision has been resolved with the related ICollisionEntity.

      If the entity is considered to be the "active collider" of the collision (i.e. it was moved with the PhysicsEngine), the event provides all other entities for which a collision had to be resolved during the movement.

      If an entity was just in a collision resolving process (i.e. was "touched" by an actively moved collider), the event contains a reference to the collider instance.

      Parameters:
      event - The collision event.
      See Also:
      PhysicsEngine.move(IMobileEntity, double, double), CollisionEvent.getInvolvedEntities()