aboutsummaryrefslogtreecommitdiffstats
path: root/src/jogl/classes/com/jogamp
diff options
context:
space:
mode:
authorSven Gothel <sgothel@jausoft.com>2014-03-14 08:26:01 +0100
committerSven Gothel <sgothel@jausoft.com>2014-03-14 08:26:01 +0100
commite2ceb1af352ec73967f2c15341d10fa3069b0a84 (patch)
tree42eb6ccd8aae103d2b15f06a15e4df70ecaffe68 /src/jogl/classes/com/jogamp
parente16e974a3e2b38c65355838eeb010954354097d2 (diff)
PMVMatrix.glLoadMatrix(Quaternion): Load Quaternion's directly w/o intermediate matrix
Diffstat (limited to 'src/jogl/classes/com/jogamp')
-rw-r--r--src/jogl/classes/com/jogamp/opengl/util/PMVMatrix.java17
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