|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjme.math.Distance
Distance
is a static class that provides commonly used math
functions.
NOTE: See 3D Game Engine Design. David H. Eberly.
Constructor Summary | |
Distance()
|
Method Summary | |
static float |
distanceLineLineSquared(Line line1,
Line line2)
distanceLineLineSquared calculates the distance squared
between two lines. |
static float |
distanceLineRaySquared(Line line,
Line ray)
distanceLineRaySquared calculates the squared distance
between a line and a ray. |
static float |
distanceLineSegmentSquared(Line line,
Line seg)
distanceLineSegementSquared calculates the distance
squared between a line and a line segment. |
static float |
distancePointLineSquared(Vector point,
Line line)
distancePointLineSquared calculates the distance squared
between a point and a line. |
static float |
distancePointPoint(Vector point1,
Vector point2)
distancePointPoint calculates the distance between two points. |
static float |
distancePointPointSquared(Vector point1,
Vector point2)
distancePointPointSquared calculates the distance squared
between two points. |
static float |
distancePointRaySquared(Vector point,
Line ray)
distancePointRaySquared calculates the distance
squared between a point and a ray. |
static float |
distancePointRectangle(Vector point,
Rectangle rect)
distancePointRectangle calculates the distance squared
between a point and a rectangle. |
static float |
distancePointSegmentSquared(Vector point,
Line seg)
distancePointSegmentSquared calculates the distance
squared between a point and a line segment. |
static float |
distanceRayRaySquared(Line ray1,
Line ray2)
distanceRayRaySquared calculates the distance squared
between two rays. |
static float |
distanceRaySegmentSquared(Line ray,
Line seg)
distanceRaySegmentSquared calculates the distance
squared between a ray and a line segment. |
static float |
distanceSegmentSegmentSquared(Line seg1,
Line seg2)
distanceSegmentSegmentSquared calculates the distance
squared between two line segments. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public Distance()
Method Detail |
public static float distancePointPoint(Vector point1, Vector point2)
distancePointPoint
calculates the distance between two points. These
points are described as a Vector
object.
point1
- the first point.point2
- the second point.
public static float distancePointPointSquared(Vector point1, Vector point2)
distancePointPointSquared
calculates the distance squared
between two points. These points are described as a
Vector
object.
point1
- the first point.point2
- the second point.
public static float distancePointLineSquared(Vector point, Line line)
distancePointLineSquared
calculates the distance squared
between a point and a line.
point
- the point to check.line
- the line to check.
public static float distancePointRaySquared(Vector point, Line ray)
distancePointRaySquared
calculates the distance
squared between a point and a ray.
point
- the point to check.ray
- the ray to check.
public static float distancePointSegmentSquared(Vector point, Line seg)
distancePointSegmentSquared
calculates the distance
squared between a point and a line segment.
point
- the point to check.seg
- the line segment to check.
public static float distancePointRectangle(Vector point, Rectangle rect)
distancePointRectangle
calculates the distance squared
between a point and a rectangle.
point
- the point to check.rect
- the rectangle to check.
public static float distanceLineLineSquared(Line line1, Line line2)
distanceLineLineSquared
calculates the distance squared
between two lines.
line1
- the first line to check.line2
- the second line to check.
public static float distanceLineRaySquared(Line line, Line ray)
distanceLineRaySquared
calculates the squared distance
between a line and a ray.
line
- the line to check.ray
- the ray to check.
public static float distanceLineSegmentSquared(Line line, Line seg)
distanceLineSegementSquared
calculates the distance
squared between a line and a line segment.
line
- the line to check.seg
- the line segment to check.
public static float distanceRayRaySquared(Line ray1, Line ray2)
distanceRayRaySquared
calculates the distance squared
between two rays.
ray1
- the first ray to check.ray2
- the second ray to check.
public static float distanceRaySegmentSquared(Line ray, Line seg)
distanceRaySegmentSquared
calculates the distance
squared between a ray and a line segment.
ray
- the ray to check.seg
- the line segment to check.
public static float distanceSegmentSegmentSquared(Line seg1, Line seg2)
distanceSegmentSegmentSquared
calculates the distance
squared between two line segments.
seg1
- the first line segment to check.seg2
- the second line segment to check.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |