summaryrefslogtreecommitdiffstats
path: root/src/jogl
diff options
context:
space:
mode:
Diffstat (limited to 'src/jogl')
-rw-r--r--src/jogl/classes/com/jogamp/opengl/math/Quaternion.java5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/jogl/classes/com/jogamp/opengl/math/Quaternion.java b/src/jogl/classes/com/jogamp/opengl/math/Quaternion.java
index 65594a50e..409176101 100644
--- a/src/jogl/classes/com/jogamp/opengl/math/Quaternion.java
+++ b/src/jogl/classes/com/jogamp/opengl/math/Quaternion.java
@@ -77,12 +77,13 @@ public class Quaternion {
* @param angle rotation angle (rads)
*/
public void fromAxis(float[] vector, float angle) {
- float sin = FloatUtil.sin(angle *= 0.5f);
+ float halfangle = angle * 0.5f;
+ float sin = FloatUtil.sin(halfangle);
float[] nv = VectorUtil.normalize(vector);
x = (nv[0] * sin);
y = (nv[1] * sin);
z = (nv[2] * sin);
- w = FloatUtil.cos(angle);
+ w = FloatUtil.cos(halfangle);
}
/**