|
JOGL v2.6.0-rc-20250706
JOGL, High-Performance Graphics Binding for Java (public API).
|
PMVMatrix4f implements the basic computer graphics Matrix4f pack using projection (P), modelview (Mv) and texture (T) Matrix4f operations.
More...
Public Member Functions | |
| PMVMatrix4f () | |
| Creates an instance of PMVMatrix4f. More... | |
| PMVMatrix4f (final int derivedMatrices) | |
| Creates an instance of PMVMatrix4f. More... | |
| void | reset () |
Issues Matrix4f#loadIdentity() on all matrices and resets all internal states. More... | |
| final Matrix4f | getT () |
Returns the texture matrix (T). More... | |
| final SyncMatrix4f | getSyncT () |
Returns the SyncMatrix of texture matrix (T). More... | |
| final Matrix4f | getP () |
Returns the projection matrix (P). More... | |
| final SyncMatrix4f | getSyncP () |
Returns the SyncMatrix of projection matrix (P). More... | |
| final Matrix4f | getMv () |
Returns the modelview matrix (Mv). More... | |
| final SyncMatrix4f | getSyncMv () |
Returns the SyncMatrix of modelview matrix (Mv). More... | |
| final SyncMatrices4f | getSyncPMv () |
Returns SyncMatrices4f of 2 matrices within one FloatBuffer: P and Mv. More... | |
| final Matrix4f | getMvi () |
Returns the inverse modelview matrix (Mvi) if requested. More... | |
| final SyncMatrix4f | getSyncMvi () |
Returns the SyncMatrix of inverse modelview matrix (Mvi) if requested. More... | |
| final Matrix4f | getMvit () |
Returns the inverse transposed modelview matrix (Mvit) if requested. More... | |
| final SyncMatrix4f | getSyncMvit () |
Returns the SyncMatrix of inverse transposed modelview matrix (Mvit) if requested. More... | |
| final SyncMatrices4f | getSyncPMvMvi () |
Returns SyncMatrices4f of 3 matrices within one FloatBuffer: P, Mv and Mvi if requested. More... | |
| final SyncMatrices4f | getSyncPMvMviMvit () |
Returns SyncMatrices4f of 4 matrices within one FloatBuffer: P, Mv, Mvi and Mvit if requested. More... | |
| final Matrix4f | getMulPMv (final Matrix4f result) |
Returns multiplication result of P and Mv matrix, i.e. More... | |
| final Matrix4f | getMulMvP (final Matrix4f result) |
Returns multiplication result of Mv and P matrix, i.e. More... | |
| final Vec4f | mulWithMv (final Vec4f v_in, final Vec4f v_out) |
| v_out = Mv * v_in More... | |
| final Vec4f | mulWithMv (final Vec4f v_inout) |
| v_inout = Mv * v_inout More... | |
| final Vec3f | mulWithMv (final Vec3f v_in, final Vec3f v_out) |
| v_out = Mv * v_in More... | |
| final PMVMatrix4f | loadMv (final float[] values, final int offset) |
Load the modelview matrix with the provided values. More... | |
| final PMVMatrix4f | loadMv (final java.nio.FloatBuffer m) |
Load the modelview matrix with the provided values. More... | |
| final PMVMatrix4f | loadMv (final Matrix4f m) |
Load the modelview matrix with the values of the given Matrix4f. More... | |
| final PMVMatrix4f | loadMv (final Quaternion quat) |
Load the modelview matrix with the values of the given Quaternion's rotation matrix representation. More... | |
| final PMVMatrix4f | loadP (final float[] values, final int offset) |
Load the projection matrix with the provided values. More... | |
| final PMVMatrix4f | loadP (final java.nio.FloatBuffer m) |
Load the projection matrix with the provided values. More... | |
| final PMVMatrix4f | loadP (final Matrix4f m) |
Load the projection matrix with the values of the given Matrix4f. More... | |
| final PMVMatrix4f | loadP (final Quaternion quat) |
Load the projection matrix with the values of the given Quaternion's rotation matrix representation. More... | |
| final PMVMatrix4f | loadT (final float[] values, final int offset) |
Load the texture matrix with the provided values. More... | |
| final PMVMatrix4f | loadT (final java.nio.FloatBuffer m) |
Load the texture matrix with the provided values. More... | |
| final PMVMatrix4f | loadT (final Matrix4f m) |
Load the texture matrix with the values of the given Matrix4f. More... | |
| final PMVMatrix4f | loadT (final Quaternion quat) |
Load the texture matrix with the values of the given Quaternion's rotation matrix representation. More... | |
| final PMVMatrix4f | loadMvIdentity () |
Load the modelview matrix with the values of the given Matrix4f. More... | |
| final PMVMatrix4f | loadPIdentity () |
Load the projection matrix with the values of the given Matrix4f. More... | |
| final PMVMatrix4f | loadTIdentity () |
Load the texture matrix with the values of the given Matrix4f. More... | |
| final PMVMatrix4f | mulMv (final Matrix4f m) |
Multiply the modelview matrix: [c] = [c] x [m]. More... | |
| final PMVMatrix4f | mulP (final Matrix4f m) |
Multiply the projection matrix: [c] = [c] x [m]. More... | |
| final PMVMatrix4f | mulT (final Matrix4f m) |
Multiply the texture matrix: [c] = [c] x [m]. More... | |
| final PMVMatrix4f | translateMv (final float x, final float y, final float z) |
Translate the modelview matrix. More... | |
| final PMVMatrix4f | translateMv (final Vec3f t) |
Translate the modelview matrix. More... | |
| final PMVMatrix4f | translateP (final float x, final float y, final float z) |
Translate the projection matrix. More... | |
| final PMVMatrix4f | translateP (final Vec3f t) |
Translate the projection matrix. More... | |
| final PMVMatrix4f | scaleMv (final float x, final float y, final float z) |
Scale the modelview matrix. More... | |
| final PMVMatrix4f | scaleMv (final Vec3f s) |
Scale the modelview matrix. More... | |
| final PMVMatrix4f | scaleP (final float x, final float y, final float z) |
Scale the projection matrix. More... | |
| final PMVMatrix4f | scaleP (final Vec3f s) |
Scale the projection matrix. More... | |
| final PMVMatrix4f | rotateMv (final float ang_rad, final float x, final float y, final float z) |
Rotate the modelview matrix by the given axis and angle in radians. More... | |
| final PMVMatrix4f | rotateMv (final float ang_rad, final Vec3f axis) |
Rotate the modelview matrix by the given axis and angle in radians. More... | |
| final PMVMatrix4f | rotateMv (final Quaternion quat) |
Rotate the modelview matrix with the given Quaternion's rotation matrix representation. More... | |
| final PMVMatrix4f | rotateP (final float ang_rad, final float x, final float y, final float z) |
Rotate the projection matrix by the given axis and angle in radians. More... | |
| final PMVMatrix4f | rotateP (final float ang_rad, final Vec3f axis) |
Rotate the projection matrix by the given axis and angle in radians. More... | |
| final PMVMatrix4f | rotateP (final Quaternion quat) |
Rotate the projection matrix with the given Quaternion's rotation matrix representation. More... | |
| final PMVMatrix4f | popMv () |
Pop the modelview matrix from its stack. More... | |
| final PMVMatrix4f | popP () |
Pop the projection matrix from its stack. More... | |
| final PMVMatrix4f | popT () |
Pop the texture matrix from its stack. More... | |
| final PMVMatrix4f | pushMv () |
Push the modelview matrix to its stack, while preserving its values. More... | |
| final PMVMatrix4f | pushP () |
Push the projection matrix to its stack, while preserving its values. More... | |
| final PMVMatrix4f | pushT () |
Push the texture matrix to its stack, while preserving its values. More... | |
| final void | orthoP (final float left, final float right, final float bottom, final float top, final float zNear, final float zFar) |
Multiply the projection matrix with the orthogonal matrix. More... | |
| final void | frustumP (final float left, final float right, final float bottom, final float top, final float zNear, final float zFar) throws IllegalArgumentException |
Multiply the projection matrix with the frustum matrix. More... | |
| final PMVMatrix4f | perspectiveP (final float fovy_rad, final float aspect, final float zNear, final float zFar) throws IllegalArgumentException |
Multiply the projection matrix with the perspective/frustum matrix. More... | |
| final PMVMatrix4f | lookAtP (final Vec3f eye, final Vec3f center, final Vec3f up) |
Multiply the projection matrix with the eye, object and orientation, i.e. More... | |
| final boolean | mapObjToWin (final Vec3f objPos, final Recti viewport, final Vec3f winPos) |
| Map object coordinates to window coordinates. More... | |
| final boolean | mapWinToObj (final float winx, final float winy, final float winz, final Recti viewport, final Vec3f objPos) |
| Map window coordinates to object coordinates. More... | |
| boolean | mapWinToObj4 (final float winx, final float winy, final float winz, final float clipw, final Recti viewport, final float near, final float far, final Vec4f objPos) |
| Map window coordinates to object coordinates. More... | |
| final boolean | mapWinToRay (final float winx, final float winy, final float winz0, final float winz1, final Recti viewport, final Ray ray) |
Map two window coordinates w/ shared X/Y and distinctive Z to a Ray. More... | |
| StringBuilder | toString (StringBuilder sb, final String f) |
| String | toString () |
| final int | getModifiedBits (final boolean clear) |
| Returns the modified bits due to mutable operations. More... | |
| final int | getDirtyBits () |
| Returns the dirty bits due to mutable operations, i.e. More... | |
| final boolean | isReqDirty () |
Returns true if the one of the requested bits are are set dirty due to mutable operations, i.e. More... | |
| final void | setModelviewDirty () |
Sets the Modelview (Mv) matrix dirty and modified, i.e. More... | |
| final void | setProjectionDirty () |
Sets the Projection (P) matrix dirty and modified, i.e. More... | |
| final void | setTextureDirty () |
Sets the Texture (T) matrix modified. More... | |
| final int | getReqBits () |
| Returns the request bit mask, which uses bit values equal to the dirty mask and may contain. More... | |
| final Matrix4f | getPMv () |
| Returns the pre-multiplied projection x modelview, P x Mv. More... | |
| final Matrix4f | getPMvi () |
Returns the pre-multiplied inverse projection x modelview, if Matrix4f#invert(Matrix4f) succeeded, otherwise null. More... | |
| final Frustum | getFrustum () |
| Returns the frustum, derived from projection x modelview. More... | |
| final boolean | update () |
Update the derived inverse modelview (Mvi), inverse transposed modelview (Mvit) matrices if they are dirty and requested via the constructor PMVMatrix4f(int). More... | |
Static Public Attributes | |
| static final int | MODIFIED_PROJECTION = 1 << 0 |
Bit value stating a modified projection matrix (P), since last update() call. More... | |
| static final int | MODIFIED_MODELVIEW = 1 << 1 |
Bit value stating a modified modelview matrix (Mv), since last update() call. More... | |
| static final int | MODIFIED_TEXTURE = 1 << 2 |
Bit value stating a modified texture matrix (T), since last update() call. More... | |
| static final int | MODIFIED_ALL = MODIFIED_PROJECTION | MODIFIED_MODELVIEW | MODIFIED_TEXTURE |
| Bit value stating all is modified. More... | |
| static final int | INVERSE_MODELVIEW = 1 << 1 |
Bit value for inverse modelview matrix (Mvi), updated via update(). More... | |
| static final int | INVERSE_TRANSPOSED_MODELVIEW = 1 << 2 |
Bit value for inverse transposed modelview matrix (Mvit), updated via update(). More... | |
| static final int | FRUSTUM = 1 << 3 |
Bit value for frustum and updated by getFrustum(). More... | |
| static final int | PREMUL_PMV = 1 << 4 |
Bit value for pre-multiplied P * Mv, updated by getPMv(). More... | |
| static final int | PREMUL_PMVI = 1 << 5 |
Bit value for pre-multiplied invert(P * Mv), updated by getPMvi(). More... | |
| static final int | MANUAL_BITS = FRUSTUM | PREMUL_PMV | PREMUL_PMVI |
Manual bits not covered by update() but getFrustum(), FRUSTUM, getPMv(), PREMUL_PMV, getPMvi(), PREMUL_PMVI, etc. More... | |
Protected Member Functions | |
| final Matrix4f | getTmp2Mat () |
| Return the second temporary Matrix4f exposed to be reused for efficiency. More... | |
Protected Attributes | |
| final Matrix4f | matP |
| final Matrix4f | matMv |
| final Matrix4f | matTex |
| final Matrix4f | mat4Tmp1 |
PMVMatrix4f implements the basic computer graphics Matrix4f pack using projection (P), modelview (Mv) and texture (T) Matrix4f operations.
Unlike PMVMatrix, this class doesn't implement GLMatrixFunc and is OpenGL agnostic.
This is the second implementation of PMVMatrix4f using direct Matrix4f, Vec4f and Vec3f math operations instead of float[] via FloatUtil.
PMVMatrix4f provides the inverse modelview matrix (Mvi) and inverse transposed modelview matrix (Mvit). Frustum is also provided by getFrustum().
To keep these derived values synchronized after mutable Mv operations like rotateMv(Quaternion) users have to call update() before using Mvi and Mvit.
All matrices are provided in column-major order, as specified in the OpenGL fixed function pipeline, i.e. compatibility profile. See Matrix4f.
PMVMatrix4f can supplement GL2ES2 applications w/ the lack of the described matrix functionality.
The SyncBuffer abstraction is provided, e.g. getSyncPMvMvi(), to synchronize the respective matrices with the float[] backing store. The latter is represents the data to com.jogamp.opengl.GLUniformData via its FloatBuffers, see SyncBuffer#getBuffer(), and is pushed to the GPU eventually.
SyncBuffer's SyncAction is called by com.jogamp.opengl.GLUniformData#getBuffer(), i.e. before the data is pushed to the GPU.
The provided SyncAction ensures that the matrices data gets copied into the float[] backing store.
PMVMatrix4f provides two specializations of SyncBuffer, SyncMatrix4f for single Matrix4f mappings and SyncMatrices4f for multiple Matrix4f mappings.
They can be feed directly to instantiate a com.jogamp.opengl.GLUniformData object via e.g. com.jogamp.opengl.GLUniformData#GLUniformData(String, int, int, SyncBuffer).
All matrix SyncBuffer's backing store are backed up by a common primitive float-array for performance considerations and are a sliced representation of it.
Matrix4f SyncBuffer's Backing-Store Notes:
matrix SyncBuffer's backing store is a sliced part of a host matrix and it's start position has been marked. reset() to rewind it to it's start position after relative operations, like get(). get(int), use it's reset position as it's offset. Definition at line 108 of file PMVMatrix4f.java.
| com.jogamp.math.util.PMVMatrix4f.PMVMatrix4f | ( | ) |
Creates an instance of PMVMatrix4f.
This constructor only sets up an instance w/o additional INVERSE_MODELVIEW or INVERSE_TRANSPOSED_MODELVIEW.
Implementation uses non-direct non-NIO Buffers with guaranteed backing array, which are synchronized to the actual Matrix4f instances. This allows faster access in Java computation.
Definition at line 143 of file PMVMatrix4f.java.
| com.jogamp.math.util.PMVMatrix4f.PMVMatrix4f | ( | final int | derivedMatrices | ) |
Creates an instance of PMVMatrix4f.
Additional derived matrices can be requested via derivedMatrices, i.e.
Implementation uses non-direct non-NIO Buffers with guaranteed backing array, which are synchronized to the actual Matrix4f instances. This allows faster access in Java computation.
| derivedMatrices | additional matrices can be requested by passing bits INVERSE_MODELVIEW and INVERSE_TRANSPOSED_MODELVIEW. |
Definition at line 165 of file PMVMatrix4f.java.
| final void com.jogamp.math.util.PMVMatrix4f.frustumP | ( | final float | left, |
| final float | right, | ||
| final float | bottom, | ||
| final float | top, | ||
| final float | zNear, | ||
| final float | zFar | ||
| ) | throws IllegalArgumentException |
Multiply the projection matrix with the frustum matrix.
| IllegalArgumentException | if zNear <= 0 or zFar <= zNear or left == right, or bottom == top. |
Definition at line 885 of file PMVMatrix4f.java.
| final int com.jogamp.math.util.PMVMatrix4f.getDirtyBits | ( | ) |
Returns the dirty bits due to mutable operations, i.e.
INVERSE_MODELVIEW (if requested)INVERSE_TRANSPOSED_MODELVIEW (if requested)FRUSTUM (always, cleared via getFrustum() A dirty bit is set, if the corresponding matrix had been modified by a mutable operation since last update() call and requested in the constructor PMVMatrix4f(int).
update() clears the dirty state for the matrices and getFrustum() for FRUSTUM.
Definition at line 1117 of file PMVMatrix4f.java.
| final Frustum com.jogamp.math.util.PMVMatrix4f.getFrustum | ( | ) |
Returns the frustum, derived from projection x modelview.
This Frustum instance should be re-fetched via this method and not locally stored to have it updated from a potential modification of underlying projection and/or modelview matrix. update() has no effect on this Frustum.
The Frustum is considered dirty, if its corresponding P matrix or Mv matrix has been modified since its last update.
Definition at line 1257 of file PMVMatrix4f.java.
| final int com.jogamp.math.util.PMVMatrix4f.getModifiedBits | ( | final boolean | clear | ) |
Returns the modified bits due to mutable operations.
A modified bit is set, if the corresponding matrix had been modified by a mutable operation since last update() or getModifiedBits(true) call.
| clear | if true, clears the modified bits, otherwise leaves them untouched. |
Definition at line 1084 of file PMVMatrix4f.java.
Returns multiplication result of Mv and P matrix, i.e.
result = Mv x P
| result | 4x4 matrix storage for result |
Definition at line 479 of file PMVMatrix4f.java.
Returns multiplication result of P and Mv matrix, i.e.
result = P x Mv
| result | 4x4 matrix storage for result |
Definition at line 467 of file PMVMatrix4f.java.
| final Matrix4f com.jogamp.math.util.PMVMatrix4f.getMv | ( | ) |
Returns the modelview matrix (Mv).
Consider using setModelviewDirty() if modifying the returned Matrix4f.
Definition at line 345 of file PMVMatrix4f.java.
| final Matrix4f com.jogamp.math.util.PMVMatrix4f.getMvi | ( | ) |
Returns the inverse modelview matrix (Mvi) if requested.
| IllegalArgumentException | if INVERSE_MODELVIEW has not been requested in ctor PMVMatrix4f(int). |
Definition at line 376 of file PMVMatrix4f.java.
| final Matrix4f com.jogamp.math.util.PMVMatrix4f.getMvit | ( | ) |
Returns the inverse transposed modelview matrix (Mvit) if requested.
| IllegalArgumentException | if INVERSE_TRANSPOSED_MODELVIEW has not been requested in ctor PMVMatrix4f(int). |
Definition at line 405 of file PMVMatrix4f.java.
| final Matrix4f com.jogamp.math.util.PMVMatrix4f.getP | ( | ) |
Returns the projection matrix (P).
Consider using setProjectionDirty() if modifying the returned Matrix4f.
Definition at line 322 of file PMVMatrix4f.java.
| final Matrix4f com.jogamp.math.util.PMVMatrix4f.getPMv | ( | ) |
Returns the pre-multiplied projection x modelview, P x Mv.
This Matrix4f instance should be re-fetched via this method and not locally stored to have it updated from a potential modification of underlying projection and/or modelview matrix. update() has no effect on this Matrix4f.
This pre-multipled P x Mv is considered dirty, if its corresponding P matrix or Mv matrix has been modified since its last update.
Definition at line 1207 of file PMVMatrix4f.java.
| final Matrix4f com.jogamp.math.util.PMVMatrix4f.getPMvi | ( | ) |
Returns the pre-multiplied inverse projection x modelview, if Matrix4f#invert(Matrix4f) succeeded, otherwise null.
This Matrix4f instance should be re-fetched via this method and not locally stored to have it updated from a potential modification of underlying projection and/or modelview matrix. update() has no effect on this Matrix4f.
This pre-multipled invert(P x Mv) is considered dirty, if its corresponding P matrix or Mv matrix has been modified since its last update.
Definition at line 1232 of file PMVMatrix4f.java.
| final int com.jogamp.math.util.PMVMatrix4f.getReqBits | ( | ) |
Returns the request bit mask, which uses bit values equal to the dirty mask and may contain.
The request bit mask is set by in the constructor PMVMatrix4f(int).
Definition at line 1190 of file PMVMatrix4f.java.
| final SyncMatrix4f com.jogamp.math.util.PMVMatrix4f.getSyncMv | ( | ) |
Returns the SyncMatrix of modelview matrix (Mv).
Definition at line 355 of file PMVMatrix4f.java.
| final SyncMatrix4f com.jogamp.math.util.PMVMatrix4f.getSyncMvi | ( | ) |
Returns the SyncMatrix of inverse modelview matrix (Mvi) if requested.
| IllegalArgumentException | if INVERSE_MODELVIEW has not been requested in ctor PMVMatrix4f(int). |
Definition at line 391 of file PMVMatrix4f.java.
| final SyncMatrix4f com.jogamp.math.util.PMVMatrix4f.getSyncMvit | ( | ) |
Returns the SyncMatrix of inverse transposed modelview matrix (Mvit) if requested.
| IllegalArgumentException | if INVERSE_TRANSPOSED_MODELVIEW has not been requested in ctor PMVMatrix4f(int). |
Definition at line 420 of file PMVMatrix4f.java.
| final SyncMatrix4f com.jogamp.math.util.PMVMatrix4f.getSyncP | ( | ) |
Returns the SyncMatrix of projection matrix (P).
Definition at line 332 of file PMVMatrix4f.java.
| final SyncMatrices4f com.jogamp.math.util.PMVMatrix4f.getSyncPMv | ( | ) |
Returns SyncMatrices4f of 2 matrices within one FloatBuffer: P and Mv.
Definition at line 365 of file PMVMatrix4f.java.
| final SyncMatrices4f com.jogamp.math.util.PMVMatrix4f.getSyncPMvMvi | ( | ) |
Returns SyncMatrices4f of 3 matrices within one FloatBuffer: P, Mv and Mvi if requested.
| IllegalArgumentException | if INVERSE_MODELVIEW has not been requested in ctor PMVMatrix4f(int). |
Definition at line 434 of file PMVMatrix4f.java.
| final SyncMatrices4f com.jogamp.math.util.PMVMatrix4f.getSyncPMvMviMvit | ( | ) |
Returns SyncMatrices4f of 4 matrices within one FloatBuffer: P, Mv, Mvi and Mvit if requested.
| IllegalArgumentException | if INVERSE_TRANSPOSED_MODELVIEW has not been requested in ctor PMVMatrix4f(int). |
Definition at line 448 of file PMVMatrix4f.java.
| final SyncMatrix4f com.jogamp.math.util.PMVMatrix4f.getSyncT | ( | ) |
Returns the SyncMatrix of texture matrix (T).
Definition at line 309 of file PMVMatrix4f.java.
| final Matrix4f com.jogamp.math.util.PMVMatrix4f.getT | ( | ) |
Returns the texture matrix (T).
Consider using setTextureDirty() if modifying the returned Matrix4f.
Definition at line 299 of file PMVMatrix4f.java.
|
protected |
Return the second temporary Matrix4f exposed to be reused for efficiency.
Temporary storage is only used by this class within single method calls, hence has no side-effects.
Definition at line 279 of file PMVMatrix4f.java.
| final boolean com.jogamp.math.util.PMVMatrix4f.isReqDirty | ( | ) |
Returns true if the one of the requested bits are are set dirty due to mutable operations, i.e.
at least one of
A dirty bit is set, if the corresponding matrix had been modified by a mutable operation since last update() call and requested in the constructor PMVMatrix4f(int).
update() clears the dirty state for the matrices and getFrustum() for FRUSTUM.
Definition at line 1142 of file PMVMatrix4f.java.
| final PMVMatrix4f com.jogamp.math.util.PMVMatrix4f.loadMv | ( | final float[] | values, |
| final int | offset | ||
| ) |
Load the modelview matrix with the provided values.
Definition at line 522 of file PMVMatrix4f.java.
| final PMVMatrix4f com.jogamp.math.util.PMVMatrix4f.loadMv | ( | final java.nio.FloatBuffer | m | ) |
Load the modelview matrix with the provided values.
Definition at line 530 of file PMVMatrix4f.java.
| final PMVMatrix4f com.jogamp.math.util.PMVMatrix4f.loadMv | ( | final Matrix4f | m | ) |
Load the modelview matrix with the values of the given Matrix4f.
Definition at line 540 of file PMVMatrix4f.java.
| final PMVMatrix4f com.jogamp.math.util.PMVMatrix4f.loadMv | ( | final Quaternion | quat | ) |
Load the modelview matrix with the values of the given Quaternion's rotation matrix representation.
Definition at line 548 of file PMVMatrix4f.java.
| final PMVMatrix4f com.jogamp.math.util.PMVMatrix4f.loadMvIdentity | ( | ) |
Load the modelview matrix with the values of the given Matrix4f.
Definition at line 627 of file PMVMatrix4f.java.
| final PMVMatrix4f com.jogamp.math.util.PMVMatrix4f.loadP | ( | final float[] | values, |
| final int | offset | ||
| ) |
Load the projection matrix with the provided values.
Definition at line 557 of file PMVMatrix4f.java.
| final PMVMatrix4f com.jogamp.math.util.PMVMatrix4f.loadP | ( | final java.nio.FloatBuffer | m | ) |
Load the projection matrix with the provided values.
Definition at line 565 of file PMVMatrix4f.java.
| final PMVMatrix4f com.jogamp.math.util.PMVMatrix4f.loadP | ( | final Matrix4f | m | ) |
Load the projection matrix with the values of the given Matrix4f.
Definition at line 575 of file PMVMatrix4f.java.
| final PMVMatrix4f com.jogamp.math.util.PMVMatrix4f.loadP | ( | final Quaternion | quat | ) |
Load the projection matrix with the values of the given Quaternion's rotation matrix representation.
Definition at line 583 of file PMVMatrix4f.java.
| final PMVMatrix4f com.jogamp.math.util.PMVMatrix4f.loadPIdentity | ( | ) |
Load the projection matrix with the values of the given Matrix4f.
Definition at line 636 of file PMVMatrix4f.java.
| final PMVMatrix4f com.jogamp.math.util.PMVMatrix4f.loadT | ( | final float[] | values, |
| final int | offset | ||
| ) |
Load the texture matrix with the provided values.
Definition at line 592 of file PMVMatrix4f.java.
| final PMVMatrix4f com.jogamp.math.util.PMVMatrix4f.loadT | ( | final java.nio.FloatBuffer | m | ) |
Load the texture matrix with the provided values.
Definition at line 600 of file PMVMatrix4f.java.
| final PMVMatrix4f com.jogamp.math.util.PMVMatrix4f.loadT | ( | final Matrix4f | m | ) |
Load the texture matrix with the values of the given Matrix4f.
Definition at line 610 of file PMVMatrix4f.java.
| final PMVMatrix4f com.jogamp.math.util.PMVMatrix4f.loadT | ( | final Quaternion | quat | ) |
Load the texture matrix with the values of the given Quaternion's rotation matrix representation.
Definition at line 618 of file PMVMatrix4f.java.
| final PMVMatrix4f com.jogamp.math.util.PMVMatrix4f.loadTIdentity | ( | ) |
Load the texture matrix with the values of the given Matrix4f.
Definition at line 645 of file PMVMatrix4f.java.
| final PMVMatrix4f com.jogamp.math.util.PMVMatrix4f.lookAtP | ( | final Vec3f | eye, |
| final Vec3f | center, | ||
| final Vec3f | up | ||
| ) |
Multiply the projection matrix with the eye, object and orientation, i.e.
Matrix4f#setToLookAt(Vec3f, Vec3f, Vec3f, Matrix4f).
Definition at line 912 of file PMVMatrix4f.java.
| final boolean com.jogamp.math.util.PMVMatrix4f.mapObjToWin | ( | final Vec3f | objPos, |
| final Recti | viewport, | ||
| final Vec3f | winPos | ||
| ) |
Map object coordinates to window coordinates.
Traditional gluProject implementation.
| objPos | 3 component object coordinate |
| viewport | Rect4i viewport |
| winPos | 3 component window coordinate, the result |
Definition at line 928 of file PMVMatrix4f.java.
| final boolean com.jogamp.math.util.PMVMatrix4f.mapWinToObj | ( | final float | winx, |
| final float | winy, | ||
| final float | winz, | ||
| final Recti | viewport, | ||
| final Vec3f | objPos | ||
| ) |
Map window coordinates to object coordinates.
Traditional gluUnProject implementation.
| winx | |
| winy | |
| winz | |
| viewport | Rect4i viewport |
| objPos | 3 component object coordinate, the result |
Definition at line 945 of file PMVMatrix4f.java.
| boolean com.jogamp.math.util.PMVMatrix4f.mapWinToObj4 | ( | final float | winx, |
| final float | winy, | ||
| final float | winz, | ||
| final float | clipw, | ||
| final Recti | viewport, | ||
| final float | near, | ||
| final float | far, | ||
| final Vec4f | objPos | ||
| ) |
Map window coordinates to object coordinates.
Traditional gluUnProject4 implementation.
| winx | |
| winy | |
| winz | |
| clipw | |
| viewport | Rect4i viewport |
| near | |
| far | |
| objPos | 4 component object coordinate, the result |
Definition at line 970 of file PMVMatrix4f.java.
| final boolean com.jogamp.math.util.PMVMatrix4f.mapWinToRay | ( | final float | winx, |
| final float | winy, | ||
| final float | winz0, | ||
| final float | winz1, | ||
| final Recti | viewport, | ||
| final Ray | ray | ||
| ) |
Map two window coordinates w/ shared X/Y and distinctive Z to a Ray.
The resulting Ray maybe used for picking using a bounding box.
Notes for picking winz0 and winz1:
FloatUtil#getZBufferEpsilon(int, float, float) FloatUtil#getZBufferValue(int, float, float, float) FloatUtil#getOrthoWinZ(float, float, float) | winx | |
| winy | |
| winz0 | |
| winz1 | |
| viewport | |
| ray | storage for the resulting Ray |
Definition at line 999 of file PMVMatrix4f.java.
| final PMVMatrix4f com.jogamp.math.util.PMVMatrix4f.mulMv | ( | final Matrix4f | m | ) |
Multiply the modelview matrix: [c] = [c] x [m].
| m | the right hand Matrix4f |
Definition at line 656 of file PMVMatrix4f.java.
| final PMVMatrix4f com.jogamp.math.util.PMVMatrix4f.mulP | ( | final Matrix4f | m | ) |
Multiply the projection matrix: [c] = [c] x [m].
| m | the right hand Matrix4f |
Definition at line 667 of file PMVMatrix4f.java.
| final PMVMatrix4f com.jogamp.math.util.PMVMatrix4f.mulT | ( | final Matrix4f | m | ) |
Multiply the texture matrix: [c] = [c] x [m].
| m | the right hand Matrix4f |
Definition at line 678 of file PMVMatrix4f.java.
v_out = Mv * v_in
Affine 3f-vector transformation by 4x4 matrix, see Matrix4f#mulVec3f(Vec3f, Vec3f).
| v_in | input vector, can be v_out for in-place transformation |
| v_out | output vector |
Definition at line 511 of file PMVMatrix4f.java.
v_out = Mv * v_in
| v_in | input vector, can be v_out for in-place transformation |
| v_out | output vector |
Definition at line 489 of file PMVMatrix4f.java.
v_inout = Mv * v_inout
| v_inout | input and output vector, i.e. in-place transformation |
Definition at line 498 of file PMVMatrix4f.java.
| final void com.jogamp.math.util.PMVMatrix4f.orthoP | ( | final float | left, |
| final float | right, | ||
| final float | bottom, | ||
| final float | top, | ||
| final float | zNear, | ||
| final float | zFar | ||
| ) |
Multiply the projection matrix with the orthogonal matrix.
| left | |
| right | |
| bottom | |
| top | |
| zNear | |
| zFar |
Definition at line 874 of file PMVMatrix4f.java.
| final PMVMatrix4f com.jogamp.math.util.PMVMatrix4f.perspectiveP | ( | final float | fovy_rad, |
| final float | aspect, | ||
| final float | zNear, | ||
| final float | zFar | ||
| ) | throws IllegalArgumentException |
Multiply the projection matrix with the perspective/frustum matrix.
| fovy_rad | fov angle in radians |
| aspect | aspect ratio width / height |
| zNear | |
| zFar |
| IllegalArgumentException | if zNear <= 0 or zFar <= zNear |
Definition at line 903 of file PMVMatrix4f.java.
| final PMVMatrix4f com.jogamp.math.util.PMVMatrix4f.popMv | ( | ) |
Pop the modelview matrix from its stack.
Definition at line 831 of file PMVMatrix4f.java.
| final PMVMatrix4f com.jogamp.math.util.PMVMatrix4f.popP | ( | ) |
Pop the projection matrix from its stack.
Definition at line 837 of file PMVMatrix4f.java.
| final PMVMatrix4f com.jogamp.math.util.PMVMatrix4f.popT | ( | ) |
Pop the texture matrix from its stack.
Definition at line 843 of file PMVMatrix4f.java.
| final PMVMatrix4f com.jogamp.math.util.PMVMatrix4f.pushMv | ( | ) |
Push the modelview matrix to its stack, while preserving its values.
Definition at line 849 of file PMVMatrix4f.java.
| final PMVMatrix4f com.jogamp.math.util.PMVMatrix4f.pushP | ( | ) |
Push the projection matrix to its stack, while preserving its values.
Definition at line 854 of file PMVMatrix4f.java.
| final PMVMatrix4f com.jogamp.math.util.PMVMatrix4f.pushT | ( | ) |
Push the texture matrix to its stack, while preserving its values.
Definition at line 859 of file PMVMatrix4f.java.
| void com.jogamp.math.util.PMVMatrix4f.reset | ( | ) |
Issues Matrix4f#loadIdentity() on all matrices and resets all internal states.
Reimplemented in com.jogamp.opengl.util.PMVMatrix.
Definition at line 258 of file PMVMatrix4f.java.
| final PMVMatrix4f com.jogamp.math.util.PMVMatrix4f.rotateMv | ( | final float | ang_rad, |
| final float | x, | ||
| final float | y, | ||
| final float | z | ||
| ) |
Rotate the modelview matrix by the given axis and angle in radians.
Consider using rotateMv(Quaternion)
| ang_rad | angle in radians |
| axis | rotation axis |
Definition at line 770 of file PMVMatrix4f.java.
| final PMVMatrix4f com.jogamp.math.util.PMVMatrix4f.rotateMv | ( | final float | ang_rad, |
| final Vec3f | axis | ||
| ) |
Rotate the modelview matrix by the given axis and angle in radians.
Consider using rotateMv(Quaternion)
| ang_rad | angle in radians |
| axis | rotation axis |
Definition at line 783 of file PMVMatrix4f.java.
| final PMVMatrix4f com.jogamp.math.util.PMVMatrix4f.rotateMv | ( | final Quaternion | quat | ) |
Rotate the modelview matrix with the given Quaternion's rotation matrix representation.
| quat | the Quaternion |
Definition at line 791 of file PMVMatrix4f.java.
| final PMVMatrix4f com.jogamp.math.util.PMVMatrix4f.rotateP | ( | final float | ang_rad, |
| final float | x, | ||
| final float | y, | ||
| final float | z | ||
| ) |
Rotate the projection matrix by the given axis and angle in radians.
Consider using rotateP(Quaternion)
| ang_rad | angle in radians |
| axis | rotation axis |
Definition at line 805 of file PMVMatrix4f.java.
| final PMVMatrix4f com.jogamp.math.util.PMVMatrix4f.rotateP | ( | final float | ang_rad, |
| final Vec3f | axis | ||
| ) |
Rotate the projection matrix by the given axis and angle in radians.
Consider using rotateP(Quaternion)
| ang_rad | angle in radians |
| axis | rotation axis |
Definition at line 818 of file PMVMatrix4f.java.
| final PMVMatrix4f com.jogamp.math.util.PMVMatrix4f.rotateP | ( | final Quaternion | quat | ) |
Rotate the projection matrix with the given Quaternion's rotation matrix representation.
| quat | the Quaternion |
Definition at line 826 of file PMVMatrix4f.java.
| final PMVMatrix4f com.jogamp.math.util.PMVMatrix4f.scaleMv | ( | final float | x, |
| final float | y, | ||
| final float | z | ||
| ) |
Scale the modelview matrix.
| x | |
| y | |
| z |
Definition at line 729 of file PMVMatrix4f.java.
| final PMVMatrix4f com.jogamp.math.util.PMVMatrix4f.scaleMv | ( | final Vec3f | s | ) |
Scale the modelview matrix.
| s | scale vec4f |
Definition at line 737 of file PMVMatrix4f.java.
| final PMVMatrix4f com.jogamp.math.util.PMVMatrix4f.scaleP | ( | final float | x, |
| final float | y, | ||
| final float | z | ||
| ) |
Scale the projection matrix.
| x | |
| y | |
| z |
Definition at line 748 of file PMVMatrix4f.java.
| final PMVMatrix4f com.jogamp.math.util.PMVMatrix4f.scaleP | ( | final Vec3f | s | ) |
Scale the projection matrix.
| s | scale vec4f |
Definition at line 756 of file PMVMatrix4f.java.
| final void com.jogamp.math.util.PMVMatrix4f.setModelviewDirty | ( | ) |
Sets the Modelview (Mv) matrix dirty and modified, i.e.
adds requested bits and MANUAL_BITS to dirty bits.
Definition at line 1151 of file PMVMatrix4f.java.
| final void com.jogamp.math.util.PMVMatrix4f.setProjectionDirty | ( | ) |
Sets the Projection (P) matrix dirty and modified, i.e.
adds MANUAL_BITS to dirty bits.
Definition at line 1160 of file PMVMatrix4f.java.
| final void com.jogamp.math.util.PMVMatrix4f.setTextureDirty | ( | ) |
Sets the Texture (T) matrix modified.
Definition at line 1168 of file PMVMatrix4f.java.
| String com.jogamp.math.util.PMVMatrix4f.toString | ( | ) |
Definition at line 1066 of file PMVMatrix4f.java.
| StringBuilder com.jogamp.math.util.PMVMatrix4f.toString | ( | StringBuilder | sb, |
| final String | f | ||
| ) |
Definition at line 1004 of file PMVMatrix4f.java.
| final PMVMatrix4f com.jogamp.math.util.PMVMatrix4f.translateMv | ( | final float | x, |
| final float | y, | ||
| final float | z | ||
| ) |
Translate the modelview matrix.
| x | |
| y | |
| z |
Definition at line 691 of file PMVMatrix4f.java.
| final PMVMatrix4f com.jogamp.math.util.PMVMatrix4f.translateMv | ( | final Vec3f | t | ) |
Translate the modelview matrix.
| t | translation vec3 |
Definition at line 699 of file PMVMatrix4f.java.
| final PMVMatrix4f com.jogamp.math.util.PMVMatrix4f.translateP | ( | final float | x, |
| final float | y, | ||
| final float | z | ||
| ) |
Translate the projection matrix.
| x | |
| y | |
| z |
Definition at line 710 of file PMVMatrix4f.java.
| final PMVMatrix4f com.jogamp.math.util.PMVMatrix4f.translateP | ( | final Vec3f | t | ) |
Translate the projection matrix.
| t | translation vec3 |
Definition at line 718 of file PMVMatrix4f.java.
| final boolean com.jogamp.math.util.PMVMatrix4f.update | ( | ) |
Update the derived inverse modelview (Mvi), inverse transposed modelview (Mvit) matrices if they are dirty and requested via the constructor PMVMatrix4f(int).
Hence updates the following dirty bits.
The Frustum is updated only via getFrustum() separately.
The Mvi and Mvit matrices are considered dirty, if their corresponding Mv matrix has been modified since their last update.
Method is automatically called by SyncMatrix4f and SyncMatrices4f instances SyncAction as retrieved by e.g. getSyncMvit(). This ensures an automatic update cycle if used with com.jogamp.opengl.GLUniformData.
Method may be called manually in case mutable operations has been called and caller operates on already fetched references, i.e. not calling getMvi(), getMvit() anymore.
Method clears the modified bits like getModifiedBits(true), which are set by any mutable operation. The modified bits have no impact on this method, but the return value.
Definition at line 1314 of file PMVMatrix4f.java.
|
static |
Bit value for frustum and updated by getFrustum().
Definition at line 123 of file PMVMatrix4f.java.
|
static |
Bit value for inverse modelview matrix (Mvi), updated via update().
Definition at line 119 of file PMVMatrix4f.java.
|
static |
Bit value for inverse transposed modelview matrix (Mvit), updated via update().
Definition at line 121 of file PMVMatrix4f.java.
|
static |
Manual bits not covered by update() but getFrustum(), FRUSTUM, getPMv(), PREMUL_PMV, getPMvi(), PREMUL_PMVI, etc.
Definition at line 129 of file PMVMatrix4f.java.
|
protected |
Definition at line 1361 of file PMVMatrix4f.java.
|
protected |
Definition at line 1343 of file PMVMatrix4f.java.
|
protected |
Definition at line 1342 of file PMVMatrix4f.java.
|
protected |
Definition at line 1344 of file PMVMatrix4f.java.
|
static |
Bit value stating all is modified.
Definition at line 117 of file PMVMatrix4f.java.
|
static |
Bit value stating a modified modelview matrix (Mv), since last update() call.
Definition at line 113 of file PMVMatrix4f.java.
|
static |
Bit value stating a modified projection matrix (P), since last update() call.
Definition at line 111 of file PMVMatrix4f.java.
|
static |
Bit value stating a modified texture matrix (T), since last update() call.
Definition at line 115 of file PMVMatrix4f.java.
|
static |
Bit value for pre-multiplied P * Mv, updated by getPMv().
Definition at line 125 of file PMVMatrix4f.java.
|
static |
Bit value for pre-multiplied invert(P * Mv), updated by getPMvi().
Definition at line 127 of file PMVMatrix4f.java.