Class RayCastingSupport


  • public class RayCastingSupport
    extends java.lang.Object
    Contains methods to resolve ray intersections with the terrain.
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static Position intersectRayWithTerrain​(Globe globe, Vec4 origin, Vec4 direction)
      Compute the intersection Position of the globe terrain with the ray starting at origin in the given direction.
      static Position intersectRayWithTerrain​(Globe globe, Vec4 origin, Vec4 direction, double sampleLength, double precision)
      Compute the intersection Position of the globe terrain with the ray starting at origin in the given direction.
      static Vec4 intersectSegmentWithTerrain​(Globe globe, Vec4 p1, Vec4 p2)
      Compute the intersection Vec4 point of the globe terrain with a line segment defined between two points.
      static Vec4 intersectSegmentWithTerrain​(Globe globe, Vec4 p1, Vec4 p2, double sampleLength, double precision)
      Compute the intersection Vec4 point of the globe terrain with the a segment defined between two points.
      • Methods inherited from class java.lang.Object

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

      • RayCastingSupport

        public RayCastingSupport()
    • Method Detail

      • intersectRayWithTerrain

        public static Position intersectRayWithTerrain​(Globe globe,
                                                       Vec4 origin,
                                                       Vec4 direction)
        Compute the intersection Position of the globe terrain with the ray starting at origin in the given direction. Uses default sample length and result precision.
        Parameters:
        globe - the globe to intersect with.
        origin - origin of the ray.
        direction - direction of the ray.
        Returns:
        the Position found or null.
      • intersectRayWithTerrain

        public static Position intersectRayWithTerrain​(Globe globe,
                                                       Vec4 origin,
                                                       Vec4 direction,
                                                       double sampleLength,
                                                       double precision)
        Compute the intersection Position of the globe terrain with the ray starting at origin in the given direction. Uses the given sample length and result precision.
        Parameters:
        globe - the globe to intersect with.
        origin - origin of the ray.
        direction - direction of the ray.
        sampleLength - the sampling step length in meters.
        precision - the maximum sampling error in meters.
        Returns:
        the Position found or null.
      • intersectSegmentWithTerrain

        public static Vec4 intersectSegmentWithTerrain​(Globe globe,
                                                       Vec4 p1,
                                                       Vec4 p2)
        Compute the intersection Vec4 point of the globe terrain with a line segment defined between two points. Uses the default sample length and result precision.
        Parameters:
        globe - the globe to intersect with.
        p1 - segment start point.
        p2 - segment end point.
        Returns:
        the Vec4 point found or null.
      • intersectSegmentWithTerrain

        public static Vec4 intersectSegmentWithTerrain​(Globe globe,
                                                       Vec4 p1,
                                                       Vec4 p2,
                                                       double sampleLength,
                                                       double precision)
        Compute the intersection Vec4 point of the globe terrain with the a segment defined between two points. Uses the given sample length and result precision.
        Parameters:
        globe - the globe to intersect with.
        p1 - segment start point.
        p2 - segment end point.
        sampleLength - the sampling step length in meters.
        precision - the maximum sampling error in meters.
        Returns:
        the Vec4 point found or null.