From 72980712910d1c49e324f1463d987be3ea280abd Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Sun, 27 Aug 2023 12:57:39 +0200 Subject: Vec3f: Add UNIX_X and UNIX_X_NEG, enhance API doc --- src/jogl/classes/com/jogamp/opengl/math/Vec3f.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/jogl/classes/com/jogamp') 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) ); -- cgit v1.2.3