com.jogamp.opengl.util
Class PMVMatrix

java.lang.Object
  extended by com.jogamp.opengl.util.PMVMatrix
All Implemented Interfaces:
GLMatrixFunc

public class PMVMatrix
extends Object
implements GLMatrixFunc


Field Summary
static int DIRTY_MODELVIEW
           
static int DIRTY_PROJECTION
           
static int DIRTY_TEXTURE
           
 
Fields inherited from interface javax.media.opengl.fixedfunc.GLMatrixFunc
GL_MATRIX_MODE, GL_MODELVIEW, GL_MODELVIEW_MATRIX, GL_PROJECTION, GL_PROJECTION_MATRIX, GL_TEXTURE_MATRIX
 
Constructor Summary
PMVMatrix()
          Creates an instance of PMVMatrix PMVMatrix(boolean useBackingArray), with useBackingArray = true.
PMVMatrix(boolean useBackingArray)
          Creates an instance of PMVMatrix.
 
Method Summary
 void destroy()
           
 int getDirtyBits()
           
 void glFrustumf(float left, float right, float bottom, float top, float zNear, float zFar)
           
 void glGetFloatv(int matrixGetName, float[] params, int params_offset)
           
 void glGetFloatv(int matrixGetName, FloatBuffer params)
          glGetFloatv
 void glGetIntegerv(int pname, int[] params, int params_offset)
           
 void glGetIntegerv(int pname, IntBuffer params)
          glGetIntegerv
 FloatBuffer glGetMatrixf()
           
 FloatBuffer glGetMatrixf(int matrixName)
           
 int glGetMatrixMode()
           
 FloatBuffer glGetMviMatrixf()
           
 FloatBuffer glGetMvitMatrixf()
           
 FloatBuffer glGetMvMatrixf()
           
 FloatBuffer glGetPMatrixf()
           
 FloatBuffer glGetPMvMatrixf()
           
 FloatBuffer glGetPMvMviMatrixf()
           
 FloatBuffer glGetPMvMvitMatrixf()
           
 FloatBuffer glGetTMatrixf()
           
 void glLoadIdentity()
           
 void glLoadMatrixf(float[] values, int offset)
           
 void glLoadMatrixf(FloatBuffer m)
          glLoadMatrixf
 void glMatrixMode(int matrixName)
          sets the current matrix
 void glMultMatrixf(float[] m, int m_offset)
           
 void glMultMatrixf(FloatBuffer m)
          glMultMatrixf
 void glOrthof(float left, float right, float bottom, float top, float zNear, float zFar)
           
 void glPopMatrix()
           
 void glPushMatrix()
           
 void glRotatef(float angdeg, float x, float y, float z)
           
 void glScalef(float x, float y, float z)
           
 void glTranslatef(float x, float y, float z)
           
 void gluLookAt(float eyex, float eyey, float eyez, float centerx, float centery, float centerz, float upx, float upy, float upz)
           
 void gluPerspective(float fovy, float aspect, float zNear, float zFar)
           
 void gluPickMatrix(float x, float y, float deltaX, float deltaY, int[] viewport, int viewport_offset)
           
 boolean gluProject(float objx, float objy, float objz, int[] viewport, int viewport_offset, float[] win_pos, int win_pos_offset)
          Uses this instance glGetMvMatrixf() and glGetPMatrixf()
 boolean gluUnProject(float winx, float winy, float winz, int[] viewport, int viewport_offset, float[] obj_pos, int obj_pos_offset)
          Uses this instance glGetMvMatrixf() and glGetPMatrixf()
 boolean isDirty()
           
 boolean isDirty(int matrixName)
           
static boolean isMatrixGetName(int matrixGetName)
           
static boolean isMatrixModeName(int matrixModeName)
           
static int matrixGetName2MatrixModeName(int matrixGetName)
           
static int matrixModeName2MatrixGetName(int matrixModeName)
           
 void setDirty()
           
 boolean update()
          Update the derived Mvi, Mvit and Pmv matrices in case Mv or P has changed.
 boolean usesBackingArray()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DIRTY_MODELVIEW

public static final int DIRTY_MODELVIEW
See Also:
Constant Field Values

DIRTY_PROJECTION

public static final int DIRTY_PROJECTION
See Also:
Constant Field Values

DIRTY_TEXTURE

public static final int DIRTY_TEXTURE
See Also:
Constant Field Values
Constructor Detail

PMVMatrix

public PMVMatrix()
Creates an instance of PMVMatrix PMVMatrix(boolean useBackingArray), with useBackingArray = true.


PMVMatrix

public PMVMatrix(boolean useBackingArray)
Creates an instance of PMVMatrix.

Parameters:
useBackingArray - true for non direct NIO Buffers with guaranteed backing array, which allows faster access in Java computation.

false for direct NIO buffers w/o a guaranteed backing array. In most Java implementations, direct NIO buffers have no backing array and hence the Java computation will be throttled down by direct IO get/put operations.

Depending on the application, ie. whether the Java computation or JNI invocation and hence native data transfer part is heavier, this flag shall be set to true or false

.
Method Detail

usesBackingArray

public final boolean usesBackingArray()

destroy

public void destroy()

isMatrixModeName

public static final boolean isMatrixModeName(int matrixModeName)

matrixModeName2MatrixGetName

public static final int matrixModeName2MatrixGetName(int matrixModeName)

isMatrixGetName

public static final boolean isMatrixGetName(int matrixGetName)

matrixGetName2MatrixModeName

public static final int matrixGetName2MatrixModeName(int matrixGetName)

setDirty

public void setDirty()

getDirtyBits

public int getDirtyBits()

isDirty

public boolean isDirty(int matrixName)

isDirty

public boolean isDirty()

update

public boolean update()
Update the derived Mvi, Mvit and Pmv matrices in case Mv or P has changed.

Returns:

glGetMatrixMode

public final int glGetMatrixMode()

glGetTMatrixf

public final FloatBuffer glGetTMatrixf()

glGetPMatrixf

public final FloatBuffer glGetPMatrixf()

glGetMvMatrixf

public final FloatBuffer glGetMvMatrixf()

glGetPMvMviMatrixf

public final FloatBuffer glGetPMvMviMatrixf()

glGetPMvMatrixf

public final FloatBuffer glGetPMvMatrixf()

glGetMviMatrixf

public final FloatBuffer glGetMviMatrixf()

glGetPMvMvitMatrixf

public final FloatBuffer glGetPMvMvitMatrixf()

glGetMvitMatrixf

public final FloatBuffer glGetMvitMatrixf()

glGetMatrixf

public final FloatBuffer glGetMatrixf()

glGetMatrixf

public final FloatBuffer glGetMatrixf(int matrixName)
Parameters:
matrixName - GL_MODELVIEW, GL_PROJECTION or GL.GL_TEXTURE
Returns:
the given matrix

glMatrixMode

public void glMatrixMode(int matrixName)
Description copied from interface: GLMatrixFunc
sets the current matrix

Specified by:
glMatrixMode in interface GLMatrixFunc

glGetFloatv

public void glGetFloatv(int matrixGetName,
                        FloatBuffer params)
Description copied from interface: GLMatrixFunc
glGetFloatv

Specified by:
glGetFloatv in interface GLMatrixFunc
Parameters:
matrixGetName - GL_MODELVIEW_MATRIX, GL_PROJECTION_MATRIX or GL_TEXTURE_MATRIX
params - the FloatBuffer's position remains unchanged, which is the same behavior than the native JOGL GL impl

glGetFloatv

public void glGetFloatv(int matrixGetName,
                        float[] params,
                        int params_offset)
Specified by:
glGetFloatv in interface GLMatrixFunc

glGetIntegerv

public void glGetIntegerv(int pname,
                          IntBuffer params)
Description copied from interface: GLMatrixFunc
glGetIntegerv

Specified by:
glGetIntegerv in interface GLMatrixFunc
Parameters:
pname - GL_MATRIX_MODE
params - the FloatBuffer's position remains unchanged which is the same behavior than the native JOGL GL impl

glGetIntegerv

public void glGetIntegerv(int pname,
                          int[] params,
                          int params_offset)
Specified by:
glGetIntegerv in interface GLMatrixFunc

glLoadMatrixf

public final void glLoadMatrixf(float[] values,
                                int offset)
Specified by:
glLoadMatrixf in interface GLMatrixFunc

glLoadMatrixf

public final void glLoadMatrixf(FloatBuffer m)
Description copied from interface: GLMatrixFunc
glLoadMatrixf

Specified by:
glLoadMatrixf in interface GLMatrixFunc

glPopMatrix

public final void glPopMatrix()
Specified by:
glPopMatrix in interface GLMatrixFunc

glPushMatrix

public final void glPushMatrix()
Specified by:
glPushMatrix in interface GLMatrixFunc

glLoadIdentity

public final void glLoadIdentity()
Specified by:
glLoadIdentity in interface GLMatrixFunc

glMultMatrixf

public final void glMultMatrixf(FloatBuffer m)
Description copied from interface: GLMatrixFunc
glMultMatrixf

Specified by:
glMultMatrixf in interface GLMatrixFunc
Parameters:
m - the FloatBuffer's position remains unchanged, which is the same behavior than the native JOGL GL impl

glMultMatrixf

public void glMultMatrixf(float[] m,
                          int m_offset)
Specified by:
glMultMatrixf in interface GLMatrixFunc

glTranslatef

public final void glTranslatef(float x,
                               float y,
                               float z)
Specified by:
glTranslatef in interface GLMatrixFunc

glRotatef

public final void glRotatef(float angdeg,
                            float x,
                            float y,
                            float z)
Specified by:
glRotatef in interface GLMatrixFunc

glScalef

public final void glScalef(float x,
                           float y,
                           float z)
Specified by:
glScalef in interface GLMatrixFunc

glOrthof

public final void glOrthof(float left,
                           float right,
                           float bottom,
                           float top,
                           float zNear,
                           float zFar)
Specified by:
glOrthof in interface GLMatrixFunc

gluPerspective

public final void gluPerspective(float fovy,
                                 float aspect,
                                 float zNear,
                                 float zFar)

glFrustumf

public final void glFrustumf(float left,
                             float right,
                             float bottom,
                             float top,
                             float zNear,
                             float zFar)
Specified by:
glFrustumf in interface GLMatrixFunc

gluLookAt

public void gluLookAt(float eyex,
                      float eyey,
                      float eyez,
                      float centerx,
                      float centery,
                      float centerz,
                      float upx,
                      float upy,
                      float upz)

gluProject

public boolean gluProject(float objx,
                          float objy,
                          float objz,
                          int[] viewport,
                          int viewport_offset,
                          float[] win_pos,
                          int win_pos_offset)
Uses this instance glGetMvMatrixf() and glGetPMatrixf()

Parameters:
objx -
objy -
objz -
viewport -
viewport_offset -
win_pos -
win_pos_offset -
Returns:

gluUnProject

public boolean gluUnProject(float winx,
                            float winy,
                            float winz,
                            int[] viewport,
                            int viewport_offset,
                            float[] obj_pos,
                            int obj_pos_offset)
Uses this instance glGetMvMatrixf() and glGetPMatrixf()

Parameters:
winx -
winy -
winz -
viewport -
viewport_offset -
obj_pos -
obj_pos_offset -
Returns:

gluPickMatrix

public void gluPickMatrix(float x,
                          float y,
                          float deltaX,
                          float deltaY,
                          int[] viewport,
                          int viewport_offset)


Copyright 2010 JogAmp Community.