org.openmali.spatial.bodies
Class Frustum

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

public class Frustum
extends java.lang.Object

A viewing frustum.

Author:
cas, Marvin Froehlich (aka Qudus)

Field Summary
static float error
           
 
Constructor Summary
Frustum()
          Frustum constructor comment.
 
Method Summary
 void compute(Matrix4f proj, Matrix4f modl)
          Extract the frustum from the incoming projections and modelview matrices.
 Matrix4f computeInverse(Matrix4f proj)
          Extract the frustum from the incoming projections and modelview matrices.
 Matrix4f getMatrix()
           
 Plane getPlane(int i)
           
 boolean intersects(Plane p, Vector3f[] quad)
          Intersect the frustum with a plane.
 Classifier.Classification quickClassify(Box box)
          Quick check to see if an orthogonal bounding box is inside the frustum
 void setPlane(int i, Plane plane)
           
 java.lang.String toString()
          
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

error

public static float error
Constructor Detail

Frustum

public Frustum()
Frustum constructor comment.

Method Detail

getMatrix

public Matrix4f getMatrix()

setPlane

public void setPlane(int i,
                     Plane plane)

getPlane

public Plane getPlane(int i)

quickClassify

public final Classifier.Classification quickClassify(Box box)
Quick check to see if an orthogonal bounding box is inside the frustum


intersects

public final boolean intersects(Plane p,
                                Vector3f[] quad)
Intersect the frustum with a plane. The result is returned in a set of points which make a quadrilateral. If the frustum does not intersect the plane then the function

Returns:
false and the points are left untouched. The array of points passed in must have a size equal to 4.

compute

public final void compute(Matrix4f proj,
                          Matrix4f modl)
Extract the frustum from the incoming projections and modelview matrices.


computeInverse

public final Matrix4f computeInverse(Matrix4f proj)
Extract the frustum from the incoming projections and modelview matrices.


toString

public java.lang.String toString()

Overrides:
toString in class java.lang.Object