org.openmali.spatial.bodies
Class Classifier

java.lang.Object
  extended by org.openmali.spatial.bodies.Classifier

public final class Classifier
extends java.lang.Object

Classifiable things can be classified with respect to each other.


Nested Class Summary
static class Classifier.Classification
           
static class Classifier.PlaneClassification
           
 
Constructor Summary
Classifier()
           
 
Method Summary
static Classifier.Classification classifyBoundsBounds(Bounds bounds1, Bounds bounds2)
          Classifies a two Bounds objects agains each others.
static Classifier.Classification classifyBoxBounds(Box box1, Bounds bounds)
          Classifies a Box against a Bounds object.
static Classifier.Classification classifyBoxBox(Box box1, Box box2)
          Classifies a Box against a Box.
static Classifier.Classification classifyBoxBox(float lowerX1, float lowerY1, float lowerZ1, float upperX1, float upperY1, float upperZ1, float lowerX2, float lowerY2, float lowerZ2, float upperX2, float upperY2, float upperZ2)
          Classifies a Box against a Box.
static Classifier.Classification classifyBoxBox(Tuple3f boxLower1, Tuple3f boxUpper1, Tuple3f boxLower2, Tuple3f boxUpper2)
          Classifies a Box against a Box.
static Classifier.Classification classifyBoxPoint(Box box, float px, float py, float pz)
          Classifies a Point against a Box.
static Classifier.Classification classifyBoxPoint(Box box, Point3f point)
          Classifies a Point against a Box.
static Classifier.Classification classifyBoxPoint(float boxLowerX, float boxLowerY, float boxLowerZ, float boxUpperX, float boxUpperY, float boxUpperZ, float px, float py, float pz)
          Classifies a Point against a Box.
static Classifier.Classification classifyBoxPoint(Tuple3f boxLower, Tuple3f boxUpper, Point3f point)
          Classifies a Point against a Box.
static Classifier.Classification classifyBoxSphere(Box box, Sphere sphere)
          Classifies a Sphere against a Box.
static Classifier.Classification classifyBoxSphere(float boxLowerX, float boxLowerY, float boxLowerZ, float boxUpperX, float boxUpperY, float boxUpperZ, float x, float y, float z, float radius)
          Classifies a Sphere against a Box.
static Classifier.Classification classifyBoxSphere(Tuple3f boxLower, Tuple3f boxUpper, Tuple3f sphereCenter, float radius)
          Classifies a Sphere against a Box.
static Classifier.Classification classifyFrustumBounds(Frustum frustum, Bounds bounds)
          Classifies a Frustum against a Bounds object.
static Classifier.Classification classifyFrustumBox(Frustum frustum, Box box)
          Classifies a Box against a Frustum.
static Classifier.Classification classifyFrustumBox(Frustum frustum, float boxLowerX, float boxLowerY, float boxLowerZ, float boxUpperX, float boxUpperY, float boxUpperZ)
          Classifies a Box against a Frustum.
static Classifier.Classification classifyFrustumBox(Frustum frustum, Tuple3f boxLower, Tuple3f boxUpper)
          Classifies a Box against a Frustum.
static Classifier.Classification classifyFrustumPoint(Frustum frustum, float x, float y, float z)
          Classifies a Point against a Frustum.
static Classifier.Classification classifyFrustumPoint(Frustum frustum, Point3f point)
          Classifies a Point against a Frustum.
static Classifier.Classification classifyFrustumSphere(Frustum frustum, float x, float y, float z, float radius)
          Classifies a Sphere against a Frustum.
static Classifier.Classification classifyFrustumSphere(Frustum frustum, Sphere sphere)
          Classifies a Sphere against a Frustum.
static Classifier.Classification classifyFrustumSphere(Frustum frustum, Tuple3f sphereCenter, float radius)
          Classifies a Sphere against a Frustum.
static Classifier.PlaneClassification classifyPlaneBox(Plane plane, Box box)
           
static Classifier.PlaneClassification classifyPlaneBox(Plane plane, float boxLowerX, float boxLowerY, float boxLowerZ, float boxUpperX, float boxUpperY, float boxUpperZ)
           
static Classifier.PlaneClassification classifyPlaneBox(Plane plane, Tuple3f boxLower, Tuple3f boxUpper)
           
static Classifier.PlaneClassification classifyPlanePoint(float planeNx, float planeNy, float planeNz, float planeD, float x, float y, float z)
          Classifies a point with respect to the plane.
static Classifier.PlaneClassification classifyPlanePoint(Plane plane, float px, float py, float pz)
          Classifies a point with respect to the plane.
static Classifier.PlaneClassification classifyPlanePoint(Plane plane, Tuple3f point)
          Classifies a point with respect to the plane.
static Classifier.PlaneClassification classifyPlanePoints(Plane plane, Tuple3f[] points)
          Classifies a collection of points with respect to the plane.
static Classifier.Classification classifySphereBounds(Sphere sphere1, Bounds bounds)
          Classifies a Sphere against a Bounds object.
static Classifier.Classification classifySphereBox(Sphere sphere, Box box)
          Classifies a Box against a Sphere.
static Classifier.Classification classifySphereBox(Sphere sphere, float boxLowerX, float boxLowerY, float boxLowerZ, float boxUpperX, float boxUpperY, float boxUpperZ)
          Classifies a Box against a Sphere.
static Classifier.Classification classifySphereBox(Sphere sphere, Tuple3f boxLower, Tuple3f boxUpper)
          Classifies a Box against a Sphere.
static Classifier.PlaneClassification classifySpherePlane(Sphere sphere, Plane plane)
          Classify this sphere with respect to a plane
static Classifier.Classification classifySpherePoint(float cx, float cy, float cz, float r, float px, float py, float pz)
          Classifies a Point against a Sphere.
static Classifier.Classification classifySpherePoint(Sphere sphere, float px, float py, float pz)
          Classifies a Point against a Sphere.
static Classifier.Classification classifySpherePoint(Sphere sphere, Point3f point)
          Classifies a Point against a Sphere.
static Classifier.Classification classifySpherePoint(Tuple3f sphereC, float sphereR, float px, float py, float pz)
          Classifies a Point against a Sphere.
static Classifier.Classification classifySpherePoint(Tuple3f sphereC, float sphereR, Point3f point)
          Classifies a Point against a Sphere.
static Classifier.Classification classifySphereSphere(float cx1, float cy1, float cz1, float r1, float cx2, float cy2, float cz2, float r2)
          Classifies a Sphere against a Sphere.
static Classifier.Classification classifySphereSphere(Sphere sphere1, Sphere sphere2)
          Classifies a Sphere against a Sphere.
static Classifier.Classification classifySphereSphere(Tuple3f center1, float radius1, Tuple3f center2, float radius2)
          Classifies a Sphere against a Sphere.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Classifier

public Classifier()
Method Detail

classifySpherePoint

public static Classifier.Classification classifySpherePoint(float cx,
                                                            float cy,
                                                            float cz,
                                                            float r,
                                                            float px,
                                                            float py,
                                                            float pz)
Classifies a Point against a Sphere.

Parameters:
cx -
cy -
cz -
r -
px -
py -
pz -

classifySpherePoint

public static Classifier.Classification classifySpherePoint(Tuple3f sphereC,
                                                            float sphereR,
                                                            float px,
                                                            float py,
                                                            float pz)
Classifies a Point against a Sphere.

Parameters:
sphereC -
sphereR -
px -
py -
pz -

classifySpherePoint

public static Classifier.Classification classifySpherePoint(Tuple3f sphereC,
                                                            float sphereR,
                                                            Point3f point)
Classifies a Point against a Sphere.

Parameters:
sphereC -
sphereR -
point -

classifySpherePoint

public static Classifier.Classification classifySpherePoint(Sphere sphere,
                                                            Point3f point)
Classifies a Point against a Sphere.

Parameters:
sphere -
point -
Returns:
the classification

classifySpherePoint

public static Classifier.Classification classifySpherePoint(Sphere sphere,
                                                            float px,
                                                            float py,
                                                            float pz)
Classifies a Point against a Sphere.

Parameters:
sphere -
px -
py -
pz -
Returns:
the classification

classifySphereSphere

public static Classifier.Classification classifySphereSphere(float cx1,
                                                             float cy1,
                                                             float cz1,
                                                             float r1,
                                                             float cx2,
                                                             float cy2,
                                                             float cz2,
                                                             float r2)
Classifies a Sphere against a Sphere.

Parameters:
cx1 -
cy1 -
cz1 -
r1 -
cx2 -
cy2 -
cz2 -
r2 -

classifySphereSphere

public static Classifier.Classification classifySphereSphere(Tuple3f center1,
                                                             float radius1,
                                                             Tuple3f center2,
                                                             float radius2)
Classifies a Sphere against a Sphere.

Parameters:
center1 -
radius1 -
center2 -
radius2 -

classifySphereSphere

public static Classifier.Classification classifySphereSphere(Sphere sphere1,
                                                             Sphere sphere2)
Classifies a Sphere against a Sphere.

Parameters:
sphere1 -
sphere2 -

classifySphereBox

public static Classifier.Classification classifySphereBox(Sphere sphere,
                                                          float boxLowerX,
                                                          float boxLowerY,
                                                          float boxLowerZ,
                                                          float boxUpperX,
                                                          float boxUpperY,
                                                          float boxUpperZ)
Classifies a Box against a Sphere.

Parameters:
sphere -
boxLowerX -
boxLowerY -
boxLowerZ -
boxUpperX -
boxUpperY -
boxUpperZ -

classifySphereBox

public static Classifier.Classification classifySphereBox(Sphere sphere,
                                                          Tuple3f boxLower,
                                                          Tuple3f boxUpper)
Classifies a Box against a Sphere.

Parameters:
sphere -
boxLower -
boxUpper -

classifySphereBox

public static Classifier.Classification classifySphereBox(Sphere sphere,
                                                          Box box)
Classifies a Box against a Sphere.

Parameters:
sphere -
box -

classifySpherePlane

public static Classifier.PlaneClassification classifySpherePlane(Sphere sphere,
                                                                 Plane plane)
Classify this sphere with respect to a plane


classifyBoxPoint

public static Classifier.Classification classifyBoxPoint(float boxLowerX,
                                                         float boxLowerY,
                                                         float boxLowerZ,
                                                         float boxUpperX,
                                                         float boxUpperY,
                                                         float boxUpperZ,
                                                         float px,
                                                         float py,
                                                         float pz)
Classifies a Point against a Box.

Parameters:
boxLowerX -
boxLowerY -
boxLowerZ -
boxUpperX -
boxUpperY -
boxUpperZ -
px -
py -
pz -

classifyBoxPoint

public static Classifier.Classification classifyBoxPoint(Tuple3f boxLower,
                                                         Tuple3f boxUpper,
                                                         Point3f point)
Classifies a Point against a Box.

Parameters:
boxLower -
boxUpper -
point -

classifyBoxPoint

public static Classifier.Classification classifyBoxPoint(Box box,
                                                         Point3f point)
Classifies a Point against a Box.

Parameters:
box -
point -

classifyBoxPoint

public static Classifier.Classification classifyBoxPoint(Box box,
                                                         float px,
                                                         float py,
                                                         float pz)
Classifies a Point against a Box.

Parameters:
box -
px -
py -
pz -

classifyBoxSphere

public static Classifier.Classification classifyBoxSphere(float boxLowerX,
                                                          float boxLowerY,
                                                          float boxLowerZ,
                                                          float boxUpperX,
                                                          float boxUpperY,
                                                          float boxUpperZ,
                                                          float x,
                                                          float y,
                                                          float z,
                                                          float radius)
Classifies a Sphere against a Box.

Parameters:
boxLowerX -
boxLowerY -
boxLowerZ -
boxUpperX -
boxUpperY -
boxUpperZ -
x -
y -
z -
radius -

classifyBoxSphere

public static Classifier.Classification classifyBoxSphere(Tuple3f boxLower,
                                                          Tuple3f boxUpper,
                                                          Tuple3f sphereCenter,
                                                          float radius)
Classifies a Sphere against a Box.

Parameters:
boxLower -
boxUpper -
sphereCenter -
radius -

classifyBoxSphere

public static Classifier.Classification classifyBoxSphere(Box box,
                                                          Sphere sphere)
Classifies a Sphere against a Box.

Parameters:
box -
sphere -

classifyBoxBox

public static Classifier.Classification classifyBoxBox(float lowerX1,
                                                       float lowerY1,
                                                       float lowerZ1,
                                                       float upperX1,
                                                       float upperY1,
                                                       float upperZ1,
                                                       float lowerX2,
                                                       float lowerY2,
                                                       float lowerZ2,
                                                       float upperX2,
                                                       float upperY2,
                                                       float upperZ2)
Classifies a Box against a Box.

Parameters:
lowerX1 -
lowerY1 -
lowerZ1 -
upperX1 -
upperY1 -
upperZ1 -
lowerX2 -
lowerY2 -
lowerZ2 -
upperX2 -
upperY2 -
upperZ2 -

classifyBoxBox

public static Classifier.Classification classifyBoxBox(Tuple3f boxLower1,
                                                       Tuple3f boxUpper1,
                                                       Tuple3f boxLower2,
                                                       Tuple3f boxUpper2)
Classifies a Box against a Box.

Parameters:
boxLower1 -
boxUpper1 -
boxLower2 -
boxUpper2 -

classifyBoxBox

public static Classifier.Classification classifyBoxBox(Box box1,
                                                       Box box2)
Classifies a Box against a Box.

Parameters:
box1 -
box2 -

classifySphereBounds

public static Classifier.Classification classifySphereBounds(Sphere sphere1,
                                                             Bounds bounds)
Classifies a Sphere against a Bounds object.

Parameters:
sphere1 -
bounds -

classifyBoxBounds

public static Classifier.Classification classifyBoxBounds(Box box1,
                                                          Bounds bounds)
Classifies a Box against a Bounds object.

Parameters:
box1 -
bounds -

classifyBoundsBounds

public static Classifier.Classification classifyBoundsBounds(Bounds bounds1,
                                                             Bounds bounds2)
Classifies a two Bounds objects agains each others.

Parameters:
bounds1 -
bounds2 -

classifyPlanePoint

public static Classifier.PlaneClassification classifyPlanePoint(float planeNx,
                                                                float planeNy,
                                                                float planeNz,
                                                                float planeD,
                                                                float x,
                                                                float y,
                                                                float z)
Classifies a point with respect to the plane. Classifying a point with respect to a plane is done by passing the (x, y, z) values of the point into the plane equation, Ax + By + Cz + D = 0. The result of this operation is the distance from the plane to the point along the plane's normal Vec3f. It will be positive if the point is on the side of the plane pointed to by the normal Vec3f, negative otherwise. If the result is 0, the point is on the plane.


classifyPlanePoint

public static Classifier.PlaneClassification classifyPlanePoint(Plane plane,
                                                                float px,
                                                                float py,
                                                                float pz)
Classifies a point with respect to the plane. Classifying a point with respect to a plane is done by passing the (x, y, z) values of the point into the plane equation, Ax + By + Cz + D = 0. The result of this operation is the distance from the plane to the point along the plane's normal Vec3f. It will be positive if the point is on the side of the plane pointed to by the normal Vec3f, negative otherwise. If the result is 0, the point is on the plane.


classifyPlanePoint

public static Classifier.PlaneClassification classifyPlanePoint(Plane plane,
                                                                Tuple3f point)
Classifies a point with respect to the plane. Classifying a point with respect to a plane is done by passing the (x, y, z) values of the point into the plane equation, Ax + By + Cz + D = 0. The result of this operation is the distance from the plane to the point along the plane's normal Vec3f. It will be positive if the point is on the side of the plane pointed to by the normal Vec3f, negative otherwise. If the result is 0, the point is on the plane.


classifyPlanePoints

public static Classifier.PlaneClassification classifyPlanePoints(Plane plane,
                                                                 Tuple3f[] points)
Classifies a collection of points with respect to the plane. We classify each point and OR the results together.


classifyPlaneBox

public static Classifier.PlaneClassification classifyPlaneBox(Plane plane,
                                                              float boxLowerX,
                                                              float boxLowerY,
                                                              float boxLowerZ,
                                                              float boxUpperX,
                                                              float boxUpperY,
                                                              float boxUpperZ)

classifyPlaneBox

public static Classifier.PlaneClassification classifyPlaneBox(Plane plane,
                                                              Tuple3f boxLower,
                                                              Tuple3f boxUpper)

classifyPlaneBox

public static Classifier.PlaneClassification classifyPlaneBox(Plane plane,
                                                              Box box)

classifyFrustumPoint

public static final Classifier.Classification classifyFrustumPoint(Frustum frustum,
                                                                   float x,
                                                                   float y,
                                                                   float z)
Classifies a Point against a Frustum.

Parameters:
frustum -
x -
y -
z -

classifyFrustumPoint

public static final Classifier.Classification classifyFrustumPoint(Frustum frustum,
                                                                   Point3f point)
Classifies a Point against a Frustum.

Parameters:
frustum -
point -

classifyFrustumSphere

public static final Classifier.Classification classifyFrustumSphere(Frustum frustum,
                                                                    float x,
                                                                    float y,
                                                                    float z,
                                                                    float radius)
Classifies a Sphere against a Frustum.

Parameters:
frustum -
x -
y -
z -
radius -

classifyFrustumSphere

public static final Classifier.Classification classifyFrustumSphere(Frustum frustum,
                                                                    Tuple3f sphereCenter,
                                                                    float radius)
Classifies a Sphere against a Frustum.

Parameters:
frustum -
sphereCenter -
radius -

classifyFrustumSphere

public static final Classifier.Classification classifyFrustumSphere(Frustum frustum,
                                                                    Sphere sphere)
Classifies a Sphere against a Frustum.

Parameters:
frustum -
sphere -

classifyFrustumBox

public static Classifier.Classification classifyFrustumBox(Frustum frustum,
                                                           float boxLowerX,
                                                           float boxLowerY,
                                                           float boxLowerZ,
                                                           float boxUpperX,
                                                           float boxUpperY,
                                                           float boxUpperZ)
Classifies a Box against a Frustum.

Parameters:
frustum -
boxLowerX -
boxLowerY -
boxLowerZ -
boxUpperX -
boxUpperY -
boxUpperZ -

classifyFrustumBox

public static Classifier.Classification classifyFrustumBox(Frustum frustum,
                                                           Tuple3f boxLower,
                                                           Tuple3f boxUpper)
Classifies a Box against a Frustum.

Parameters:
frustum -
boxLower -
boxUpper -

classifyFrustumBox

public static final Classifier.Classification classifyFrustumBox(Frustum frustum,
                                                                 Box box)
Classifies a Box against a Frustum.

Parameters:
frustum -
box -

classifyFrustumBounds

public static Classifier.Classification classifyFrustumBounds(Frustum frustum,
                                                              Bounds bounds)
Classifies a Frustum against a Bounds object.

Parameters:
frustum -
bounds -