com.jme.intersection
Class Distance

java.lang.Object
  extended by com.jme.intersection.Distance

public class Distance
extends java.lang.Object

Distance provides functional methods for determining the distances between one object and another. These methods are static to allow for easy calling.

Version:
$Id: Distance.java 4131 2009-03-19 20:15:28Z blaine.dev $
Author:
Mark Powell

Method Summary
static float distance(Vector3f point, Ray ray)
          distance calculates the distance between a point and a ray.
static float distance(Vector3f point1, Vector3f point2)
          distance calculates the distance between two points.
static float distanceSquared(Vector3f p1, Vector3f p2)
          distanceSquared returns the distance between two points, with the distance squared.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

distance

public static float distance(Vector3f point1,
                             Vector3f point2)
distance calculates the distance between two points.

Parameters:
point1 - the first point to test.
point2 - the second point to test.
Returns:
the distance between the two points.

distanceSquared

public static float distanceSquared(Vector3f p1,
                                    Vector3f p2)
distanceSquared returns the distance between two points, with the distance squared. This allows for faster comparisons if relation is important but actual distance is not.

Parameters:
p1 - the first point to test.
p2 - the second point to test.
Returns:
the distance squared between two points.

distance

public static float distance(Vector3f point,
                             Ray ray)
distance calculates the distance between a point and a ray.

Parameters:
point - the point to test.
ray - the ray to test.
Returns:
the distance between the point and the ray.