diff options
author | Sven Gothel <[email protected]> | 2013-06-09 08:50:06 +0200 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2013-06-09 08:50:06 +0200 |
commit | 50fc55b42f791840ce1ddee943351ccc61285a84 (patch) | |
tree | 2d2db6ef6a2d8808d63370fd69a0ea6cca8c40f5 /src/jogl/classes/com/jogamp/opengl | |
parent | 81a4f175e3065ea281139d08cc79bcdfb4912ee7 (diff) |
Fix Bug 748 - PMVMatrix gluProject and gluUnProject broken w/ backingArray (default) ; Also: Use FloatUtil in-place multMatrixf.
PMVMatrix gluProject(..) and gluUnProject(..) don't pass their position (offset)
to the multMatrixf operation - even though they are sliced.
The API doc actually emphasizes this.
Diffstat (limited to 'src/jogl/classes/com/jogamp/opengl')
-rw-r--r-- | src/jogl/classes/com/jogamp/opengl/util/PMVMatrix.java | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/src/jogl/classes/com/jogamp/opengl/util/PMVMatrix.java b/src/jogl/classes/com/jogamp/opengl/util/PMVMatrix.java index bfc03d019..58151856f 100644 --- a/src/jogl/classes/com/jogamp/opengl/util/PMVMatrix.java +++ b/src/jogl/classes/com/jogamp/opengl/util/PMVMatrix.java @@ -488,7 +488,7 @@ public class PMVMatrix implements GLMatrixFunc { if(matrixGetName==GL_MATRIX_MODE) { params.put((float)matrixMode); } else { - FloatBuffer matrix = glGetMatrixf(matrixGetName); + final FloatBuffer matrix = glGetMatrixf(matrixGetName); params.put(matrix); // matrix -> params matrix.reset(); } @@ -500,7 +500,7 @@ public class PMVMatrix implements GLMatrixFunc { if(matrixGetName==GL_MATRIX_MODE) { params[params_offset]=(float)matrixMode; } else { - FloatBuffer matrix = glGetMatrixf(matrixGetName); + final FloatBuffer matrix = glGetMatrixf(matrixGetName); matrix.get(params, params_offset, 16); // matrix -> params matrix.reset(); } @@ -619,15 +619,15 @@ public class PMVMatrix implements GLMatrixFunc { @Override public final void glMultMatrixf(final FloatBuffer m) { if(matrixMode==GL_MODELVIEW) { - FloatUtil.multMatrixf(matrixMv, m, matrixMv); + FloatUtil.multMatrixf(matrixMv, m); dirtyBits |= DIRTY_INVERSE_MODELVIEW | DIRTY_INVERSE_TRANSPOSED_MODELVIEW | DIRTY_FRUSTUM ; modifiedBits |= MODIFIED_MODELVIEW; } else if(matrixMode==GL_PROJECTION) { - FloatUtil.multMatrixf(matrixP, m, matrixP); + FloatUtil.multMatrixf(matrixP, m); dirtyBits |= DIRTY_FRUSTUM ; modifiedBits |= MODIFIED_PROJECTION; } else if(matrixMode==GL.GL_TEXTURE) { - FloatUtil.multMatrixf(matrixTex, m, matrixTex); + FloatUtil.multMatrixf(matrixTex, m); modifiedBits |= MODIFIED_TEXTURE; } } @@ -635,15 +635,15 @@ public class PMVMatrix implements GLMatrixFunc { @Override public final void glMultMatrixf(float[] m, int m_offset) { if(matrixMode==GL_MODELVIEW) { - FloatUtil.multMatrixf(matrixMv, m, m_offset, matrixMv); + FloatUtil.multMatrixf(matrixMv, m, m_offset); dirtyBits |= DIRTY_INVERSE_MODELVIEW | DIRTY_INVERSE_TRANSPOSED_MODELVIEW | DIRTY_FRUSTUM ; modifiedBits |= MODIFIED_MODELVIEW; } else if(matrixMode==GL_PROJECTION) { - FloatUtil.multMatrixf(matrixP, m, m_offset, matrixP); + FloatUtil.multMatrixf(matrixP, m, m_offset); dirtyBits |= DIRTY_FRUSTUM ; modifiedBits |= MODIFIED_PROJECTION; } else if(matrixMode==GL.GL_TEXTURE) { - FloatUtil.multMatrixf(matrixTex, m, m_offset, matrixTex); + FloatUtil.multMatrixf(matrixTex, m, m_offset); modifiedBits |= MODIFIED_TEXTURE; } } @@ -813,8 +813,8 @@ public class PMVMatrix implements GLMatrixFunc { float[] win_pos, int win_pos_offset ) { if(usesBackingArray) { return projectFloat.gluProject(objx, objy, objz, - matrixMv.array(), 0, - matrixP.array(), 0, + matrixMv.array(), matrixMv.position(), + matrixP.array(), matrixP.position(), viewport, viewport_offset, win_pos, win_pos_offset); } else { @@ -843,8 +843,8 @@ public class PMVMatrix implements GLMatrixFunc { float[] obj_pos, int obj_pos_offset) { if(usesBackingArray) { return projectFloat.gluUnProject(winx, winy, winz, - matrixMv.array(), 0, - matrixP.array(), 0, + matrixMv.array(), matrixMv.position(), + matrixP.array(), matrixP.position(), viewport, viewport_offset, obj_pos, obj_pos_offset); } else { |