aboutsummaryrefslogtreecommitdiffstats
path: root/src/jogl/classes/com/jogamp/opengl/math/Quaternion.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/jogl/classes/com/jogamp/opengl/math/Quaternion.java')
-rw-r--r--src/jogl/classes/com/jogamp/opengl/math/Quaternion.java19
1 files changed, 18 insertions, 1 deletions
diff --git a/src/jogl/classes/com/jogamp/opengl/math/Quaternion.java b/src/jogl/classes/com/jogamp/opengl/math/Quaternion.java
index a285774f8..9548a160a 100644
--- a/src/jogl/classes/com/jogamp/opengl/math/Quaternion.java
+++ b/src/jogl/classes/com/jogamp/opengl/math/Quaternion.java
@@ -75,7 +75,7 @@ public class Quaternion {
}
/**
- * Return the magnitude of this quaternion, i.e. sqrt({@link #magnitude()})
+ * Return the magnitude of this quaternion, i.e. sqrt({@link #magnitudeSquared()})
* <p>
* A magnitude of zero shall equal {@link #isIdentity() identity},
* as performed by {@link #normalize()}.
@@ -346,6 +346,23 @@ public class Quaternion {
}
/**
+ * Rotate this quaternion by the given angle and axis.
+ * <p>
+ * The axis must be a normalized vector.
+ * </p>
+ * <p>
+ * A rotational quaternion is made from the given angle and axis.
+ * </p>
+ *
+ * @param angle in radians
+ * @param axis Vec3f coord of rotation axis
+ * @return this quaternion for chaining.
+ */
+ public Quaternion rotateByAngleNormalAxis(final float angle, final Vec3f axis) {
+ return rotateByAngleNormalAxis(angle, axis.x(), axis.y(), axis.z());
+ }
+
+ /**
* Rotate this quaternion around X axis with the given angle in radians
*
* @param angle in radians