aboutsummaryrefslogtreecommitdiffstats
path: root/src/jogl/classes/com/jogamp/opengl/math/geom/Frustum.java
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2012-11-12 07:30:54 +0100
committerSven Gothel <[email protected]>2012-11-12 07:30:54 +0100
commitd621fcf6f2c6096ea71bf2ebb767c48f8eb3a5e1 (patch)
tree621852d76cf20ef7e9284a8ac7a7b212f63ae10e /src/jogl/classes/com/jogamp/opengl/math/geom/Frustum.java
parent92406ae9a2153c1b6a74c29d9939a021d898dcf1 (diff)
Frustum: Add doc. about Frustum's Plane's normal orientation
Diffstat (limited to 'src/jogl/classes/com/jogamp/opengl/math/geom/Frustum.java')
-rw-r--r--src/jogl/classes/com/jogamp/opengl/math/geom/Frustum.java18
1 files changed, 16 insertions, 2 deletions
diff --git a/src/jogl/classes/com/jogamp/opengl/math/geom/Frustum.java b/src/jogl/classes/com/jogamp/opengl/math/geom/Frustum.java
index c18740b66..800df45bb 100644
--- a/src/jogl/classes/com/jogamp/opengl/math/geom/Frustum.java
+++ b/src/jogl/classes/com/jogamp/opengl/math/geom/Frustum.java
@@ -69,7 +69,13 @@ public class Frustum {
}
}
- /** Plane equation := dot(n, x - p) = 0 -> ax + bc + cx + d == 0 */
+ /**
+ * Plane equation := dot(n, x - p) = 0 -> ax + bc + cx + d == 0
+ * <p>
+ * In order to work w/ {@link Frustum#isOutside(AABBox) isOutside(..)} methods,
+ * the normals have to point to the inside of the frustum.
+ * </p>
+ */
public static class Plane {
/** Normal of the plane */
public final float[] n = new float[3];
@@ -121,7 +127,7 @@ public class Frustum {
public static final int FAR = 5;
/**
- * Planes are ordered in the returned array as follows:
+ * {@link Plane}s are ordered in the returned array as follows:
* <ul>
* <li>{@link #LEFT}</li>
* <li>{@link #RIGHT}</li>
@@ -130,6 +136,10 @@ public class Frustum {
* <li>{@link #NEAR}</li>
* <li>{@link #FAR}</li>
* </ul>
+ * <p>
+ * {@link Plane}'s normals are pointing to the inside of the frustum
+ * in order to work w/ {@link #isOutside(AABBox) isOutside(..)} methods.
+ * </p>
*
* @return array of normalized {@link Plane}s, order see above.
*/
@@ -155,6 +165,10 @@ public class Frustum {
/**
* Calculate the frustum planes in world coordinates
* using the passed float[16] as premultiplied P*MV (column major order).
+ * <p>
+ * Frustum plane's normals will point to the inside of the viewing frustum,
+ * as required by this class.
+ * </p>
*/
public void update(float[] pmv, int pmv_off) {
// Left: a = m41 + m11, b = m42 + m12, c = m43 + m13, d = m44 + m14 - [1..4] row-major