Module org.dyn4j

Class ConvexCastAdapter

  • All Implemented Interfaces:
    ConvexCastListener, Listener

    public class ConvexCastAdapter
    extends java.lang.Object
    implements ConvexCastListener
    Default implementation of the ConvexCastListener interface.

    Inherit from this class to only implement the desired methods.

    By default all methods return true.

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

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean allow​(Convex convex, Body body, BodyFixture fixture)
      Called before the given fixture is cast against.
      boolean allow​(Convex convex, Body body, BodyFixture fixture, TimeOfImpact toi)
      Called after the given fixture has been cast against and a collision was detected.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • ConvexCastAdapter

        public ConvexCastAdapter()
    • Method Detail

      • allow

        public boolean allow​(Convex convex,
                             Body body,
                             BodyFixture fixture)
        Description copied from interface: ConvexCastListener
        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.

        Specified by:
        allow in interface ConvexCastListener
        Parameters:
        convex - the convex being cast
        body - the body
        fixture - the body fixture
        Returns:
        boolean true if the body should be tested
      • allow

        public boolean allow​(Convex convex,
                             Body body,
                             BodyFixture fixture,
                             TimeOfImpact toi)
        Description copied from interface: ConvexCastListener
        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.

        Specified by:
        allow in interface ConvexCastListener
        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