diff options
author | Sven Gothel <[email protected]> | 2014-03-14 08:26:01 +0100 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2014-03-14 08:26:01 +0100 |
commit | e2ceb1af352ec73967f2c15341d10fa3069b0a84 (patch) | |
tree | 42eb6ccd8aae103d2b15f06a15e4df70ecaffe68 /src | |
parent | e16e974a3e2b38c65355838eeb010954354097d2 (diff) |
PMVMatrix.glLoadMatrix(Quaternion): Load Quaternion's directly w/o intermediate matrix
Diffstat (limited to 'src')
-rw-r--r-- | src/jogl/classes/com/jogamp/opengl/util/PMVMatrix.java | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/src/jogl/classes/com/jogamp/opengl/util/PMVMatrix.java b/src/jogl/classes/com/jogamp/opengl/util/PMVMatrix.java index 2d88f7937..6db726b01 100644 --- a/src/jogl/classes/com/jogamp/opengl/util/PMVMatrix.java +++ b/src/jogl/classes/com/jogamp/opengl/util/PMVMatrix.java @@ -540,8 +540,21 @@ public class PMVMatrix implements GLMatrixFunc { * Load the current matrix with the values of the given {@link Quaternion}'s rotation {@link Quaternion#toMatrix(float[], int) matrix representation}. */ public final void glLoadMatrix(final Quaternion quat) { - quat.toMatrix(tmpMatrix, 0); - glLoadMatrixf(tmpMatrix, 0); + if(matrixMode==GL_MODELVIEW) { + quat.toMatrix(matrixMv); + matrixMv.reset(); + dirtyBits |= DIRTY_INVERSE_MODELVIEW | DIRTY_INVERSE_TRANSPOSED_MODELVIEW | DIRTY_FRUSTUM ; + modifiedBits |= MODIFIED_MODELVIEW; + } else if(matrixMode==GL_PROJECTION) { + quat.toMatrix(matrixP); + matrixP.reset(); + dirtyBits |= DIRTY_FRUSTUM ; + modifiedBits |= MODIFIED_PROJECTION; + } else if(matrixMode==GL.GL_TEXTURE) { + quat.toMatrix(matrixTex); + matrixTex.reset(); + modifiedBits |= MODIFIED_TEXTURE; + } } @Override |