Package icyllis.arc3d.core
Interface Matrix4c
- All Superinterfaces:
Cloneable
- All Known Implementing Classes:
Matrix4
Interface to a read-only view of a 4x4 matrix for 3D transformation.
This does not mean that the matrix is immutable, it only implies that
a method should not change the state of the matrix.
Matrix4 const &matrix
- See Also:
-
Method Summary
Modifier and TypeMethodDescription@NonNull Matrix4clone()floatReturn the determinant of this matrix.booleanbooleanCompute the inverse of this matrix.booleanisApproxEqual(@NonNull Matrix4 m) Returns whether this matrix is approximately equal to given matrix.booleanReturns whether this matrix transforms rect to another rect.booleanReturns whether this matrix at most scales and translates.floatlocalAARadius(float left, float top, float right, float bottom) Return the minimum distance needed to move in local (pre-transform) space to ensure that the transformed coordinates are at least 1px away from the original mapped point.floatlocalAARadius(Rect2fc bounds) Return the minimum distance needed to move in local (pre-transform) space to ensure that the transformed coordinates are at least 1px away from the original mapped point.floatm11()floatm12()floatm13()floatm14()floatm21()floatm22()floatm23()floatm24()floatm31()floatm32()floatm33()floatm34()floatm41()floatm42()floatm43()floatm44()voidMap the four corners of 'r' and return the bounding box of those points.voidMap the four corners of 'r' and return the bounding box of those points.voidMap the four corners of 'r' and return the bounding box of those points.voidMap the four corners of 'r' and return the bounding box of those points.voidMap the four corners of 'r' and return the bounding box of those points.voidmapRectOut(@NonNull Rect2fc r, @NonNull Rect2i dest) Map the four corners of 'r' and return the bounding box of those points.voidmapRectOut(@NonNull Rect2ic r, @NonNull Rect2i dest) Map the four corners of 'r' and return the bounding box of those points.voidstore(float @NonNull [] a) Store this matrix into the give float array in row-major order.voidstore(float @NonNull [] a, int offset) Store this matrix into the give float array in row-major order.voidstore(long p) Store this matrix into the given address in GLSL column-major or HLSL row-major order.voidStore this matrix elements to the given matrix.voidstore(@NonNull ByteBuffer a) Store this matrix into the give float array in row-major order.voidstore(@NonNull FloatBuffer a) Store this matrix into the give float array in row-major order.@NonNull Matrix3Converts this 4x4 matrix to 3x3 matrix, the fourth row and column are discarded.voidConverts this 4x4 matrix to 3x3 matrix, the fourth row and column are discarded.
-
Method Details
-
m11
float m11() -
m12
float m12() -
m13
float m13() -
m14
float m14() -
m21
float m21() -
m22
float m22() -
m23
float m23() -
m24
float m24() -
m31
float m31() -
m32
float m32() -
m33
float m33() -
m34
float m34() -
m41
float m41() -
m42
float m42() -
m43
float m43() -
m44
float m44() -
store
Store this matrix elements to the given matrix.- Parameters:
m- the matrix to store
-
store
void store(float @NonNull [] a) Store this matrix into the give float array in row-major order.- Parameters:
a- the array to store into
-
store
void store(float @NonNull [] a, int offset) Store this matrix into the give float array in row-major order.- Parameters:
a- the array to store intooffset- the element offset
-
store
Store this matrix into the give float array in row-major order.- Parameters:
a- the pointer of the array to store
-
store
Store this matrix into the give float array in row-major order.- Parameters:
a- the pointer of the array to store
-
store
void store(long p) Store this matrix into the given address in GLSL column-major or HLSL row-major order.- Parameters:
p- the pointer of the array to store
-
determinant
float determinant()Return the determinant of this matrix.- Returns:
- the determinant
-
invert
Compute the inverse of this matrix. The matrix will be inverted if this matrix is invertible, otherwise it keeps the same as before.- Parameters:
dest- the destination matrix- Returns:
trueif this matrix is invertible.
-
isAxisAligned
boolean isAxisAligned()Returns whether this matrix transforms rect to another rect. If true, this matrix is identity, or/and scales, or/and rotates round Z axis a multiple of 90 degrees, or mirrors on axes. In all cases, this matrix is affine and may also have translation.For example:
Matrix4 matrix = Matrix4.identity(); matrix.translate(3, 5, 7); matrix.scale(2, 3, 4); matrix.rotateX(MathUtil.PI_DIV_4); matrix.rotateZ(MathUtil.PI_DIV_2);- Returns:
- true if this matrix transform one rect into another
-
isScaleTranslate
boolean isScaleTranslate()Returns whether this matrix at most scales and translates.- Returns:
trueif this matrix is scale, translate, or both.
-
mapRect
Map the four corners of 'r' and return the bounding box of those points. The four corners of 'r' are assumed to have z = 0 and w = 1. If the matrix has perspective, the returned rectangle will be the bounding box of the projected points after being clipped to w > 0. -
mapRect
Map the four corners of 'r' and return the bounding box of those points. The four corners of 'r' are assumed to have z = 0 and w = 1. If the matrix has perspective, the returned rectangle will be the bounding box of the projected points after being clipped to w > 0. -
mapRect
Map the four corners of 'r' and return the bounding box of those points. The four corners of 'r' are assumed to have z = 0 and w = 1. If the matrix has perspective, the returned rectangle will be the bounding box of the projected points after being clipped to w > 0. -
mapRect
Map the four corners of 'r' and return the bounding box of those points. The four corners of 'r' are assumed to have z = 0 and w = 1. If the matrix has perspective, the returned rectangle will be the bounding box of the projected points after being clipped to w > 0. -
mapRectOut
Map the four corners of 'r' and return the bounding box of those points. The four corners of 'r' are assumed to have z = 0 and w = 1. If the matrix has perspective, the returned rectangle will be the bounding box of the projected points after being clipped to w > 0. -
mapRectOut
Map the four corners of 'r' and return the bounding box of those points. The four corners of 'r' are assumed to have z = 0 and w = 1. If the matrix has perspective, the returned rectangle will be the bounding box of the projected points after being clipped to w > 0. -
mapRectIn
Map the four corners of 'r' and return the bounding box of those points. The four corners of 'r' are assumed to have z = 0 and w = 1. If the matrix has perspective, the returned rectangle will be the bounding box of the projected points after being clipped to w > 0. -
hasPerspective
boolean hasPerspective() -
localAARadius
Return the minimum distance needed to move in local (pre-transform) space to ensure that the transformed coordinates are at least 1px away from the original mapped point. This minimum distance is specific to the given local 'bounds' since the scale factors change with perspective.If the bounds will be clipped by the w=0 plane or otherwise is ill-conditioned, this will return positive infinity.
-
localAARadius
float localAARadius(float left, float top, float right, float bottom) Return the minimum distance needed to move in local (pre-transform) space to ensure that the transformed coordinates are at least 1px away from the original mapped point. This minimum distance is specific to the given local 'bounds' since the scale factors change with perspective.If the bounds will be clipped by the w=0 plane or otherwise is ill-conditioned, this will return positive infinity.
-
toMatrix3
Converts this 4x4 matrix to 3x3 matrix, the fourth row and column are discarded.[ a b c x ] [ a b c ] [ d e f x ] -> [ d e f ] [ g h i x ] [ g h i ] [ x x x x ] -
toMatrix3
@NonNull Matrix3 toMatrix3()Converts this 4x4 matrix to 3x3 matrix, the fourth row and column are discarded.[ a b c x ] [ a b c ] [ d e f x ] -> [ d e f ] [ g h i x ] [ g h i ] [ x x x x ] -
isApproxEqual
Returns whether this matrix is approximately equal to given matrix.- Parameters:
m- the matrix to compare.- Returns:
trueif this matrix is equivalent to other matrix.
-
clone
@NonNull Matrix4 clone()
-