Package gov.nasa.worldwind.util
Class RayCastingSupport
- java.lang.Object
-
- gov.nasa.worldwind.util.RayCastingSupport
-
public class RayCastingSupport extends java.lang.ObjectContains methods to resolve ray intersections with the terrain.
-
-
Constructor Summary
Constructors Constructor Description RayCastingSupport()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static PositionintersectRayWithTerrain(Globe globe, Vec4 origin, Vec4 direction)Compute the intersectionPositionof the globe terrain with the ray starting at origin in the given direction.static PositionintersectRayWithTerrain(Globe globe, Vec4 origin, Vec4 direction, double sampleLength, double precision)Compute the intersectionPositionof the globe terrain with the ray starting at origin in the given direction.static Vec4intersectSegmentWithTerrain(Globe globe, Vec4 p1, Vec4 p2)Compute the intersectionVec4point of the globe terrain with a line segment defined between two points.static Vec4intersectSegmentWithTerrain(Globe globe, Vec4 p1, Vec4 p2, double sampleLength, double precision)Compute the intersectionVec4point of the globe terrain with the a segment defined between two points.
-
-
-
Method Detail
-
intersectRayWithTerrain
public static Position intersectRayWithTerrain(Globe globe, Vec4 origin, Vec4 direction)
Compute the intersectionPositionof 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
Positionfound ornull.
-
intersectRayWithTerrain
public static Position intersectRayWithTerrain(Globe globe, Vec4 origin, Vec4 direction, double sampleLength, double precision)
Compute the intersectionPositionof 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
Positionfound ornull.
-
intersectSegmentWithTerrain
public static Vec4 intersectSegmentWithTerrain(Globe globe, Vec4 p1, Vec4 p2)
Compute the intersectionVec4point 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
Vec4point found ornull.
-
intersectSegmentWithTerrain
public static Vec4 intersectSegmentWithTerrain(Globe globe, Vec4 p1, Vec4 p2, double sampleLength, double precision)
Compute the intersectionVec4point 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
Vec4point found ornull.
-
-