Module org.dyn4j

Interface RaycastListener

  • All Superinterfaces:
    Listener
    All Known Implementing Classes:
    RaycastAdapter

    @Deprecated
    public interface RaycastListener
    extends Listener
    Deprecated.
    Deprecated in 4.0.0. Use the iterator methods in the World class instead.
    Interface for listening for raycast events.

    Modification of the World is not permitted inside these methods.

    By default all methods should return true.

    Since:
    2.0.0
    Version:
    4.0.0
    Author:
    William Bittle
    • Method Detail

      • allow

        boolean allow​(Ray ray,
                      Body body,
                      BodyFixture fixture)
        Deprecated.
        Called before a BodyFixture is tested against the Ray.

        Use this method to filter the ray casting based on the BodyFixture.

        Parameters:
        ray - the Ray
        body - the Body
        fixture - the BodyFixture to be tested
        Returns:
        boolean true if the BodyFixture should be included in the raycast
        Since:
        3.0.0
      • allow

        boolean allow​(Ray ray,
                      Body body,
                      BodyFixture fixture,
                      Raycast raycast)
        Deprecated.
        Called after a successful raycast of the given Body and BodyFixture.

        Use this method to filter the raycasting based on the Raycast result.

        Parameters:
        ray - the Ray
        body - the Body
        fixture - the BodyFixture to be tested
        raycast - the Raycast result
        Returns:
        boolean true if the Raycast result should be allowed
        Since:
        3.1.5