|
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 | |
| Matrix4f () | |
| Creates a new identity matrix. More... | |
| Matrix4f (final Matrix4f src) | |
Creates a new matrix copying the values of the given src matrix. More... | |
| Matrix4f (final float[] m) | |
| Creates a new matrix based on given float[4*4] column major order. More... | |
| Matrix4f (final float[] m, final int m_off) | |
| Creates a new matrix based on given float[4*4] column major order. More... | |
| Matrix4f (final FloatBuffer m) | |
Creates a new matrix based on given FloatBuffer 4x4 column major order. More... | |
| void | set (final int i, final float v) |
Sets the ith component with float v 0 <= i < 16. More... | |
| final Matrix4f | loadIdentity () |
| Set this matrix to identity. More... | |
| Matrix4f | load (final Matrix4f src) |
Load the values of the given matrix src to this matrix. More... | |
| Matrix4f | load (final float[] src) |
Load the values of the given matrix src to this matrix. More... | |
| Matrix4f | load (final float[] src, final int src_off) |
Load the values of the given matrix src to this matrix. More... | |
| Matrix4f | 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 Matrix4f | transpose () |
| Transpose this matrix. More... | |
| final Matrix4f | transpose (final Matrix4f src) |
Transpose the given src matrix into this matrix. More... | |
| boolean | invert () |
| Invert this matrix. More... | |
| boolean | invert (final Matrix4f src) |
Invert the src matrix values into this matrix. More... | |
| final Matrix4f | mul (final Matrix4f b) |
| Multiply matrix: [this] = [this] x [b]. More... | |
| final Matrix4f | mul (final Matrix4f a, final Matrix4f b) |
| Multiply matrix: [this] = [a] x [b]. More... | |
| final Vec4f | mulVec4f (final Vec4f v_in, final Vec4f v_out) |
| final Vec4f | mulVec4f (final Vec4f v_inout) |
| final Vec3f | mulVec3f (final Vec3f v_in, final Vec3f v_out) |
| Affine 3f-vector transformation by 4x4 matrix. More... | |
| final Vec3f | mulVec3f (final Vec3f v_inout) |
| Affine 3f-vector transformation by 4x4 matrix. More... | |
| final Matrix4f | setToTranslation (final float x, final float y, final float z) |
| Set this matrix to translation. More... | |
| final Matrix4f | setToTranslation (final Vec3f t) |
| Set this matrix to translation. More... | |
| final Matrix4f | setToScale (final float x, final float y, final float z) |
| Set this matrix to scale. More... | |
| final Matrix4f | setToScale (final Vec3f s) |
| Set this matrix to scale. More... | |
| final Matrix4f | 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 Matrix4f | setToRotationAxis (final float ang_rad, final Vec3f axis) |
| Set this matrix to rotation from the given axis and angle in radians. More... | |
| Matrix4f | setToRotationEuler (final float bankX, final float headingY, final float attitudeZ) |
| Set this matrix to rotation from the given Euler rotation angles in radians. More... | |
| Matrix4f | setToRotationEuler (final Vec3f angradXYZ) |
| Set this matrix to rotation from the given Euler rotation angles in radians. More... | |
| final Matrix4f | setToRotation (final Quaternion q) |
| Set this matrix to rotation using the given Quaternion. More... | |
| final Quaternion | getRotation (final Quaternion res) |
| Returns the rotation [m00 . More... | |
| Matrix4f | 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... | |
| Matrix4f | 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... | |
| Matrix4f | setToPerspective (final float fovy_rad, final float aspect, final float zNear, final float zFar) throws IllegalArgumentException |
Set this matrix to perspective frustum projection. More... | |
| Matrix4f | setToPerspective (final FovHVHalves fovhv, final float zNear, final float zFar) throws IllegalArgumentException |
Set this matrix to perspective frustum projection. More... | |
| Frustum | getFrustum (final Frustum frustum) |
| Calculate the frustum planes in world coordinates using this column major order matrix, usually a projection (P) or premultiplied P*MV matrix. More... | |
| Matrix4f | setToLookAt (final Vec3f eye, final Vec3f center, final Vec3f up, final Matrix4f tmp) |
| Set this matrix to the look-at matrix based on given parameters. More... | |
| Matrix4f | setToPick (final float x, final float y, final float deltaX, final float deltaY, final Recti viewport, final Matrix4f mat4Tmp) |
| Set this matrix to the pick matrix based on given parameters. More... | |
| final Matrix4f | rotate (final float ang_rad, final float x, final float y, final float z, final Matrix4f tmp) |
| Rotate this matrix about give axis and angle in radians, i.e. More... | |
| final Matrix4f | rotate (final float ang_rad, final Vec3f axis, final Matrix4f tmp) |
| Rotate this matrix about give axis and angle in radians, i.e. More... | |
| final Matrix4f | rotate (final Quaternion quat, final Matrix4f tmp) |
Rotate this matrix with the given Quaternion, i.e. More... | |
| final Matrix4f | translate (final float x, final float y, final float z, final Matrix4f tmp) |
| Translate this matrix, i.e. More... | |
| final Matrix4f | translate (final Vec3f t, final Matrix4f tmp) |
| Translate this matrix, i.e. More... | |
| final Matrix4f | scale (final float x, final float y, final float z, final Matrix4f tmp) |
| Scale this matrix, i.e. More... | |
| final Matrix4f | scale (final float s, final Matrix4f 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 Matrix4f o, final float epsilon) |
Equals check using a given FloatUtil#EPSILON value and FloatUtil#isEqual(float, float, float). More... | |
| boolean | isEqual (final Matrix4f 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 Matrix4f mMv, final Matrix4f mP, final Recti viewport, final Vec3f winPos) |
| Map object coordinates to window coordinates. More... | |
| static boolean | mapObjToWin (final Vec3f obj, final Matrix4f mPMv, final Recti viewport, final Vec3f winPos) |
| Map object coordinates to window coordinates. More... | |
| static boolean | mapWinToObj (final float winx, final float winy, final float winz, final Matrix4f mMv, final Matrix4f mP, final Recti viewport, final Vec3f objPos, final Matrix4f mat4Tmp) |
| Map window coordinates to object coordinates. More... | |
| static boolean | mapWinToObj (final float winx, final float winy, final float winz, final Matrix4f invPMv, final Recti viewport, final Vec3f objPos) |
| Map window coordinates to object coordinates. More... | |
| static boolean | mapWinToObj (final float winx, final float winy, final float winz1, final float winz2, final Matrix4f invPMv, final Recti viewport, final Vec3f objPos1, final Vec3f objPos2) |
| 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 Matrix4f mMv, final Matrix4f mP, final Recti viewport, final float near, final float far, final Vec4f objPos, final Matrix4f mat4Tmp) |
| Map window coordinates to object coordinates. More... | |
| static boolean | mapWinToObj4 (final float winx, final float winy, final float winz, final float clipw, final Matrix4f invPMv, final Recti viewport, final float near, final float far, final Vec4f objPos) |
| Map window coordinates to object coordinates. More... | |
| static boolean | mapWinToRay (final float winx, final float winy, final float winz0, final float winz1, final Matrix4f mMv, final Matrix4f mP, final Recti viewport, final Ray ray, final Matrix4f mat4Tmp1) |
Map two window coordinates w/ shared X/Y and distinctive Z to a Ray. More... | |
| static boolean | mapWinToRay (final float winx, final float winy, final float winz0, final float winz1, final Matrix4f invPMv, final Recti viewport, final Ray ray) |
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 PMVMatrix4f, this class only represents one single matrix.
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)
m03 = tx; m03 = tx;
m13 = ty; m13 = ty;
m23 = tz; m23 = 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 89 of file Matrix4f.java.
| com.jogamp.math.Matrix4f.Matrix4f | ( | ) |
Creates a new identity matrix.
Definition at line 94 of file Matrix4f.java.
| com.jogamp.math.Matrix4f.Matrix4f | ( | final Matrix4f | src | ) |
Creates a new matrix copying the values of the given src matrix.
Definition at line 102 of file Matrix4f.java.
| com.jogamp.math.Matrix4f.Matrix4f | ( | 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 110 of file Matrix4f.java.
| com.jogamp.math.Matrix4f.Matrix4f | ( | 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 119 of file Matrix4f.java.
| com.jogamp.math.Matrix4f.Matrix4f | ( | final FloatBuffer | m | ) |
Creates a new matrix based on given FloatBuffer 4x4 column major order.
| m | 4x4 matrix in column-major order |
Definition at line 127 of file Matrix4f.java.
| float com.jogamp.math.Matrix4f.determinant | ( | ) |
Returns the determinant of this matrix.
Definition at line 450 of file Matrix4f.java.
| boolean com.jogamp.math.Matrix4f.equals | ( | final Object | o | ) |
| float[] com.jogamp.math.Matrix4f.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 392 of file Matrix4f.java.
| float[] com.jogamp.math.Matrix4f.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 366 of file Matrix4f.java.
| FloatBuffer com.jogamp.math.Matrix4f.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 422 of file Matrix4f.java.
| float com.jogamp.math.Matrix4f.get | ( | final int | i | ) |
Gets the ith component, 0 <= i < 16.
Definition at line 279 of file Matrix4f.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 325 of file Matrix4f.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 311 of file Matrix4f.java.
Calculate the frustum planes in world coordinates using this column major order matrix, usually a projection (P) or premultiplied P*MV matrix.
Frustum plane's normals will point to the inside of the viewing frustum, as required by the Frustum class.
Definition at line 1340 of file Matrix4f.java.
| final Quaternion com.jogamp.math.Matrix4f.getRotation | ( | final Quaternion | res | ) |
Returns the rotation [m00 .
. m22] fields converted to a Quaternion.
| res | resulting Quaternion |
Definition at line 1185 of file Matrix4f.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 352 of file Matrix4f.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 338 of file Matrix4f.java.
| boolean com.jogamp.math.Matrix4f.invert | ( | ) |
Invert this matrix.
Definition at line 530 of file Matrix4f.java.
| boolean com.jogamp.math.Matrix4f.invert | ( | final Matrix4f | 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 610 of file Matrix4f.java.
| boolean com.jogamp.math.Matrix4f.isEqual | ( | final Matrix4f | 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 1666 of file Matrix4f.java.
| boolean com.jogamp.math.Matrix4f.isEqual | ( | final Matrix4f | 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 1631 of file Matrix4f.java.
| Matrix4f com.jogamp.math.Matrix4f.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 199 of file Matrix4f.java.
| Matrix4f com.jogamp.math.Matrix4f.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 225 of file Matrix4f.java.
| Matrix4f com.jogamp.math.Matrix4f.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 254 of file Matrix4f.java.
Load the values of the given matrix src to this matrix.
| src | the source values |
Definition at line 186 of file Matrix4f.java.
| final Matrix4f com.jogamp.math.Matrix4f.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 172 of file Matrix4f.java.
|
static |
Map object coordinates to window coordinates.
Traditional gluProject implementation.
| obj | object position, 3 component vector |
| mMv | modelview matrix |
| mP | projection matrix |
| viewport | Rect4i viewport |
| winPos | 3 component window coordinate, the result |
Definition at line 1696 of file Matrix4f.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 | Rect4i viewport |
| winPos | 3 component window coordinate, the result |
Definition at line 1737 of file Matrix4f.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), if null method returns false |
| viewport | Rect4i viewport |
| objPos | 3 component object coordinate, the result |
Definition at line 1823 of file Matrix4f.java.
|
static |
Map window coordinates to object coordinates.
Traditional gluUnProject implementation.
| winx | |
| winy | |
| winz | |
| mMv | 4x4 modelview matrix |
| mP | 4x4 projection matrix |
| viewport | Rect4i viewport |
| objPos | 3 component object coordinate, the result |
| mat4Tmp | 16 component matrix for temp storage |
Definition at line 1778 of file Matrix4f.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), if null method returns false |
| viewport | Rect4i viewport vector |
| objPos1 | 3 component object coordinate, the result |
Definition at line 1866 of file Matrix4f.java.
|
static |
Map window coordinates to object coordinates.
Traditional gluUnProject4 implementation.
| winx | |
| winy | |
| winz | |
| clipw | |
| invPMv | inverse [projection] x [modelview] matrix, i.e. Inv(P x Mv), if null method returns false |
| viewport | Rect4i viewport vector |
| near | |
| far | |
| obj_pos | 4 component object coordinate, the result |
Definition at line 1973 of file Matrix4f.java.
|
static |
Map window coordinates to object coordinates.
Traditional gluUnProject4 implementation.
| winx | |
| winy | |
| winz | |
| clipw | |
| mMv | 4x4 modelview matrix |
| mP | 4x4 projection matrix |
| viewport | Rect4i viewport vector |
| near | |
| far | |
| obj_pos | 4 component object coordinate, the result |
| mat4Tmp | 16 component matrix for temp storage |
Definition at line 1926 of file Matrix4f.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 AABBox#getRayIntersection(Vec3f, Ray, float, boolean).
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 | |
| invPMv | inverse [projection] x [modelview] matrix, i.e. Inv(P x Mv), if null method returns false |
| viewport | Rect4i viewport |
| ray | storage for the resulting Ray |
Definition at line 2063 of file Matrix4f.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 AABBox#getRayIntersection(Vec3f, Ray, float, boolean).
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 | Rect4i viewport |
| ray | storage for the resulting Ray |
| mat4Tmp1 | 16 component matrix for temp storage |
| mat4Tmp2 | 16 component matrix for temp storage |
Definition at line 2023 of file Matrix4f.java.
Multiply matrix: [this] = [a] x [b].
| a | 4x4 matrix, can't be this matrix |
| b | 4x4 matrix, can't be this matrix |
Definition at line 773 of file Matrix4f.java.
Multiply matrix: [this] = [this] x [b].
| b | 4x4 matrix |
Definition at line 726 of file Matrix4f.java.
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.
| v_in | 3-component column-vector Vec3f, can be v_out for in-place transformation |
| v_out | m_in * v_in, 3-component column-vector Vec3f |
Definition at line 841 of file Matrix4f.java.
Affine 3f-vector transformation by 4x4 matrix.
4x4 matrix multiplication with 3-component vector, using 1 for for v_inout.w() and dropping v_inout.w(), which shall be 1.
| v_inout | 3-component column-vector Vec3f input and output, i.e. in-place transformation |
Definition at line 860 of file Matrix4f.java.
| v_in | 4-component column-vector, can be v_out for in-place transformation |
| v_out | this * v_in |
Definition at line 806 of file Matrix4f.java.
| v_inout | 4-component column-vector input and output, i.e. in-place transformation |
Definition at line 820 of file Matrix4f.java.
| final void com.jogamp.math.Matrix4f.pop | ( | ) |
Pop the current matrix from it's stack, replacing this matrix values.
Definition at line 1610 of file Matrix4f.java.
| final void com.jogamp.math.Matrix4f.push | ( | ) |
Push the matrix to it's stack, while preserving this matrix values.
Definition at line 1602 of file Matrix4f.java.
| final Matrix4f com.jogamp.math.Matrix4f.rotate | ( | final float | ang_rad, |
| final float | x, | ||
| final float | y, | ||
| final float | z, | ||
| final Matrix4f | 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 1525 of file Matrix4f.java.
| final Matrix4f com.jogamp.math.Matrix4f.rotate | ( | final float | ang_rad, |
| final Vec3f | axis, | ||
| final Matrix4f | 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 1537 of file Matrix4f.java.
| final Matrix4f com.jogamp.math.Matrix4f.rotate | ( | final Quaternion | quat, |
| final Matrix4f | 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 1546 of file Matrix4f.java.
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 1590 of file Matrix4f.java.
| final Matrix4f com.jogamp.math.Matrix4f.scale | ( | final float | x, |
| final float | y, | ||
| final float | z, | ||
| final Matrix4f | 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 1580 of file Matrix4f.java.
| void com.jogamp.math.Matrix4f.set | ( | final int | i, |
| final float | v | ||
| ) |
Sets the ith component with float v 0 <= i < 16.
Definition at line 136 of file Matrix4f.java.
| Matrix4f com.jogamp.math.Matrix4f.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 1254 of file Matrix4f.java.
| Matrix4f com.jogamp.math.Matrix4f.setToLookAt | ( | final Vec3f | eye, |
| final Vec3f | center, | ||
| final Vec3f | up, | ||
| final Matrix4f | tmp | ||
| ) |
Set this matrix to 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 1432 of file Matrix4f.java.
| Matrix4f com.jogamp.math.Matrix4f.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 1206 of file Matrix4f.java.
| Matrix4f com.jogamp.math.Matrix4f.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 1303 of file Matrix4f.java.
| Matrix4f com.jogamp.math.Matrix4f.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 1322 of file Matrix4f.java.
| Matrix4f com.jogamp.math.Matrix4f.setToPick | ( | final float | x, |
| final float | y, | ||
| final float | deltaX, | ||
| final float | deltaY, | ||
| final Recti | viewport, | ||
| final Matrix4f | mat4Tmp | ||
| ) |
Set this matrix to the pick matrix based on given parameters.
Traditional gluPickMatrix implementation.
Consist out of two matrix multiplications:
R = T x S,
with T for viewport translation matrix and
S for viewport scale matrix.
Result R can be utilized for projection multiplication, i.e.
P = P x R,
with P being the projection matrix.
To effectively use the generated pick matrix for picking, call setToPick(..) and multiply a custom perspective matrix by this pick matrix. Then you may load the result onto the perspective matrix stack.
| x | the center x-component of a picking region in window coordinates |
| y | the center y-component of a picking region in window coordinates |
| deltaX | the width of the picking region in window coordinates. |
| deltaY | the height of the picking region in window coordinates. |
| viewport | Rect4i viewport |
| mat4Tmp | temp storage |
null if either delta value is <= zero. Definition at line 1498 of file Matrix4f.java.
| final Matrix4f com.jogamp.math.Matrix4f.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 1124 of file Matrix4f.java.
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 1024 of file Matrix4f.java.
| final Matrix4f com.jogamp.math.Matrix4f.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 973 of file Matrix4f.java.
| Matrix4f com.jogamp.math.Matrix4f.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 1051 of file Matrix4f.java.
Set this matrix to rotation from the given Euler rotation angles in radians.
The rotations are applied in the given order:
| angradXYZ | euler angle vector in radians holding x-bank, y-heading and z-attitude |
Implementation does not use Quaternion and hence is exposed to Gimbal-Lock, consider using setToRotation(Quaternion).
Definition at line 1104 of file Matrix4f.java.
| final Matrix4f com.jogamp.math.Matrix4f.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 929 of file Matrix4f.java.
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
| s | scale Vec3f |
Definition at line 953 of file Matrix4f.java.
| final Matrix4f com.jogamp.math.Matrix4f.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 887 of file Matrix4f.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 911 of file Matrix4f.java.
| String com.jogamp.math.Matrix4f.toString | ( | ) |
Definition at line 2092 of file Matrix4f.java.
| StringBuilder com.jogamp.math.Matrix4f.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 2085 of file Matrix4f.java.
| final Matrix4f com.jogamp.math.Matrix4f.translate | ( | final float | x, |
| final float | y, | ||
| final float | z, | ||
| final Matrix4f | 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 1558 of file Matrix4f.java.
Translate this matrix, i.e.
multiply by translation matrix.
Definition at line 1568 of file Matrix4f.java.
| final Matrix4f com.jogamp.math.Matrix4f.transpose | ( | ) |
Transpose this matrix.
Definition at line 464 of file Matrix4f.java.
Transpose the given src matrix into this matrix.
| src | source 4x4 matrix |
Definition at line 500 of file Matrix4f.java.