aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2023-08-27 12:57:39 +0200
committerSven Gothel <[email protected]>2023-08-27 13:09:50 +0200
commit72980712910d1c49e324f1463d987be3ea280abd (patch)
treeef756d32291773ea4df2002a24fefafca7c23f85 /src
parent9ed41468fbf3d93555ac6c16630b25220f55aa39 (diff)
Vec3f: Add UNIX_X and UNIX_X_NEG, enhance API doc
Diffstat (limited to 'src')
-rw-r--r--src/jogl/classes/com/jogamp/opengl/math/Vec3f.java6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/jogl/classes/com/jogamp/opengl/math/Vec3f.java b/src/jogl/classes/com/jogamp/opengl/math/Vec3f.java
index f1f7cdca4..34f13adbe 100644
--- a/src/jogl/classes/com/jogamp/opengl/math/Vec3f.java
+++ b/src/jogl/classes/com/jogamp/opengl/math/Vec3f.java
@@ -36,6 +36,8 @@ package com.jogamp.opengl.math;
*/
public final class Vec3f {
public static final Vec3f ONE = new Vec3f(1f, 1f, 1f);
+ public static final Vec3f UNIT_X = new Vec3f(1f, 0f, 0f);
+ public static final Vec3f UNIT_X_NEG = new Vec3f(-1f, 0f, 0f);
public static final Vec3f UNIT_Y = new Vec3f(0f, 1f, 0f);
public static final Vec3f UNIT_Y_NEG = new Vec3f(0f, -1f, 0f);
public static final Vec3f UNIT_Z = new Vec3f(0f, 0f, 1f);
@@ -328,14 +330,14 @@ public final class Vec3f {
}
/**
- * Return the cosines of the angle between two vectors
+ * Return the cosine of the angle between two vectors using {@link #dot(Vec3f)}
*/
public float cosAngle(final Vec3f o) {
return dot(o) / ( length() * o.length() ) ;
}
/**
- * Return the angle between two vectors in radians
+ * Return the angle between two vectors in radians using {@link Math#acos(double)} on {@link #cosAngle(Vec3f)}.
*/
public float angle(final Vec3f o) {
return (float) Math.acos( cosAngle(o) );