|
JOGL v2.6.0-rc-20250712
JOGL, High-Performance Graphics Binding for Java (public API).
|
Basic 4x4 float matrix implementation using fields for intensive use-cases (host operations). More...
Public Member Functions | |
| Matrix4fb () | |
| Creates a new identity matrix. More... | |
| Matrix4fb (final Matrix4fb src) | |
Creates a new matrix copying the values of the given src matrix. More... | |
| Matrix4fb (final float[] m) | |
| Creates a new matrix based on given float[4*4] column major order. More... | |
| Matrix4fb (final float[] m, final int m_off) | |
| Creates a new matrix based on given float[4*4] column major order. More... | |
| final Matrix4fb | loadIdentity () |
| Set this matrix to identity. More... | |
| Matrix4fb | load (final Matrix4fb src) |
Load the values of the given matrix b to this matrix. More... | |
| Matrix4fb | load (final float[] src) |
Load the values of the given matrix src to this matrix. More... | |
| Matrix4fb | load (final float[] src, final int src_off) |
Load the values of the given matrix src to this matrix. More... | |
| Matrix4fb | load (final FloatBuffer src) |
Load the values of the given matrix src to this matrix. More... | |
| float | get (final int i) |
| Gets the ith component, 0 <= i < 16. More... | |
| Vec4f | getColumn (final int column, final Vec4f v_out) |
| Get the named column of the given column-major matrix to v_out. More... | |
| Vec3f | getColumn (final int column, final Vec3f v_out) |
| Get the named column of the given column-major matrix to v_out. More... | |
| Vec4f | getRow (final int row, final Vec4f v_out) |
| Get the named row of the given column-major matrix to v_out. More... | |
| Vec3f | getRow (final int row, final Vec3f v_out) |
| Get the named row of the given column-major matrix to v_out. More... | |
| float[] | get (final float[] dst, final int dst_off) |
Get this matrix into the given float[16] array at dst_off in column major order. More... | |
| float[] | get (final float[] dst) |
| Get this matrix into the given float[16] array in column major order. More... | |
| FloatBuffer | get (final FloatBuffer dst) |
Get this matrix into the given FloatBuffer in column major order. More... | |
| float | determinant () |
| Returns the determinant of this matrix. More... | |
| final Matrix4fb | transpose () |
| Transpose this matrix. More... | |
| final Matrix4fb | transpose (final Matrix4fb src) |
Transpose the given src matrix into this matrix. More... | |
| boolean | invert () |
| Invert this matrix. More... | |
| boolean | invert (final Matrix4fb src) |
Invert the src matrix values into this matrix. More... | |
| final Matrix4fb | mul (final Matrix4fb b) |
| Multiply matrix: [this] = [this] x [b]. More... | |
| final Matrix4fb | mul (final Matrix4fb a, final Matrix4fb b) |
| Multiply matrix: [this] = [a] x [b]. More... | |
| final float[] | mulVec4f (final float[] v_in, final float[] v_out) |
| final Vec4f | mulVec4f (final Vec4f v_in, final Vec4f v_out) |
| final float[] | mulVec3f (final float[] v_in, final float[] v_out) |
| Affine 3f-vector transformation by 4x4 matrix. More... | |
| final Vec3f | mulVec3f (final Vec3f v_in, final Vec3f v_out) |
| Affine 3f-vector transformation by 4x4 matrix. More... | |
| final Matrix4fb | setToTranslation (final float x, final float y, final float z) |
| Set this matrix to translation. More... | |
| final Matrix4fb | setToTranslation (final Vec3f t) |
| Set this matrix to translation. More... | |
| final Matrix4fb | setToScale (final float x, final float y, final float z) |
| Set this matrix to scale. More... | |
| final Matrix4fb | setToRotationAxis (final float ang_rad, float x, float y, float z) |
| Set this matrix to rotation from the given axis and angle in radians. More... | |
| final Matrix4fb | setToRotationAxis (final float ang_rad, final Vec3f axis) |
| Set this matrix to rotation from the given axis and angle in radians. More... | |
| Matrix4fb | setToRotationEuler (final float bankX, final float headingY, final float attitudeZ) |
| Set this matrix to rotation from the given Euler rotation angles in radians. More... | |
| final Matrix4fb | setToRotation (final Quaternion q) |
| Set this matrix to rotation using the given Quaternion. More... | |
| final Quaternion | getRotation (final Quaternion res) |
| Returns the rotation [m[0+0*4] . More... | |
| Matrix4fb | setToOrtho (final float left, final float right, final float bottom, final float top, final float zNear, final float zFar) |
| Set this matrix to orthogonal projection. More... | |
| Matrix4fb | setToFrustum (final float left, final float right, final float bottom, final float top, final float zNear, final float zFar) throws IllegalArgumentException |
| Set this matrix to frustum. More... | |
| Matrix4fb | setToPerspective (final float fovy_rad, final float aspect, final float zNear, final float zFar) throws IllegalArgumentException |
Set this matrix to perspective frustum projection. More... | |
| Matrix4fb | setToPerspective (final FovHVHalves fovhv, final float zNear, final float zFar) throws IllegalArgumentException |
Set this matrix to perspective frustum projection. More... | |
| void | updateFrustumPlanes (final Frustum frustum) |
| Calculate the frustum planes in world coordinates using the passed float[16] as premultiplied P*MV (column major order). More... | |
| Matrix4fb | setToLookAt (final Vec3f eye, final Vec3f center, final Vec3f up, final Matrix4fb tmp) |
| Make given matrix the look-at matrix based on given parameters. More... | |
| final Matrix4fb | rotate (final float ang_rad, final float x, final float y, final float z, final Matrix4fb tmp) |
| Rotate this matrix about give axis and angle in radians, i.e. More... | |
| final Matrix4fb | rotate (final float ang_rad, final Vec3f axis, final Matrix4fb tmp) |
| Rotate this matrix about give axis and angle in radians, i.e. More... | |
| final Matrix4fb | rotate (final Quaternion quat, final Matrix4fb tmp) |
Rotate this matrix with the given Quaternion, i.e. More... | |
| final Matrix4fb | translate (final float x, final float y, final float z, final Matrix4fb tmp) |
| Translate this matrix, i.e. More... | |
| final Matrix4fb | translate (final Vec3f t, final Matrix4fb tmp) |
| Translate this matrix, i.e. More... | |
| final Matrix4fb | scale (final float x, final float y, final float z, final Matrix4fb tmp) |
| Scale this matrix, i.e. More... | |
| final Matrix4fb | scale (final float s, final Matrix4fb tmp) |
| Scale this matrix, i.e. More... | |
| final void | push () |
| Push the matrix to it's stack, while preserving this matrix values. More... | |
| final void | pop () |
| Pop the current matrix from it's stack, replacing this matrix values. More... | |
| boolean | isEqual (final Matrix4fb o, final float epsilon) |
Equals check using a given FloatUtil#EPSILON value and FloatUtil#isEqual(float, float, float). More... | |
| boolean | isEqual (final Matrix4fb o) |
Equals check using FloatUtil#EPSILON value and FloatUtil#isEqual(float, float, float). More... | |
| boolean | equals (final Object o) |
| StringBuilder | toString (final StringBuilder sb, final String rowPrefix, final String f) |
| String | toString () |
Static Public Member Functions | |
| static boolean | mapObjToWin (final Vec3f obj, final Matrix4fb mMv, final Matrix4fb mP, final int[] viewport, final float[] winPos) |
| Map object coordinates to window coordinates. More... | |
| static boolean | mapObjToWin (final Vec3f obj, final Matrix4fb mPMv, final int[] viewport, final float[] winPos) |
| Map object coordinates to window coordinates. More... | |
| static boolean | mapWinToObj (final float winx, final float winy, final float winz, final Matrix4fb mMv, final Matrix4fb mP, final int[] viewport, final Vec3f objPos, final Matrix4fb mat4Tmp) |
| Map window coordinates to object coordinates. More... | |
| static boolean | mapWinToObj (final float winx, final float winy, final float winz, final Matrix4fb invPMv, final int[] viewport, final Vec3f objPos, final Matrix4fb mat4Tmp) |
| Map window coordinates to object coordinates. More... | |
| static boolean | mapWinToObj (final float winx, final float winy, final float winz1, final float winz2, final Matrix4fb invPMv, final int[] viewport, final Vec3f objPos1, final Vec3f objPos2, final Matrix4fb mat4Tmp) |
| Map two window coordinates to two object coordinates, distinguished by their z component. More... | |
| static boolean | mapWinToObj4 (final float winx, final float winy, final float winz, final float clipw, final Matrix4fb mMv, final Matrix4fb mP, final int[] viewport, final float near, final float far, final Vec4f objPos, final Matrix4fb mat4Tmp) |
| Map window coordinates to object coordinates. More... | |
| static boolean | mapWinToRay (final float winx, final float winy, final float winz0, final float winz1, final Matrix4fb mMv, final Matrix4fb mP, final int[] viewport, final Ray ray, final Matrix4fb mat4Tmp1, final Matrix4fb mat4Tmp2) |
Map two window coordinates w/ shared X/Y and distinctive Z to a Ray. More... | |
Basic 4x4 float matrix implementation using fields for intensive use-cases (host operations).
Implementation covers FloatUtil matrix functionality, exposed in an object oriented manner.
Unlike PMVMatrix, this class only represents one single matrix without a complete GLMatrixFunc implementation.
For array operations the layout is expected in column-major order matching OpenGL's implementation, illustration:
Row-Major Column-Major (OpenGL):
| 0 1 2 tx |
| |
| 4 5 6 ty |
M = | |
| 8 9 10 tz |
| |
| 12 13 14 15 |
R C R C
m[0*4+3] = tx; m[0+4*3] = tx;
m[1*4+3] = ty; m[1+4*3] = ty;
m[2*4+3] = tz; m[2+4*3] = tz;
RC (std subscript order) RC (std subscript order)
m[0+3*4] = tx; m[0+3*4] = tx;
m[1+3*4] = ty; m[1+3*4] = ty;
m[2+3*4] = tz; m[2+3*4] = tz;
Implementation utilizes unrolling of small vertices and matrices wherever possible while trying to access memory in a linear fashion for performance reasons, see:
Definition at line 97 of file Matrix4fb.java.
| com.jogamp.opengl.test.junit.math.Matrix4fb.Matrix4fb | ( | ) |
Creates a new identity matrix.
Definition at line 102 of file Matrix4fb.java.
| com.jogamp.opengl.test.junit.math.Matrix4fb.Matrix4fb | ( | final Matrix4fb | src | ) |
Creates a new matrix copying the values of the given src matrix.
Definition at line 109 of file Matrix4fb.java.
| com.jogamp.opengl.test.junit.math.Matrix4fb.Matrix4fb | ( | final float[] | m | ) |
Creates a new matrix based on given float[4*4] column major order.
| m | 4x4 matrix in column-major order |
Definition at line 117 of file Matrix4fb.java.
| com.jogamp.opengl.test.junit.math.Matrix4fb.Matrix4fb | ( | final float[] | m, |
| final int | m_off | ||
| ) |
Creates a new matrix based on given float[4*4] column major order.
| m | 4x4 matrix in column-major order |
| m_off | offset for matrix m |
Definition at line 126 of file Matrix4fb.java.
| float com.jogamp.opengl.test.junit.math.Matrix4fb.determinant | ( | ) |
Returns the determinant of this matrix.
Definition at line 308 of file Matrix4fb.java.
| boolean com.jogamp.opengl.test.junit.math.Matrix4fb.equals | ( | final Object | o | ) |
| float[] com.jogamp.opengl.test.junit.math.Matrix4fb.get | ( | final float[] | dst | ) |
Get this matrix into the given float[16] array in column major order.
| dst | float[16] array storage in column major order |
dst for chaining Definition at line 280 of file Matrix4fb.java.
| float[] com.jogamp.opengl.test.junit.math.Matrix4fb.get | ( | final float[] | dst, |
| final int | dst_off | ||
| ) |
Get this matrix into the given float[16] array at dst_off in column major order.
| dst | float[16] array storage in column major order |
| dst_off | offset |
dst for chaining Definition at line 269 of file Matrix4fb.java.
| FloatBuffer com.jogamp.opengl.test.junit.math.Matrix4fb.get | ( | final FloatBuffer | dst | ) |
Get this matrix into the given FloatBuffer in column major order.
Implementation uses relative FloatBuffer#put(float), hence caller may want to issue FloatBuffer#reset() thereafter.
| dst | FloatBuffer array storage in column major order |
dst for chaining Definition at line 295 of file Matrix4fb.java.
| float com.jogamp.opengl.test.junit.math.Matrix4fb.get | ( | final int | i | ) |
Gets the ith component, 0 <= i < 16.
Definition at line 204 of file Matrix4fb.java.
Get the named column of the given column-major matrix to v_out.
| column | named column to copy |
| v_out | the column-vector storage |
Definition at line 228 of file Matrix4fb.java.
Get the named column of the given column-major matrix to v_out.
| column | named column to copy |
| v_out | the column-vector storage |
Definition at line 214 of file Matrix4fb.java.
| final Quaternion com.jogamp.opengl.test.junit.math.Matrix4fb.getRotation | ( | final Quaternion | res | ) |
Returns the rotation [m[0+0*4] .
. m[2+2*4]] fields converted to a Quaternion.
| res | resulting Quaternion |
Definition at line 1038 of file Matrix4fb.java.
Get the named row of the given column-major matrix to v_out.
| row | named row to copy |
| v_out | the row-vector storage |
Definition at line 255 of file Matrix4fb.java.
Get the named row of the given column-major matrix to v_out.
| row | named row to copy |
| v_out | the row-vector storage |
Definition at line 241 of file Matrix4fb.java.
| boolean com.jogamp.opengl.test.junit.math.Matrix4fb.invert | ( | ) |
Invert this matrix.
Definition at line 388 of file Matrix4fb.java.
| boolean com.jogamp.opengl.test.junit.math.Matrix4fb.invert | ( | final Matrix4fb | src | ) |
Invert the src matrix values into this matrix.
| src | the source matrix, which values are to be inverted |
src matrix is singular and inversion not possible, otherwise true Definition at line 476 of file Matrix4fb.java.
| boolean com.jogamp.opengl.test.junit.math.Matrix4fb.isEqual | ( | final Matrix4fb | o | ) |
Equals check using FloatUtil#EPSILON value and FloatUtil#isEqual(float, float, float).
Implementation considers following corner cases:
| o | comparison value |
FloatUtil#EPSILON, otherwise false. Definition at line 1470 of file Matrix4fb.java.
| boolean com.jogamp.opengl.test.junit.math.Matrix4fb.isEqual | ( | final Matrix4fb | o, |
| final float | epsilon | ||
| ) |
Equals check using a given FloatUtil#EPSILON value and FloatUtil#isEqual(float, float, float).
Implementation considers following corner cases:
| o | comparison value |
| epsilon | consider using FloatUtil#EPSILON |
epsilon, otherwise false. Definition at line 1445 of file Matrix4fb.java.
| Matrix4fb com.jogamp.opengl.test.junit.math.Matrix4fb.load | ( | final float[] | src | ) |
Load the values of the given matrix src to this matrix.
| src | 4x4 matrix float[16] in column-major order |
Definition at line 169 of file Matrix4fb.java.
| Matrix4fb com.jogamp.opengl.test.junit.math.Matrix4fb.load | ( | final float[] | src, |
| final int | src_off | ||
| ) |
Load the values of the given matrix src to this matrix.
| src | 4x4 matrix float[16] in column-major order |
| src_off | offset for matrix src |
Definition at line 180 of file Matrix4fb.java.
| Matrix4fb com.jogamp.opengl.test.junit.math.Matrix4fb.load | ( | final FloatBuffer | src | ) |
Load the values of the given matrix src to this matrix.
Implementation uses relative FloatBuffer#get(), hence caller may want to issue FloatBuffer#reset() thereafter.
| src | 4x4 matrix FloatBuffer in column-major order |
Definition at line 194 of file Matrix4fb.java.
Load the values of the given matrix b to this matrix.
| src | the source values |
Definition at line 159 of file Matrix4fb.java.
| final Matrix4fb com.jogamp.opengl.test.junit.math.Matrix4fb.loadIdentity | ( | ) |
Set this matrix to identity.
Translation matrix (Column Order): 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1
Definition at line 145 of file Matrix4fb.java.
|
static |
Map object coordinates to window coordinates.
Traditional gluProject implementation.
| obj | object position, 3 component vector |
| mMv | modelview matrix |
| mP | projection matrix |
| viewport | 4 component viewport vector |
| winPos | 3 component window coordinate, the result |
Definition at line 1500 of file Matrix4fb.java.
|
static |
Map object coordinates to window coordinates.
Traditional gluProject implementation.
| obj | object position, 3 component vector |
| mPMv | [projection] x [modelview] matrix, i.e. P x Mv |
| viewport | 4 component viewport vector |
| winPos | 3 component window coordinate, the result |
Definition at line 1541 of file Matrix4fb.java.
|
static |
Map window coordinates to object coordinates.
Traditional gluUnProject implementation.
| winx | |
| winy | |
| winz | |
| invPMv | inverse [projection] x [modelview] matrix, i.e. Inv(P x Mv) |
| viewport | 4 component viewport vector |
| objPos | 3 component object coordinate, the result |
| mat4Tmp | 16 component matrix for temp storage |
Definition at line 1628 of file Matrix4fb.java.
|
static |
Map window coordinates to object coordinates.
Traditional gluUnProject implementation.
| winx | |
| winy | |
| winz | |
| mMv | 4x4 modelview matrix |
| mP | 4x4 projection matrix |
| viewport | 4 component viewport vector |
| objPos | 3 component object coordinate, the result |
| mat4Tmp | 16 component matrix for temp storage |
Definition at line 1582 of file Matrix4fb.java.
|
static |
Map two window coordinates to two object coordinates, distinguished by their z component.
Traditional gluUnProject implementation.
| winx | |
| winy | |
| winz1 | |
| winz2 | |
| invPMv | inverse [projection] x [modelview] matrix, i.e. Inv(P x Mv) |
| viewport | 4 component viewport vector |
| objPos1 | 3 component object coordinate, the result |
| mat4Tmp | 16 component matrix for temp storage |
Definition at line 1670 of file Matrix4fb.java.
|
static |
Map window coordinates to object coordinates.
Traditional gluUnProject4 implementation.
| winx | |
| winy | |
| winz | |
| clipw | |
| mMv | 4x4 modelview matrix |
| mP | 4x4 projection matrix |
| viewport | 4 component viewport vector |
| near | |
| far | |
| obj_pos | 4 component object coordinate, the result |
| mat4Tmp | 16 component matrix for temp storage |
Definition at line 1728 of file Matrix4fb.java.
|
static |
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 | |
| mMv | 4x4 modelview matrix |
| mP | 4x4 projection matrix |
| viewport | 4 component viewport vector |
| ray | storage for the resulting Ray |
| mat4Tmp1 | 16 component matrix for temp storage |
| mat4Tmp2 | 16 component matrix for temp storage |
Definition at line 1782 of file Matrix4fb.java.
| final Matrix4fb com.jogamp.opengl.test.junit.math.Matrix4fb.mul | ( | final Matrix4fb | a, |
| final Matrix4fb | b | ||
| ) |
Multiply matrix: [this] = [a] x [b].
Roughly 13% faster than mul(Matrix4fb) Roughly 11% faster than FloatUtil#multMatrix(float[], float[])
| a | 4x4 matrix |
| b | 4x4 matrix |
Definition at line 636 of file Matrix4fb.java.
Multiply matrix: [this] = [this] x [b].
Roughly 15% slower than mul(Matrix4fb, Matrix4fb) Roughly 3% slower than FloatUtil#multMatrix(float[], float[])
| b | 4x4 matrix |
Definition at line 569 of file Matrix4fb.java.
| final float[] com.jogamp.opengl.test.junit.math.Matrix4fb.mulVec3f | ( | final float[] | v_in, |
| final float[] | v_out | ||
| ) |
Affine 3f-vector transformation by 4x4 matrix.
4x4 matrix multiplication with 3-component vector, using 1 for for v_in[3] and dropping v_out[3], which shall be 1.
| v_in | 3-component column-vector |
| v_out | m_in * v_in, 3-component column-vector |
Definition at line 733 of file Matrix4fb.java.
| final Vec3f com.jogamp.opengl.test.junit.math.Matrix4fb.mulVec3f | ( | final Vec3f | v_in, |
| final Vec3f | v_out | ||
| ) |
Affine 3f-vector transformation by 4x4 matrix.
4x4 matrix multiplication with 3-component vector, using 1 for for v_in.w() and dropping v_out.w(), which shall be 1.
Definition at line 753 of file Matrix4fb.java.
| final float[] com.jogamp.opengl.test.junit.math.Matrix4fb.mulVec4f | ( | final float[] | v_in, |
| final float[] | v_out | ||
| ) |
| v_in | 4-component column-vector |
| v_out | this * v_in |
Definition at line 697 of file Matrix4fb.java.
| final Vec4f com.jogamp.opengl.test.junit.math.Matrix4fb.mulVec4f | ( | final Vec4f | v_in, |
| final Vec4f | v_out | ||
| ) |
| v_in | 4-component column-vector |
| v_out | this * v_in |
Definition at line 712 of file Matrix4fb.java.
| final void com.jogamp.opengl.test.junit.math.Matrix4fb.pop | ( | ) |
Pop the current matrix from it's stack, replacing this matrix values.
Definition at line 1424 of file Matrix4fb.java.
| final void com.jogamp.opengl.test.junit.math.Matrix4fb.push | ( | ) |
Push the matrix to it's stack, while preserving this matrix values.
Definition at line 1416 of file Matrix4fb.java.
| final Matrix4fb com.jogamp.opengl.test.junit.math.Matrix4fb.rotate | ( | final float | ang_rad, |
| final float | x, | ||
| final float | y, | ||
| final float | z, | ||
| final Matrix4fb | tmp | ||
| ) |
Rotate this matrix about give axis and angle in radians, i.e.
multiply by axis-rotation matrix.
| angrad | angle in radians |
| x | x of rotation axis |
| y | y of rotation axis |
| z | z of rotation axis |
| tmp | temporary Matrix4f used for multiplication |
Definition at line 1339 of file Matrix4fb.java.
| final Matrix4fb com.jogamp.opengl.test.junit.math.Matrix4fb.rotate | ( | final float | ang_rad, |
| final Vec3f | axis, | ||
| final Matrix4fb | tmp | ||
| ) |
Rotate this matrix about give axis and angle in radians, i.e.
multiply by axis-rotation matrix.
| angrad | angle in radians |
| axis | rotation axis |
| tmp | temporary Matrix4f used for multiplication |
Definition at line 1351 of file Matrix4fb.java.
| final Matrix4fb com.jogamp.opengl.test.junit.math.Matrix4fb.rotate | ( | final Quaternion | quat, |
| final Matrix4fb | tmp | ||
| ) |
Rotate this matrix with the given Quaternion, i.e.
multiply by Quaternion's rotation matrix.
| tmp | temporary Matrix4f used for multiplication |
Definition at line 1360 of file Matrix4fb.java.
| final Matrix4fb com.jogamp.opengl.test.junit.math.Matrix4fb.scale | ( | final float | s, |
| final Matrix4fb | tmp | ||
| ) |
Scale this matrix, i.e.
multiply by scale matrix.
| s | scale for x-, y- and z-axis |
| tmp | temporary Matrix4f used for multiplication |
Definition at line 1404 of file Matrix4fb.java.
| final Matrix4fb com.jogamp.opengl.test.junit.math.Matrix4fb.scale | ( | final float | x, |
| final float | y, | ||
| final float | z, | ||
| final Matrix4fb | tmp | ||
| ) |
Scale this matrix, i.e.
multiply by scale matrix.
| x | x scale |
| y | y scale |
| z | z scale |
| tmp | temporary Matrix4f used for multiplication |
Definition at line 1394 of file Matrix4fb.java.
| Matrix4fb com.jogamp.opengl.test.junit.math.Matrix4fb.setToFrustum | ( | final float | left, |
| final float | right, | ||
| final float | bottom, | ||
| final float | top, | ||
| final float | zNear, | ||
| final float | zFar | ||
| ) | throws IllegalArgumentException |
Set this matrix to frustum.
Frustum matrix (Column Order): 2*zNear/dx 0 0 0 0 2*zNear/dy 0 0 A B C -1 0 0 D 0
| left | |
| right | |
| bottom | |
| top | |
| zNear | |
| zFar |
| IllegalArgumentException | if zNear <= 0 or zFar <= zNear or left == right, or bottom == top. |
Definition at line 1108 of file Matrix4fb.java.
| Matrix4fb com.jogamp.opengl.test.junit.math.Matrix4fb.setToLookAt | ( | final Vec3f | eye, |
| final Vec3f | center, | ||
| final Vec3f | up, | ||
| final Matrix4fb | tmp | ||
| ) |
Make given matrix the look-at matrix based on given parameters.
Consist out of two matrix multiplications:
R = L x T,
with L for look-at matrix and
T for eye translation.
Result R can be utilized for projection or modelview multiplication, i.e.
M = M x R,
with M being the projection or modelview matrix.
| eye | 3 component eye vector |
| center | 3 component center vector |
| up | 3 component up vector |
| tmp | temporary Matrix4f used for multiplication |
Definition at line 1290 of file Matrix4fb.java.
| Matrix4fb com.jogamp.opengl.test.junit.math.Matrix4fb.setToOrtho | ( | final float | left, |
| final float | right, | ||
| final float | bottom, | ||
| final float | top, | ||
| final float | zNear, | ||
| final float | zFar | ||
| ) |
Set this matrix to orthogonal projection.
Ortho matrix (Column Order): 2/dx 0 0 0 0 2/dy 0 0 0 0 2/dz 0 tx ty tz 1
| left | |
| right | |
| bottom | |
| top | |
| zNear | |
| zFar |
Definition at line 1060 of file Matrix4fb.java.
| Matrix4fb com.jogamp.opengl.test.junit.math.Matrix4fb.setToPerspective | ( | final float | fovy_rad, |
| final float | aspect, | ||
| final float | zNear, | ||
| final float | zFar | ||
| ) | throws IllegalArgumentException |
Set this matrix to perspective frustum projection.
| fovy_rad | angle in radians |
| aspect | aspect ratio width / height |
| zNear | |
| zFar |
| IllegalArgumentException | if zNear <= 0 or zFar <= zNear |
Definition at line 1157 of file Matrix4fb.java.
| Matrix4fb com.jogamp.opengl.test.junit.math.Matrix4fb.setToPerspective | ( | final FovHVHalves | fovhv, |
| final float | zNear, | ||
| final float | zFar | ||
| ) | throws IllegalArgumentException |
Set this matrix to perspective frustum projection.
| fovhv | FovHVHalves field of view in both directions, may not be centered, either in radians or tangent |
| zNear | |
| zFar |
| IllegalArgumentException | if zNear <= 0 or zFar <= zNear |
Definition at line 1176 of file Matrix4fb.java.
| final Matrix4fb com.jogamp.opengl.test.junit.math.Matrix4fb.setToRotation | ( | final Quaternion | q | ) |
Set this matrix to rotation using the given Quaternion.
Implementation Details:
magnitudeSquared() is is zero using epsilon | q | the Quaternion representing the rotation |
Definition at line 977 of file Matrix4fb.java.
| final Matrix4fb com.jogamp.opengl.test.junit.math.Matrix4fb.setToRotationAxis | ( | final float | ang_rad, |
| final Vec3f | axis | ||
| ) |
Set this matrix to rotation from the given axis and angle in radians.
Rotation matrix (Column Order): xx(1-c)+c xy(1-c)+zs xz(1-c)-ys 0 xy(1-c)-zs yy(1-c)+c yz(1-c)+xs 0 xz(1-c)+ys yz(1-c)-xs zz(1-c)+c 0 0 0 0 1
| ang_rad | angle in radians |
| axis | rotation axis |
Definition at line 902 of file Matrix4fb.java.
| final Matrix4fb com.jogamp.opengl.test.junit.math.Matrix4fb.setToRotationAxis | ( | final float | ang_rad, |
| float | x, | ||
| float | y, | ||
| float | z | ||
| ) |
Set this matrix to rotation from the given axis and angle in radians.
Rotation matrix (Column Order): xx(1-c)+c xy(1-c)+zs xz(1-c)-ys 0 xy(1-c)-zs yy(1-c)+c yz(1-c)+xs 0 xz(1-c)+ys yz(1-c)-xs zz(1-c)+c 0 0 0 0 1
| ang_rad | angle in radians |
| x | x of rotation axis |
| y | y of rotation axis |
| z | z of rotation axis |
Definition at line 850 of file Matrix4fb.java.
| Matrix4fb com.jogamp.opengl.test.junit.math.Matrix4fb.setToRotationEuler | ( | final float | bankX, |
| final float | headingY, | ||
| final float | attitudeZ | ||
| ) |
Set this matrix to rotation from the given Euler rotation angles in radians.
The rotations are applied in the given order:
| bankX | the Euler pitch angle in radians. (rotation about the X axis) |
| headingY | the Euler yaw angle in radians. (rotation about the Y axis) |
| attitudeZ | the Euler roll angle in radians. (rotation about the Z axis) |
Implementation does not use Quaternion and hence is exposed to Gimbal-Lock, consider using setToRotation(Quaternion).
Definition at line 929 of file Matrix4fb.java.
| final Matrix4fb com.jogamp.opengl.test.junit.math.Matrix4fb.setToScale | ( | final float | x, |
| final float | y, | ||
| final float | z | ||
| ) |
Set this matrix to scale.
Scale matrix (Any Order): x 0 0 0 0 y 0 0 0 0 z 0 0 0 0 1
| x | x-axis scale |
| y | y-axis scale |
| z | z-axis scale |
Definition at line 822 of file Matrix4fb.java.
| final Matrix4fb com.jogamp.opengl.test.junit.math.Matrix4fb.setToTranslation | ( | final float | x, |
| final float | y, | ||
| final float | z | ||
| ) |
Set this matrix to translation.
Translation matrix (Column Order): 1 0 0 0 0 1 0 0 0 0 1 0 x y z 1
| x | x-axis translate |
| y | y-axis translate |
| z | z-axis translate |
Definition at line 780 of file Matrix4fb.java.
Set this matrix to translation.
Translation matrix (Column Order): 1 0 0 0 0 1 0 0 0 0 1 0 x y z 1
| t | translate Vec3f |
Definition at line 804 of file Matrix4fb.java.
| String com.jogamp.opengl.test.junit.math.Matrix4fb.toString | ( | ) |
Definition at line 1820 of file Matrix4fb.java.
| StringBuilder com.jogamp.opengl.test.junit.math.Matrix4fb.toString | ( | final StringBuilder | sb, |
| final String | rowPrefix, | ||
| final String | f | ||
| ) |
| sb | optional passed StringBuilder instance to be used |
| rowPrefix | optional prefix for each row |
| f | the format string of one floating point, i.e. "%10.5f", see java.util.Formatter |
Definition at line 1813 of file Matrix4fb.java.
| final Matrix4fb com.jogamp.opengl.test.junit.math.Matrix4fb.translate | ( | final float | x, |
| final float | y, | ||
| final float | z, | ||
| final Matrix4fb | tmp | ||
| ) |
Translate this matrix, i.e.
multiply by translation matrix.
| x | x translation |
| y | y translation |
| z | z translation |
| tmp | temporary Matrix4f used for multiplication |
Definition at line 1372 of file Matrix4fb.java.
| final Matrix4fb com.jogamp.opengl.test.junit.math.Matrix4fb.translate | ( | final Vec3f | t, |
| final Matrix4fb | tmp | ||
| ) |
Translate this matrix, i.e.
multiply by translation matrix.
| t | translation Vec3f |
| tmp | temporary Matrix4f used for multiplication |
Definition at line 1382 of file Matrix4fb.java.
| final Matrix4fb com.jogamp.opengl.test.junit.math.Matrix4fb.transpose | ( | ) |
Transpose this matrix.
Definition at line 322 of file Matrix4fb.java.
Transpose the given src matrix into this matrix.
| src | source 4x4 matrix |
Definition at line 358 of file Matrix4fb.java.
| void com.jogamp.opengl.test.junit.math.Matrix4fb.updateFrustumPlanes | ( | final Frustum | frustum | ) |
Calculate the frustum planes in world coordinates using the passed float[16] as premultiplied P*MV (column major order).
Frustum plane's normals will point to the inside of the viewing frustum, as required by this class.
Definition at line 1193 of file Matrix4fb.java.