Module org.dyn4j

Interface ConvexCastListener

  • All Superinterfaces:
    Listener
    All Known Implementing Classes:
    ConvexCastAdapter

    public interface ConvexCastListener
    extends Listener
    Interface to listen for convex cast events.

    Modification of the World is not permitted during these methods.

    By default all methods should return true.

    Since:
    3.1.5
    Version:
    3.2.0
    Author:
    William Bittle
    • Method Detail

      • allow

        boolean allow​(Convex convex,
                      Body body,
                      BodyFixture fixture)
        Called before the given fixture is cast against.

        Returning true from this method indicates that the cast should be performed.

        Use this method to filter fixtures from the tests to improve performance.

        Parameters:
        convex - the convex being cast
        body - the body
        fixture - the body fixture
        Returns:
        boolean true if the body should be tested
      • allow

        boolean allow​(Convex convex,
                      Body body,
                      BodyFixture fixture,
                      TimeOfImpact toi)
        Called after the given fixture has been cast against and a collision was detected.

        Returning true from this method indicates that this time of impact result should be used by the final result.

        Parameters:
        convex - the convex being cast
        body - the body
        fixture - the body fixture
        toi - the time of impact
        Returns:
        boolean true if the body should be tested