aboutsummaryrefslogtreecommitdiffstats
path: root/src/jogl/classes/com/jogamp/opengl/math/geom
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2014-07-03 16:21:36 +0200
committerSven Gothel <[email protected]>2014-07-03 16:21:36 +0200
commit556d92b63555a085b25e32b1cd55afce24edd07a (patch)
tree6be2b02c62a77d5aba81ffbe34c46960608be163 /src/jogl/classes/com/jogamp/opengl/math/geom
parenta90f4a51dffec3247278e3c683ed4462b1dd9ab5 (diff)
Code Clean-Up based on our Recommended Settings (jogamp-scripting c47bc86ae2ee268a1f38c5580d11f93d7f8d6e74)
- Change non static accesses to static members using declaring type - Change indirect accesses to static members to direct accesses (accesses through subtypes) - Add final modifier to private fields - Add final modifier to method parameters - Add final modifier to local variables - Remove unnecessary casts - Remove unnecessary '$NON-NLS$' tags - Remove trailing white spaces on all lines
Diffstat (limited to 'src/jogl/classes/com/jogamp/opengl/math/geom')
-rw-r--r--src/jogl/classes/com/jogamp/opengl/math/geom/AABBox.java10
-rw-r--r--src/jogl/classes/com/jogamp/opengl/math/geom/Frustum.java36
2 files changed, 24 insertions, 22 deletions
diff --git a/src/jogl/classes/com/jogamp/opengl/math/geom/AABBox.java b/src/jogl/classes/com/jogamp/opengl/math/geom/AABBox.java
index d87bbb6f9..e454c036a 100644
--- a/src/jogl/classes/com/jogamp/opengl/math/geom/AABBox.java
+++ b/src/jogl/classes/com/jogamp/opengl/math/geom/AABBox.java
@@ -68,7 +68,7 @@ public class AABBox {
* Create an AABBox copying all values from the given one
* @param src the box value to be used for the new instance
*/
- public AABBox(AABBox src) {
+ public AABBox(final AABBox src) {
copy(src);
}
@@ -147,7 +147,7 @@ public class AABBox {
* @param src source AABBox
* @return this AABBox for chaining
*/
- public final AABBox copy(AABBox src) {
+ public final AABBox copy(final AABBox src) {
System.arraycopy(src.low, 0, low, 0, 3);
System.arraycopy(src.high, 0, high, 0, 3);
System.arraycopy(src.center, 0, center, 0, 3);
@@ -196,8 +196,8 @@ public class AABBox {
* @return this AABBox for chaining
*/
public final AABBox resize(final AABBox newBox) {
- float[] newLow = newBox.getLow();
- float[] newHigh = newBox.getHigh();
+ final float[] newLow = newBox.getLow();
+ final float[] newHigh = newBox.getHigh();
/** test low */
if (newLow[0] < low[0])
@@ -662,7 +662,7 @@ public class AABBox {
}
@Override
- public final boolean equals(Object obj) {
+ public final boolean equals(final Object obj) {
if( obj == this ) {
return true;
}
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 87d31becb..f6d3c0dfa 100644
--- a/src/jogl/classes/com/jogamp/opengl/math/geom/Frustum.java
+++ b/src/jogl/classes/com/jogamp/opengl/math/geom/Frustum.java
@@ -27,6 +27,8 @@
*/
package com.jogamp.opengl.math.geom;
+import jogamp.common.os.PlatformPropsImpl;
+
import com.jogamp.common.os.Platform;
/**
@@ -113,12 +115,12 @@ public class Frustum {
* Negative halfspace is the <i>other side</i> of the plane, i.e. *-1
* </p>
**/
- public final float distanceTo(float x, float y, float z) {
+ public final float distanceTo(final float x, final float y, final float z) {
return n[0] * x + n[1] * y + n[2] * z + d;
}
/** Return distance of plane to given point, see {@link #distanceTo(float, float, float)}. */
- public final float distanceTo(float[] p) {
+ public final float distanceTo(final float[] p) {
return n[0] * p[0] + n[1] * p[1] + n[2] * p[2] + d;
}
@@ -164,7 +166,7 @@ public class Frustum {
* Copy the given <code>src</code> planes into this this instance's planes.
* @param src the 6 source planes
*/
- public final void updateByPlanes(Plane[] src) {
+ public final void updateByPlanes(final Plane[] src) {
for (int i = 0; i < 6; ++i) {
final Plane p0 = planes[i];
final float[] p0_n = p0.n;
@@ -185,7 +187,7 @@ public class Frustum {
* as required by this class.
* </p>
*/
- public void updateByPMV(float[] pmv, int pmv_off) {
+ public void updateByPMV(final float[] pmv, final int pmv_off) {
// Left: a = m41 + m11, b = m42 + m12, c = m43 + m13, d = m44 + m14 - [1..4] column-major
// Left: a = m30 + m00, b = m31 + m01, c = m32 + m02, d = m33 + m03 - [0..3] column-major
{
@@ -265,7 +267,7 @@ public class Frustum {
}
}
- private static final boolean isOutsideImpl(Plane p, AABBox box) {
+ private static final boolean isOutsideImpl(final Plane p, final AABBox box) {
final float[] low = box.getLow();
final float[] high = box.getHigh();
@@ -288,7 +290,7 @@ public class Frustum {
* Note: If method returns false, the box may only be partially inside.
* </p>
*/
- public final boolean isAABBoxOutside(AABBox box) {
+ public final boolean isAABBoxOutside(final AABBox box) {
for (int i = 0; i < 6; ++i) {
if ( isOutsideImpl(planes[i], box) ) {
// fully outside
@@ -308,7 +310,7 @@ public class Frustum {
* @param p the point
* @return {@link Location} of point related to frustum planes
*/
- public final Location classifyPoint(float[] p) {
+ public final Location classifyPoint(final float[] p) {
Location res = Location.INSIDE;
for (int i = 0; i < 6; ++i) {
@@ -328,7 +330,7 @@ public class Frustum {
* @param p the point
* @return true if outside of the frustum, otherwise inside or on a plane
*/
- public final boolean isPointOutside(float[] p) {
+ public final boolean isPointOutside(final float[] p) {
return Location.OUTSIDE == classifyPoint(p);
}
@@ -339,7 +341,7 @@ public class Frustum {
* @param radius radius of the sphere
* @return {@link Location} of point related to frustum planes
*/
- public final Location classifySphere(float[] p, float radius) {
+ public final Location classifySphere(final float[] p, final float radius) {
Location res = Location.INSIDE; // fully inside
for (int i = 0; i < 6; ++i) {
@@ -362,7 +364,7 @@ public class Frustum {
* @param radius radius of the sphere
* @return true if outside of the frustum, otherwise inside or intersecting
*/
- public final boolean isSphereOutside(float[] p, float radius) {
+ public final boolean isSphereOutside(final float[] p, final float radius) {
return Location.OUTSIDE == classifySphere(p, radius);
}
@@ -370,13 +372,13 @@ public class Frustum {
if( null == sb ) {
sb = new StringBuilder();
}
- sb.append("Frustum[ Planes[ ").append(Platform.NEWLINE)
- .append(" L: ").append(planes[0]).append(", ").append(Platform.NEWLINE)
- .append(" R: ").append(planes[1]).append(", ").append(Platform.NEWLINE)
- .append(" B: ").append(planes[2]).append(", ").append(Platform.NEWLINE)
- .append(" T: ").append(planes[3]).append(", ").append(Platform.NEWLINE)
- .append(" N: ").append(planes[4]).append(", ").append(Platform.NEWLINE)
- .append(" F: ").append(planes[5]).append("], ").append(Platform.NEWLINE)
+ sb.append("Frustum[ Planes[ ").append(PlatformPropsImpl.NEWLINE)
+ .append(" L: ").append(planes[0]).append(", ").append(PlatformPropsImpl.NEWLINE)
+ .append(" R: ").append(planes[1]).append(", ").append(PlatformPropsImpl.NEWLINE)
+ .append(" B: ").append(planes[2]).append(", ").append(PlatformPropsImpl.NEWLINE)
+ .append(" T: ").append(planes[3]).append(", ").append(PlatformPropsImpl.NEWLINE)
+ .append(" N: ").append(planes[4]).append(", ").append(PlatformPropsImpl.NEWLINE)
+ .append(" F: ").append(planes[5]).append("], ").append(PlatformPropsImpl.NEWLINE)
.append("]");
return sb;
}