|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.jogamp.opengl.math.geom.Frustum
public class Frustum
Providing frustum planes derived by different inputs
(P*MV, ..)
used to classify objects and to test
whether they are outside.
Extracting the world-frustum planes from the P*Mv:
Fast Extraction of Viewing Frustum Planes from the World-View-Projection Matrix Gil GribbClassifying Point, Sphere and AABBox:Klaus Hartmann http://graphics.cs.ucf.edu/cap4720/fall2008/plane_extraction.pdf
Efficient View Frustum Culling Daniel SýkoraJosef Jelínek http://www.cg.tuwien.ac.at/hostings/cescg/CESCG-2002/DSykoraJJelinek/index.html
Lighthouse3d.com http://www.lighthouse3d.com/tutorials/view-frustum-culling/Fundamentals about Planes, Half-Spaces and Frustum-Culling:
Planes and Half-Spaces, Max Wagnerhttp://www.emeyex.com/site/tuts/PlanesHalfSpaces.pdf
Frustum Culling, Max Wagnerhttp://www.emeyex.com/site/tuts/FrustumCulling.pdf
| Nested Class Summary | |
|---|---|
static class |
Frustum.Location
|
static class |
Frustum.Plane
Plane equation := dot(n, x - p) = 0 -> ax + bc + cx + d == 0 |
| Field Summary | |
|---|---|
static int |
BOTTOM
Index for bottom plane: 2 |
static int |
FAR
Index for far plane: 5 |
static int |
LEFT
Index for left plane: 0 |
static int |
NEAR
Index for near plane: 4 |
static int |
RIGHT
Index for right plane: 1 |
static int |
TOP
Index for top plane: 3 |
| Constructor Summary | |
|---|---|
Frustum()
Creates an undefined instance w/o calculating the frustum. |
|
| Method Summary | |
|---|---|
Frustum.Location |
classifyPoint(float[] p)
Check to see if a point is outside, inside or on a plane of the frustum. |
Frustum.Location |
classifySphere(float[] p,
float radius)
Check to see if a sphere is outside, intersecting or inside of the frustum. |
Frustum.Plane[] |
getPlanes()
Frustum.Planes are ordered in the returned array as follows:
LEFT
RIGHT
BOTTOM
TOP
NEAR
FAR
|
boolean |
isAABBoxOutside(AABBox box)
Check to see if an axis aligned bounding box is completely outside of the frustum. |
boolean |
isPointOutside(float[] p)
Check to see if a point is outside of the frustum. |
boolean |
isSphereOutside(float[] p,
float radius)
Check to see if a sphere is outside of the frustum. |
String |
toString()
|
StringBuilder |
toString(StringBuilder sb)
|
void |
updateByPlanes(Frustum.Plane[] src)
Copy the given src planes into this this instance's planes. |
void |
updateByPMV(float[] pmv,
int pmv_off)
Calculate the frustum planes in world coordinates using the passed float[16] as premultiplied P*MV (column major order). |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final int LEFT
public static final int RIGHT
public static final int BOTTOM
public static final int TOP
public static final int NEAR
public static final int FAR
| Constructor Detail |
|---|
public Frustum()
Use one of the update(..) methods to set the planes.
updateByPlanes(Plane[]),
updateByPMV(float[], int)| Method Detail |
|---|
public final Frustum.Plane[] getPlanes()
Frustum.Planes are ordered in the returned array as follows:
Frustum.Plane's normals are pointing to the inside of the frustum
in order to work w/ isOutside(..) methods.
Frustum.Planes, order see above.public final void updateByPlanes(Frustum.Plane[] src)
src planes into this this instance's planes.
src - the 6 source planes
public void updateByPMV(float[] pmv,
int pmv_off)
Frustum plane's normals will point to the inside of the viewing frustum, as required by this class.
public final boolean isAABBoxOutside(AABBox box)
Note: If method returns false, the box may only be partially inside.
public final Frustum.Location classifyPoint(float[] p)
p - the point
Frustum.Location of point related to frustum planespublic final boolean isPointOutside(float[] p)
p - the point
public final Frustum.Location classifySphere(float[] p,
float radius)
p - center of the sphereradius - radius of the sphere
Frustum.Location of point related to frustum planes
public final boolean isSphereOutside(float[] p,
float radius)
p - center of the sphereradius - radius of the sphere
public StringBuilder toString(StringBuilder sb)
public String toString()
toString in class Object
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||