org.jdesktop.wonderland.common
Class Math3DUtils

java.lang.Object
  extended by org.jdesktop.wonderland.common.Math3DUtils

public class Math3DUtils
extends java.lang.Object

Utilities for dealing with 3D Math

Author:
paulby

Constructor Summary
Math3DUtils()
           
 
Method Summary
static boolean encloses(com.jme.bounding.BoundingBox parent, com.jme.bounding.BoundingBox child)
          Returns true if the parent bounds fully encloses the child
static boolean encloses(com.jme.bounding.BoundingBox parent, com.jme.bounding.BoundingSphere child)
          Returns true if the parent bounds fully encloses the child
static boolean encloses(com.jme.bounding.BoundingSphere parent, com.jme.bounding.BoundingBox child)
          Returns true if the parent bounds fully encloses the child
static boolean encloses(com.jme.bounding.BoundingSphere parent, com.jme.bounding.BoundingSphere child)
          Returns true if the parent bounds fully encloses the child
static boolean encloses(com.jme.bounding.BoundingVolume parent, com.jme.bounding.BoundingVolume child)
           
static boolean epsilonEquals(float f1, float f2)
           
static boolean epsilonEquals(float f1, float f2, float epsilon)
           
static boolean epsilonEquals(com.jme.math.Quaternion q1, com.jme.math.Quaternion q2)
           
static boolean epsilonEquals(com.jme.math.Quaternion q1, com.jme.math.Quaternion q2, float epsilon)
           
static boolean epsilonEquals(com.jme.math.Vector3f t1, com.jme.math.Vector3f t2)
           
static boolean epsilonEquals(com.jme.math.Vector3f t1, com.jme.math.Vector3f t2, float epsilon)
           
static float pointLineDistance(com.jme.math.Vector3f lineStart, com.jme.math.Vector3f lineEnd, com.jme.math.Vector3f point)
          Calculates the distance of a point from a line.
static void toEuler(com.jme.math.Matrix3f matrix, com.jme.math.Vector3f euler)
          Converts the Matrix into Euler angles (roll, pitch, yaw )
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Math3DUtils

public Math3DUtils()
Method Detail

pointLineDistance

public static float pointLineDistance(com.jme.math.Vector3f lineStart,
                                      com.jme.math.Vector3f lineEnd,
                                      com.jme.math.Vector3f point)
Calculates the distance of a point from a line.

x1----------------------------x2
|
| distance
|
point

The formula is
d = |(x2-x1) x (x1-p)|
------------------
|x2-x1|
Where p=point, lineStart=x1, lineEnd=x2


toEuler

public static void toEuler(com.jme.math.Matrix3f matrix,
                           com.jme.math.Vector3f euler)
Converts the Matrix into Euler angles (roll, pitch, yaw )


epsilonEquals

public static boolean epsilonEquals(float f1,
                                    float f2)

epsilonEquals

public static boolean epsilonEquals(float f1,
                                    float f2,
                                    float epsilon)

epsilonEquals

public static boolean epsilonEquals(com.jme.math.Vector3f t1,
                                    com.jme.math.Vector3f t2)

epsilonEquals

public static boolean epsilonEquals(com.jme.math.Vector3f t1,
                                    com.jme.math.Vector3f t2,
                                    float epsilon)

epsilonEquals

public static boolean epsilonEquals(com.jme.math.Quaternion q1,
                                    com.jme.math.Quaternion q2)

epsilonEquals

public static boolean epsilonEquals(com.jme.math.Quaternion q1,
                                    com.jme.math.Quaternion q2,
                                    float epsilon)

encloses

public static boolean encloses(com.jme.bounding.BoundingVolume parent,
                               com.jme.bounding.BoundingVolume child)

encloses

public static boolean encloses(com.jme.bounding.BoundingBox parent,
                               com.jme.bounding.BoundingSphere child)
Returns true if the parent bounds fully encloses the child


encloses

public static boolean encloses(com.jme.bounding.BoundingBox parent,
                               com.jme.bounding.BoundingBox child)
Returns true if the parent bounds fully encloses the child


encloses

public static boolean encloses(com.jme.bounding.BoundingSphere parent,
                               com.jme.bounding.BoundingBox child)
Returns true if the parent bounds fully encloses the child


encloses

public static boolean encloses(com.jme.bounding.BoundingSphere parent,
                               com.jme.bounding.BoundingSphere child)
Returns true if the parent bounds fully encloses the child



Open Wonderland - http://openwonderland.org