Module org.dyn4j

Interface CollisionListener<T extends CollisionBody<E>,​E extends Fixture>

    • Method Detail

      • collision

        boolean collision​(BroadphaseCollisionData<T,​E> collision)
        Called when two Fixtures are colliding as determined by the BroadphaseDetector.

        CollisionBody objects can have many Convex Shapes that make up their geometry. Because of this, this method may be called multiple times if two multi-fixtured CollisionBodys are colliding.

        This method is called when the two Fixture's expanded AABBs are overlapping. Visually the bodies may not appear to be colliding (which is a valid case). If you need to make sure the CollisionBodys are colliding, and not just their AABBs, use the collision(NarrowphaseCollisionData) method.

        Return false from this method to stop processing of this collision. Other CollisionListeners will still be notified of this event, however, no further collision or contact events will occur for this pair.

        The collision(NarrowphaseCollisionData) method is next in the sequence of collision events.

        Parameters:
        collision - the broadphase collision data
        Returns:
        boolean true if processing should continue for this collision
        Since:
        3.2.0
      • collision

        boolean collision​(NarrowphaseCollisionData<T,​E> collision)
        Called when two Fixtures are colliding as determined by the NarrowphaseDetector.

        CollisionBody objects can have many Convex Shapes that make up their geometry. Because of this, this method may be called multiple times if two multi-fixtured CollisionBodys are colliding.

        Return false from this method to stop processing of this collision. Other CollisionListeners will still be notified of this event, however, no further collision or contact events will occur for this pair.

        The collision(ManifoldCollisionData) method is next in the sequence of collision events.

        Parameters:
        collision - the narrowphase collision data
        Returns:
        boolean true if processing should continue for this collision
      • collision

        boolean collision​(ManifoldCollisionData<T,​E> collision)
        Called when two Fixtures are colliding and a contact Manifold has been found.

        CollisionBody objects can have many Convex Shapes that make up their geometry. Because of this, this method may be called multiple times if two multi-fixtured CollisionBodys are colliding.

        Modification of the Manifold object is allowed. The Manifold is used to create contact constraints.

        Return false from this method to stop processing of this collision. Other CollisionListeners will still be notified of this event, however, no further collision or contact events will occur for this pair.

        Parameters:
        collision - the manifold collision data
        Returns:
        boolean true if processing should continue for this collision