summaryrefslogtreecommitdiffstats
path: root/src/jogl/classes/com/jogamp/opengl/math
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2023-03-19 06:11:35 +0100
committerSven Gothel <[email protected]>2023-03-19 06:11:35 +0100
commit603068a4e6af5293db10db73ead3a83b7a74af34 (patch)
treede6097189acfe6efe0e5ff51a9b9803bb7d91c56 /src/jogl/classes/com/jogamp/opengl/math
parentf8584748e33aab56780eca5cf7009a5a0d11991d (diff)
API doc cleanup, add + refine math tests
API doc
Diffstat (limited to 'src/jogl/classes/com/jogamp/opengl/math')
-rw-r--r--src/jogl/classes/com/jogamp/opengl/math/FloatUtil.java28
-rw-r--r--src/jogl/classes/com/jogamp/opengl/math/Ray.java3
-rw-r--r--src/jogl/classes/com/jogamp/opengl/math/geom/AABBox.java2
3 files changed, 22 insertions, 11 deletions
diff --git a/src/jogl/classes/com/jogamp/opengl/math/FloatUtil.java b/src/jogl/classes/com/jogamp/opengl/math/FloatUtil.java
index 73244cb13..af1db0c1e 100644
--- a/src/jogl/classes/com/jogamp/opengl/math/FloatUtil.java
+++ b/src/jogl/classes/com/jogamp/opengl/math/FloatUtil.java
@@ -1908,11 +1908,11 @@ public final class FloatUtil {
final int a0 = aOffset + a.position();
if(rowMajorOrder) {
for(int c=0; c<columns; c++) {
- sb.append( String.format((Locale)null, f+" ", a.get( a0 + row*columns + c ) ) );
+ sb.append( String.format((Locale)null, f+", ", a.get( a0 + row*columns + c ) ) );
}
} else {
for(int r=0; r<columns; r++) {
- sb.append( String.format((Locale)null, f+" ", a.get( a0 + row + r*rows ) ) );
+ sb.append( String.format((Locale)null, f+", ", a.get( a0 + row + r*rows ) ) );
}
}
return sb;
@@ -1936,11 +1936,11 @@ public final class FloatUtil {
}
if(rowMajorOrder) {
for(int c=0; c<columns; c++) {
- sb.append( String.format((Locale)null, f+" ", a[ aOffset + row*columns + c ] ) );
+ sb.append( String.format((Locale)null, f+", ", a[ aOffset + row*columns + c ] ) );
}
} else {
for(int r=0; r<columns; r++) {
- sb.append( String.format((Locale)null, f+" ", a[ aOffset + row + r*rows ] ) );
+ sb.append( String.format((Locale)null, f+", ", a[ aOffset + row + r*rows ] ) );
}
}
return sb;
@@ -1963,11 +1963,15 @@ public final class FloatUtil {
sb = new StringBuilder();
}
final String prefix = ( null == rowPrefix ) ? "" : rowPrefix;
+ sb.append(prefix).append("{ ");
for(int i=0; i<rows; i++) {
- sb.append(prefix).append("[ ");
+ if( 0 < i ) {
+ sb.append(prefix).append(" ");
+ }
matrixRowToString(sb, f, a, aOffset, rows, columns, rowMajorOrder, i);
- sb.append("]").append(Platform.getNewline());
+ sb.append(Platform.getNewline());
}
+ sb.append(prefix).append("}").append(Platform.getNewline());
return sb;
}
@@ -1988,11 +1992,15 @@ public final class FloatUtil {
sb = new StringBuilder();
}
final String prefix = ( null == rowPrefix ) ? "" : rowPrefix;
+ sb.append(prefix).append("{ ");
for(int i=0; i<rows; i++) {
- sb.append(prefix).append("[ ");
+ if( 0 < i ) {
+ sb.append(prefix).append(" ");
+ }
matrixRowToString(sb, f, a, aOffset, rows, columns, rowMajorOrder, i);
- sb.append("]").append(Platform.getNewline());
+ sb.append(Platform.getNewline());
}
+ sb.append(prefix).append("}").append(Platform.getNewline());
return sb;
}
@@ -2314,10 +2322,10 @@ public final class FloatUtil {
/**
* Returns orthogonal distance
- * (1f/zNear-1f/orthoDist)/(1f/zNear-1f/zFar);
+ * (1f/zNear-1f/orthoZ) / (1f/zNear-1f/zFar);
*/
public static float getOrthoWinZ(final float orthoZ, final float zNear, final float zFar) {
- return (1f/zNear-1f/orthoZ)/(1f/zNear-1f/zFar);
+ return (1f/zNear-1f/orthoZ) / (1f/zNear-1f/zFar);
}
} \ No newline at end of file
diff --git a/src/jogl/classes/com/jogamp/opengl/math/Ray.java b/src/jogl/classes/com/jogamp/opengl/math/Ray.java
index 4d651d1c3..a528f0763 100644
--- a/src/jogl/classes/com/jogamp/opengl/math/Ray.java
+++ b/src/jogl/classes/com/jogamp/opengl/math/Ray.java
@@ -1,5 +1,5 @@
/**
- * Copyright 2014 JogAmp Community. All rights reserved.
+ * Copyright 2014-2023 JogAmp Community. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
@@ -53,6 +53,7 @@ public class Ray {
/** Normalized direction vector of ray, float[3]. */
public final float[] dir = new float[3];
+ @Override
public String toString() {
return "Ray[orig["+orig[0]+", "+orig[1]+", "+orig[2]+"], dir["+dir[0]+", "+dir[1]+", "+dir[2]+"]]";
}
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 5a14406b0..f858b1c0d 100644
--- a/src/jogl/classes/com/jogamp/opengl/math/geom/AABBox.java
+++ b/src/jogl/classes/com/jogamp/opengl/math/geom/AABBox.java
@@ -596,6 +596,7 @@ public class AABBox {
* @param size a constant float value
* @param tmpV3 caller provided temporary 3-component vector
* @return this AABBox for chaining
+ * @see #scale2(float, float[])
*/
public final AABBox scale(final float size, final float[] tmpV3) {
tmpV3[0] = high[0] - center[0];
@@ -622,6 +623,7 @@ public class AABBox {
* @param size a constant float value
* @param tmpV3 caller provided temporary 3-component vector
* @return this AABBox for chaining
+ * @see #scale(float, float[])
*/
public final AABBox scale2(final float size, final float[] tmpV3) {
VectorUtil.scaleVec3(high, high, size); // in-place scale