Module org.dyn4j

Interface RaycastDetector

  • All Known Implementing Classes:
    Gjk

    public interface RaycastDetector
    Represents an algorithm for determining whether a Ray and a Convex Shape intersect, given the ray's maximum length and the Convex Shape's Transform.
    Since:
    2.0.0
    Version:
    3.1.5
    Author:
    William Bittle
    • Method Detail

      • raycast

        boolean raycast​(Ray ray,
                        double maxLength,
                        Convex convex,
                        Transform transform,
                        Raycast raycast)
        Performs a ray cast given a Ray and a Convex Shape returning true if the ray passes through the convex shape.

        The raycast parameter is used to stored the results of the raycast when returning true.

        Returns false if the start position of the ray lies inside the given convex.

        Parameters:
        ray - the Ray
        maxLength - the maximum length of the ray; 0 for infinite length
        convex - the Convex Shape
        transform - the Convex Shape's Transform
        raycast - the ray cast result
        Returns:
        boolean true if the Ray passes through the Convex Shape