|
JOGL v2.6.0-rc-20250706
JOGL, High-Performance Graphics Binding for Java (public API).
|
Providing frustum planes derived by different inputs (P*MV, ..) used to classify objects.
More...
Classes | |
| class | FovDesc |
Frustum description by fovhv and zNear, zFar. More... | |
| enum | Location |
| class | Plane |
| Plane equation := dot(n, x - p) = 0 -> Ax + By + Cz + d == 0. More... | |
Public Member Functions | |
| Frustum () | |
| Creates an undefined instance w/o calculating the frustum. More... | |
| Frustum (final Frustum o) | |
| Frustum | set (final Frustum o) |
| final Plane[] | getPlanes () |
Planes are ordered in the returned array as follows: More... | |
| Vec4f[] | getPlanes (final Vec4f[] out) |
Sets each of the given Vec4f[6] out to Plane#toVec4f(Vec4f) in the order LEFT, RIGHT, BOTTOM, TOP, NEAR, FAR. More... | |
| void | getPlanes (final float[] out, final int off) |
Sets the given [float[off]..float[off+4*6]) out to ( n, d ). More... | |
| final void | updateByPlanes (final Plane[] src) |
Copy the given src planes into this this instance's planes. More... | |
| Matrix4f | updateByFovDesc (final Matrix4f m, final FovDesc fovDesc) |
Calculate the frustum planes in world coordinates using the passed FovDesc. More... | |
| Frustum | setFromMat (final Matrix4f pmv) |
| Calculate the frustum planes in world coordinates using the passed column major order matrix, usually a projection (P) or premultiplied P*MV matrix. More... | |
| Frustum | updateFrustumPlanes (final Cube c) |
Calculate the frustum planes using the given Cube. More... | |
| final boolean | isOutside (final AABBox box) |
Returns whether the given AABBox is completely outside of this frustum. More... | |
| final boolean | isOutside (final Cube c) |
Returns whether the given Cube is completely outside of this frustum. More... | |
| final Location | classifyPoint (final Vec3f p) |
Classifies the given Vec3f point whether it is outside, inside or on a plane of this frustum. More... | |
| final boolean | isOutside (final Vec3f p) |
Returns whether the given Vec3f point is completely outside of this frustum. More... | |
| final Location | classifySphere (final Vec3f p, final float radius) |
| Classifies the given sphere whether it is is outside, intersecting or inside of this frustum. More... | |
| final boolean | isSphereOutside (final Vec3f p, final float radius) |
| Returns whether the given sphere is completely outside of this frustum. More... | |
| StringBuilder | toString (StringBuilder sb) |
| String | toString () |
Static Public Attributes | |
| static final int | LEFT = 0 |
| Index for left plane: {@value}. More... | |
| static final int | RIGHT = 1 |
| Index for right plane: {@value}. More... | |
| static final int | BOTTOM = 2 |
| Index for bottom plane: {@value}. More... | |
| static final int | TOP = 3 |
| Index for top plane: {@value}. More... | |
| static final int | NEAR = 4 |
| Index for near plane: {@value}. More... | |
| static final int | FAR = 5 |
| Index for far plane: {@value}. More... | |
Protected Attributes | |
| final Plane[] | planes = new Plane[6] |
| Normalized planes[l, r, b, t, n, f]. More... | |
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 Gribb ggrib.nosp@m.b@ra.nosp@m.venso.nosp@m.ft.c.nosp@m.om Klaus Hartmann k_har.nosp@m.tman.nosp@m.n@osn.nosp@m.abru.nosp@m.eck.n.nosp@m.etsu.nosp@m.rf.de http://graphics.cs.ucf.edu/cap4720/fall2008/plane_extraction.pdf
Classifying Point, Sphere and AABBox:
Efficient View Frustum Culling Daniel Sýkora sykor.nosp@m.ad@f.nosp@m.el.cv.nosp@m.ut.c.nosp@m.z Josef Jelínek jelin.nosp@m.ej1@.nosp@m.fel.c.nosp@m.vut..nosp@m.cz 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 Wagner mwagn.nosp@m.er@d.nosp@m.igipe.nosp@m.n.ed.nosp@m.u http://www.emeyex.com/site/tuts/PlanesHalfSpaces.pdf
Frustum Culling, Max Wagner mwagn.nosp@m.er@d.nosp@m.igipe.nosp@m.n.ed.nosp@m.u http://www.emeyex.com/site/tuts/FrustumCulling.pdf
Definition at line 81 of file Frustum.java.
| com.jogamp.math.geom.Frustum.Frustum | ( | ) |
Creates an undefined instance w/o calculating the frustum.
Use one of the update(..) methods to set the planes.
Definition at line 123 of file Frustum.java.
| com.jogamp.math.geom.Frustum.Frustum | ( | final Frustum | o | ) |
Definition at line 132 of file Frustum.java.
Classifies the given Vec3f point whether it is outside, inside or on a plane of this frustum.
| p | the point |
Location of point related to frustum planes Definition at line 468 of file Frustum.java.
Classifies the given sphere whether it is is outside, intersecting or inside of this frustum.
| p | center of the sphere |
| radius | radius of the sphere |
Location of point related to frustum planes Definition at line 504 of file Frustum.java.
| final Plane[] com.jogamp.math.geom.Frustum.getPlanes | ( | ) |
Planes are ordered in the returned array as follows:
Plane's normals are pointing to the inside of the frustum in order to work w/ isOutside(..) methods.
Planes, order see above. Definition at line 289 of file Frustum.java.
| void com.jogamp.math.geom.Frustum.getPlanes | ( | final float[] | out, |
| final int | off | ||
| ) |
Sets the given [float[off]..float[off+4*6]) out to ( n, d ).
Sets each of the given [float[off]..float[off+4*6]) out to Plane#toFloats(float[], int), i.e. [n.x, n.y, n.z, d, ...].
Plane order is as follows: LEFT, RIGHT, BOTTOM, TOP, NEAR, FAR.
| out | the float[off+4*6] output array |
out for chaining Definition at line 317 of file Frustum.java.
| final boolean com.jogamp.math.geom.Frustum.isOutside | ( | final AABBox | box | ) |
Returns whether the given AABBox is completely outside of this frustum.
Note: If method returns false, the box may only be partially inside, i.e. intersects with this frustum
Definition at line 424 of file Frustum.java.
| final boolean com.jogamp.math.geom.Frustum.isOutside | ( | final Cube | c | ) |
Returns whether the given Cube is completely outside of this frustum.
Note: If method returns false, the box may only be partially inside, i.e. intersects with this frustum
Definition at line 450 of file Frustum.java.
| final boolean com.jogamp.math.geom.Frustum.isOutside | ( | final Vec3f | p | ) |
Returns whether the given Vec3f point is completely outside of this frustum.
| p | the point |
Definition at line 488 of file Frustum.java.
| final boolean com.jogamp.math.geom.Frustum.isSphereOutside | ( | final Vec3f | p, |
| final float | radius | ||
| ) |
Returns whether the given sphere is completely outside of this frustum.
| p | center of the sphere |
| radius | radius of the sphere |
Definition at line 527 of file Frustum.java.
Definition at line 141 of file Frustum.java.
Calculate the frustum planes in world coordinates using the passed column major order matrix, usually a projection (P) or premultiplied P*MV matrix.
Frustum plane's normals will point to the inside of the viewing frustum, as required by this class.
Definition at line 378 of file Frustum.java.
| String com.jogamp.math.geom.Frustum.toString | ( | ) |
Definition at line 547 of file Frustum.java.
| StringBuilder com.jogamp.math.geom.Frustum.toString | ( | StringBuilder | sb | ) |
Definition at line 531 of file Frustum.java.
Calculate the frustum planes in world coordinates using the passed FovDesc.
Operation Details:
FovDesc will be transformed into the given perspective matrix (column major order) first, see Matrix4f#setToPerspective(FovHVHalves, float, float). Matrix4f#getFrustum(Frustum) this instance. Frustum plane's normals will point to the inside of the viewing frustum, as required by this class.
Definition at line 363 of file Frustum.java.
| final void com.jogamp.math.geom.Frustum.updateByPlanes | ( | final Plane[] | src | ) |
Copy the given src planes into this this instance's planes.
| src | the 6 source planes |
Definition at line 330 of file Frustum.java.
Calculate the frustum planes using the given Cube.
One useful application is to transform an AABBox, see Cube#Cube(AABBox) from its object-space into model-view (Mv) and produce the Frustum planes using this method for CPU side object culling and GPU shader side fragment clipping.
Frustum plane's normals will point to the inside of the viewing frustum, as required by this class.
| c | the Cube source |
Definition at line 400 of file Frustum.java.
|
static |
Index for bottom plane: {@value}.
Definition at line 264 of file Frustum.java.
|
static |
Index for far plane: {@value}.
Definition at line 270 of file Frustum.java.
|
static |
Index for left plane: {@value}.
Definition at line 260 of file Frustum.java.
|
static |
Index for near plane: {@value}.
Definition at line 268 of file Frustum.java.
Normalized planes[l, r, b, t, n, f].
Definition at line 113 of file Frustum.java.
|
static |
Index for right plane: {@value}.
Definition at line 262 of file Frustum.java.
|
static |
Index for top plane: {@value}.
Definition at line 266 of file Frustum.java.