Package gaia.cu9.ari.gaiaorbit.util.math
Class Intersectord
- java.lang.Object
-
- gaia.cu9.ari.gaiaorbit.util.math.Intersectord
-
public class Intersectord extends java.lang.Object
-
-
Constructor Summary
Constructors Constructor Description Intersectord()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static boolean
checkIntersectRaySpehre(Vector3d linePoint0, Vector3d linePoint1, Vector3d sphereCenter, double sphereRadius)
static boolean
checkIntersectSegmentSphere(Vector3d linePoint0, Vector3d linePoint1, Vector3d sphereCenter, double sphereRadius)
static double
distanceLinePoint(Vector3d x1, Vector3d x2, Vector3d x0)
Returns the shortest distance between the line defined by x1 and x2 and the point x0.static double
distanceSegmentPoint(Vector3d a, Vector3d b, Vector3d v)
Calculates the euclidean distance from a point to a line segment.static boolean
intersectRayBoundsFast(Rayd ray, Vector3d center, Vector3d dimensions)
Quick check whether the givenRay
andBoundingBoxd
intersect.static com.badlogic.gdx.utils.Array<Vector3d>
intersectRaySphere(Vector3d linePoint0, Vector3d linePoint1, Vector3d sphereCenter, double sphereRadius)
static com.badlogic.gdx.utils.Array<Vector3d>
intersectSegmentSphere(Vector3d linePoint0, Vector3d linePoint1, Vector3d sphereCenter, double sphereRadius)
TODO: Not working well due to aux vectors
-
-
-
Method Detail
-
intersectRayBoundsFast
public static boolean intersectRayBoundsFast(Rayd ray, Vector3d center, Vector3d dimensions)
Quick check whether the givenRay
andBoundingBoxd
intersect.- Parameters:
ray
- The raycenter
- The center of the bounding boxdimensions
- The dimensions (width, height and depth) of the bounding box- Returns:
- Whether the ray and the bounding box intersect.
-
checkIntersectRaySpehre
public static boolean checkIntersectRaySpehre(Vector3d linePoint0, Vector3d linePoint1, Vector3d sphereCenter, double sphereRadius)
-
intersectRaySphere
public static com.badlogic.gdx.utils.Array<Vector3d> intersectRaySphere(Vector3d linePoint0, Vector3d linePoint1, Vector3d sphereCenter, double sphereRadius)
-
checkIntersectSegmentSphere
public static boolean checkIntersectSegmentSphere(Vector3d linePoint0, Vector3d linePoint1, Vector3d sphereCenter, double sphereRadius)
-
intersectSegmentSphere
public static com.badlogic.gdx.utils.Array<Vector3d> intersectSegmentSphere(Vector3d linePoint0, Vector3d linePoint1, Vector3d sphereCenter, double sphereRadius)
TODO: Not working well due to aux vectors- Parameters:
linePoint0
-linePoint1
-sphereCenter
-sphereRadius
-- Returns:
-
distanceLinePoint
public static double distanceLinePoint(Vector3d x1, Vector3d x2, Vector3d x0)
Returns the shortest distance between the line defined by x1 and x2 and the point x0. See here.- Parameters:
x1
- Segment first pointx2
- Segment second pointx0
- Point to test- Returns:
- The minimum distance between the line and the point
-
-