Module org.dyn4j

Class SegmentDetector


  • public final class SegmentDetector
    extends Object
    Class devoted to improving performance of Segment detection queries.
    Since:
    2.0.0
    Version:
    4.1.0
    Author:
    William Bittle
    • Method Detail

      • raycast

        public static boolean raycast​(Ray ray,
                                      double maxLength,
                                      Segment segment,
                                      Transform transform,
                                      Raycast raycast)
        Performs a ray cast against the given segment.

        NOTE: It's the responsibility of the caller to clear the given Raycast object before calling this method.

        Parameters:
        ray - the Ray
        maxLength - the maximum ray length
        segment - the Segment
        transform - the Segment's Transform
        raycast - the Raycast result
        Returns:
        boolean true if the ray intersects the segment
        Since:
        2.0.0