Class Matrix3x2f
- java.lang.Object
-
- org.joml.Matrix3x2f
-
- All Implemented Interfaces:
java.io.Externalizable,java.io.Serializable,java.lang.Cloneable,Matrix3x2fc
- Direct Known Subclasses:
Matrix3x2fStack
public class Matrix3x2f extends java.lang.Object implements Matrix3x2fc, java.io.Externalizable, java.lang.Cloneable
Contains the definition of a 3x2 matrix of floats, and associated functions to transform it. The matrix is column-major to match OpenGL's interpretation, and it looks like this:m00 m10 m20
m01 m11 m21- Author:
- Kai Burjack
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description Matrix3x2f()Create a newMatrix3x2fand set it toidentity.Matrix3x2f(float m00, float m01, float m10, float m11, float m20, float m21)Create a new 3x2 matrix using the supplied float values.Matrix3x2f(java.nio.FloatBuffer buffer)Create a newMatrix3x2fby reading its 6 float components from the givenFloatBufferat the buffer's current position.Matrix3x2f(Matrix2fc mat)Create a newMatrix3x2fby setting its left 2x2 submatrix to the values of the givenMatrix2fcand the rest to identity.Matrix3x2f(Matrix3x2fc mat)Create a newMatrix3x2fand make it a copy of the given matrix.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Objectclone()floatdeterminant()Return the determinant of this matrix.booleanequals(java.lang.Object obj)booleanequals(Matrix3x2fc m, float delta)Compare the matrix elements ofthismatrix with the given matrix using the givendeltaand return whether all of them are equal within a maximum difference ofdelta.float[]get(float[] arr)Store this matrix into the supplied float array in column-major order.float[]get(float[] arr, int offset)Store this matrix into the supplied float array in column-major order at the given offset.java.nio.ByteBufferget(int index, java.nio.ByteBuffer buffer)Store this matrix in column-major order into the suppliedByteBufferstarting at the specified absolute buffer position/index.java.nio.FloatBufferget(int index, java.nio.FloatBuffer buffer)Store this matrix in column-major order into the suppliedFloatBufferstarting at the specified absolute buffer position/index.java.nio.ByteBufferget(java.nio.ByteBuffer buffer)Store this matrix in column-major order into the suppliedByteBufferat the current bufferposition.java.nio.FloatBufferget(java.nio.FloatBuffer buffer)Store this matrix in column-major order into the suppliedFloatBufferat the current bufferposition.Matrix3x2fget(Matrix3x2f dest)Get the current values ofthismatrix and store them intodest.float[]get3x3(float[] arr)Store this matrix as an equivalent 3x3 matrix in column-major order into the supplied float array.float[]get3x3(float[] arr, int offset)Store this matrix as an equivalent 3x3 matrix in column-major order into the supplied float array at the given offset.java.nio.ByteBufferget3x3(int index, java.nio.ByteBuffer buffer)Store this matrix as an equivalent 3x3 matrix in column-major order into the suppliedByteBufferstarting at the specified absolute buffer position/index.java.nio.FloatBufferget3x3(int index, java.nio.FloatBuffer buffer)Store this matrix as an equivalent 3x3 matrix in column-major order into the suppliedFloatBufferstarting at the specified absolute buffer position/index.java.nio.ByteBufferget3x3(java.nio.ByteBuffer buffer)Store this matrix as an equivalent 3x3 matrix in column-major order into the suppliedByteBufferat the current bufferposition.java.nio.FloatBufferget3x3(java.nio.FloatBuffer buffer)Store this matrix as an equivalent 3x3 matrix in column-major order into the suppliedFloatBufferat the current bufferposition.float[]get4x4(float[] arr)Store this matrix as an equivalent 4x4 matrix in column-major order into the supplied float array.float[]get4x4(float[] arr, int offset)Store this matrix as an equivalent 4x4 matrix in column-major order into the supplied float array at the given offset.java.nio.ByteBufferget4x4(int index, java.nio.ByteBuffer buffer)Store this matrix as an equivalent 4x4 matrix in column-major order into the suppliedByteBufferstarting at the specified absolute buffer position/index.java.nio.FloatBufferget4x4(int index, java.nio.FloatBuffer buffer)Store this matrix as an equivalent 4x4 matrix in column-major order into the suppliedFloatBufferstarting at the specified absolute buffer position/index.java.nio.ByteBufferget4x4(java.nio.ByteBuffer buffer)Store this matrix as an equivalent 4x4 matrix in column-major order into the suppliedByteBufferat the current bufferposition.java.nio.FloatBufferget4x4(java.nio.FloatBuffer buffer)Store this matrix as an equivalent 4x4 matrix in column-major order into the suppliedFloatBufferat the current bufferposition.Matrix3x2fcgetToAddress(long address)Store this matrix in column-major order at the given off-heap address.inthashCode()Matrix3x2fidentity()Set this matrix to the identity.Matrix3x2finvert()Invert this matrix by assuming a third row in this matrix of(0, 0, 1).Matrix3x2finvert(Matrix3x2f dest)Invert thethismatrix by assuming a third row in this matrix of(0, 0, 1)and store the result indest.booleanisFinite()Determine whether all matrix elements are finite floating-point values, that is, they are notNaNand notinfinity.floatm00()Return the value of the matrix element at column 0 and row 0.floatm01()Return the value of the matrix element at column 0 and row 1.floatm10()Return the value of the matrix element at column 1 and row 0.floatm11()Return the value of the matrix element at column 1 and row 1.floatm20()Return the value of the matrix element at column 2 and row 0.floatm21()Return the value of the matrix element at column 2 and row 1.Matrix3x2fmul(Matrix3x2fc right)Multiply this matrix by the suppliedrightmatrix by assuming a third row in both matrices of(0, 0, 1).Matrix3x2fmul(Matrix3x2fc right, Matrix3x2f dest)Multiply this matrix by the suppliedrightmatrix by assuming a third row in both matrices of(0, 0, 1)and store the result indest.Matrix3x2fmulLocal(Matrix3x2fc left)Pre-multiply this matrix by the suppliedleftmatrix and store the result inthis.Matrix3x2fmulLocal(Matrix3x2fc left, Matrix3x2f dest)Pre-multiply this matrix by the suppliedleftmatrix and store the result indest.Vector2fnormalizedPositiveX(Vector2f dir)Obtain the direction of+Xbefore the transformation represented bythisorthogonal matrix is applied.Vector2fnormalizedPositiveY(Vector2f dir)Obtain the direction of+Ybefore the transformation represented bythisorthogonal matrix is applied.Vector2forigin(Vector2f origin)Obtain the position that gets transformed to the origin bythismatrix.Vector2fpositiveX(Vector2f dir)Obtain the direction of+Xbefore the transformation represented bythismatrix is applied.Vector2fpositiveY(Vector2f dir)Obtain the direction of+Ybefore the transformation represented bythismatrix is applied.voidreadExternal(java.io.ObjectInput in)Matrix3x2frotate(float ang)Apply a rotation transformation to this matrix by rotating the given amount of radians.Matrix3x2frotate(float ang, Matrix3x2f dest)Apply a rotation transformation to this matrix by rotating the given amount of radians and store the result indest.Matrix3x2frotateAbout(float ang, float x, float y)Apply a rotation transformation to this matrix by rotating the given amount of radians about the specified rotation center(x, y).Matrix3x2frotateAbout(float ang, float x, float y, Matrix3x2f dest)Apply a rotation transformation to this matrix by rotating the given amount of radians about the specified rotation center(x, y)and store the result indest.Matrix3x2frotateLocal(float ang)Pre-multiply a rotation to this matrix by rotating the given amount of radians.Matrix3x2frotateLocal(float ang, Matrix3x2f dest)Pre-multiply a rotation to this matrix by rotating the given amount of radians and store the result indest.Matrix3x2frotateTo(Vector2fc fromDir, Vector2fc toDir)Apply a rotation transformation to this matrix that rotates the given normalizedfromDirdirection vector to point along the normalizedtoDir.Matrix3x2frotateTo(Vector2fc fromDir, Vector2fc toDir, Matrix3x2f dest)Apply a rotation transformation to this matrix that rotates the given normalizedfromDirdirection vector to point along the normalizedtoDir, and store the result indest.Matrix3x2frotation(float angle)Set this matrix to a rotation matrix which rotates the given radians.Matrix3x2fscale(float xy)Apply scaling to this matrix by uniformly scaling the two base axes by the givenxyzfactor.Matrix3x2fscale(float x, float y)Apply scaling to this matrix by scaling the base axes by the given x and y factors.Matrix3x2fscale(float x, float y, Matrix3x2f dest)Apply scaling to this matrix by scaling the unit axes by the given x and y and store the result indest.Matrix3x2fscale(float xy, Matrix3x2f dest)Apply scaling to this matrix by uniformly scaling the two base axes by the givenxyfactor and store the result indest.Matrix3x2fscale(Vector2fc xy)Apply scaling to this matrix by scaling the base axes by the givenxyfactors.Matrix3x2fscale(Vector2fc xy, Matrix3x2f dest)Apply scaling to this matrix by scaling the base axes by the givenxyfactors and store the result indest.Matrix3x2fscaleAround(float factor, float ox, float oy)Apply scaling to this matrix by scaling the base axes by the givenfactorwhile using(ox, oy)as the scaling origin.Matrix3x2fscaleAround(float sx, float sy, float ox, float oy)Apply scaling to this matrix by scaling the base axes by the given sx and sy factors while using(ox, oy)as the scaling origin.Matrix3x2fscaleAround(float sx, float sy, float ox, float oy, Matrix3x2f dest)Apply scaling tothismatrix by scaling the base axes by the given sx and sy factors while using(ox, oy)as the scaling origin, and store the result indest.Matrix3x2fscaleAround(float factor, float ox, float oy, Matrix3x2f dest)Apply scaling to this matrix by scaling the base axes by the givenfactorwhile using(ox, oy)as the scaling origin, and store the result indest.Matrix3x2fscaleAroundLocal(float factor, float ox, float oy)Pre-multiply scaling to this matrix by scaling the base axes by the givenfactorwhile using(ox, oy)as the scaling origin.Matrix3x2fscaleAroundLocal(float sx, float sy, float sz, float ox, float oy, float oz)Pre-multiply scaling to this matrix by scaling the base axes by the given sx and sy factors while using(ox, oy)as the scaling origin.Matrix3x2fscaleAroundLocal(float sx, float sy, float ox, float oy, Matrix3x2f dest)Pre-multiply scaling tothismatrix by scaling the base axes by the given sx and sy factors while using the given(ox, oy)as the scaling origin, and store the result indest.Matrix3x2fscaleAroundLocal(float factor, float ox, float oy, Matrix3x2f dest)Pre-multiply scaling to this matrix by scaling the base axes by the givenfactorwhile using(ox, oy)as the scaling origin, and store the result indest.Matrix3x2fscaleLocal(float xy)Pre-multiply scaling to this matrix by scaling the base axes by the given xy factor.Matrix3x2fscaleLocal(float x, float y)Pre-multiply scaling to this matrix by scaling the base axes by the given x and y factors.Matrix3x2fscaleLocal(float x, float y, Matrix3x2f dest)Pre-multiply scaling tothismatrix by scaling the base axes by the given x and y factors and store the result indest.Matrix3x2fscaleLocal(float xy, Matrix3x2f dest)Pre-multiply scaling tothismatrix by scaling the two base axes by the givenxyfactor, and store the result indest.Matrix3x2fscaling(float factor)Set this matrix to be a simple scale matrix, which scales the two base axes uniformly by the given factor.Matrix3x2fscaling(float x, float y)Set this matrix to be a simple scale matrix.Matrix3x2fset(float[] m)Set the values in this matrix based on the supplied float array.Matrix3x2fset(float m00, float m01, float m10, float m11, float m20, float m21)Set the values within this matrix to the supplied float values.Matrix3x2fset(int index, java.nio.ByteBuffer buffer)Set the values of this matrix by reading 6 float values from the givenByteBufferin column-major order, starting at the specified absolute buffer position/index.Matrix3x2fset(int index, java.nio.FloatBuffer buffer)Set the values of this matrix by reading 6 float values from the givenFloatBufferin column-major order, starting at the specified absolute buffer position/index.Matrix3x2fset(java.nio.ByteBuffer buffer)Set the values of this matrix by reading 6 float values from the givenByteBufferin column-major order, starting at its current position.Matrix3x2fset(java.nio.FloatBuffer buffer)Set the values of this matrix by reading 6 float values from the givenFloatBufferin column-major order, starting at its current position.Matrix3x2fset(Matrix2fc m)Set the left 2x2 submatrix of thisMatrix3x2fto the givenMatrix2fcand don't change the other elements.Matrix3x2fset(Matrix3x2fc m)Set the elements of this matrix to the ones inm.Matrix3x2fsetFromAddress(long address)Set the values of this matrix by reading 6 float values from off-heap memory in column-major order, starting at the given address.Matrix3x2fsetTranslation(float x, float y)Set only the translation components of this matrix(m20, m21)to the given values(x, y).Matrix3x2fsetTranslation(Vector2f offset)Set only the translation components of this matrix(m20, m21)to the given values(offset.x, offset.y).Matrix3x2fsetView(float left, float right, float bottom, float top)Set this matrix to define a "view" transformation that maps the given(left, bottom)and(right, top)corners to(-1, -1)and(1, 1)respectively.Matrix3x2fshearX(float yFactor)Apply shearing to this matrix by shearing along the X axis using the Y axis factoryFactor.Matrix3x2fshearX(float yFactor, Matrix3x2f dest)Apply shearing to this matrix by shearing along the X axis using the Y axis factoryFactor, and store the result indest.Matrix3x2fshearY(float xFactor)Apply shearing to this matrix by shearing along the Y axis using the X axis factorxFactor.Matrix3x2fshearY(float xFactor, Matrix3x2f dest)Apply shearing to this matrix by shearing along the Y axis using the X axis factorxFactor, and store the result indest.Matrix3x2fspan(Vector2f corner, Vector2f xDir, Vector2f yDir)Compute the extents of the coordinate system before this transformation was applied and store the resulting corner coordinates incornerand the span vectors inxDirandyDir.booleantestAar(float minX, float minY, float maxX, float maxY)Test whether the given axis-aligned rectangle is partly or completely within or outside of the frustum defined bythismatrix.booleantestCircle(float x, float y, float r)Test whether the given circle is partly or completely within or outside of the frustum defined bythismatrix.booleantestPoint(float x, float y)Test whether the given point(x, y)is within the frustum defined bythismatrix.java.lang.StringtoString()Return a string representation of this matrix.java.lang.StringtoString(java.text.NumberFormat formatter)Return a string representation of this matrix by formatting the matrix elements with the givenNumberFormat.Vector3ftransform(float x, float y, float z, Vector3f dest)Transform/multiply the given vector(x, y, z)by this matrix and store the result indest.Vector3ftransform(Vector3f v)Transform/multiply the given vector by this matrix by assuming a third row in this matrix of(0, 0, 1)and store the result in that vector.Vector3ftransform(Vector3f v, Vector3f dest)Transform/multiply the given vector by this matrix by assuming a third row in this matrix of(0, 0, 1)and store the result indest.Vector2ftransformDirection(float x, float y, Vector2f dest)Transform/multiply the given 2D-vector(x, y), as if it was a 3D-vector with z=0, by this matrix and store the result indest.Vector2ftransformDirection(Vector2f v)Transform/multiply the given 2D-vector, as if it was a 3D-vector with z=0, by this matrix and store the result in that vector.Vector2ftransformDirection(Vector2fc v, Vector2f dest)Transform/multiply the given 2D-vector, as if it was a 3D-vector with z=0, by this matrix and store the result indest.Vector2ftransformPosition(float x, float y, Vector2f dest)Transform/multiply the given 2D-vector(x, y), as if it was a 3D-vector with z=1, by this matrix and store the result indest.Vector2ftransformPosition(Vector2f v)Transform/multiply the given 2D-vector, as if it was a 3D-vector with z=1, by this matrix and store the result in that vector.Vector2ftransformPosition(Vector2fc v, Vector2f dest)Transform/multiply the given 2D-vector, as if it was a 3D-vector with z=1, by this matrix and store the result indest.Matrix3x2ftranslate(float x, float y)Apply a translation to this matrix by translating by the given number of units in x and y.Matrix3x2ftranslate(float x, float y, Matrix3x2f dest)Apply a translation to this matrix by translating by the given number of units in x and y and store the result indest.Matrix3x2ftranslate(Vector2fc offset)Apply a translation to this matrix by translating by the given number of units in x and y.Matrix3x2ftranslate(Vector2fc offset, Matrix3x2f dest)Apply a translation to this matrix by translating by the given number of units in x and y, and store the result indest.Matrix3x2ftranslateLocal(float x, float y)Pre-multiply a translation to this matrix by translating by the given number of units in x and y.Matrix3x2ftranslateLocal(float x, float y, Matrix3x2f dest)Pre-multiply a translation to this matrix by translating by the given number of units in x and y and store the result indest.Matrix3x2ftranslateLocal(Vector2fc offset)Pre-multiply a translation to this matrix by translating by the given number of units in x and y.Matrix3x2ftranslateLocal(Vector2fc offset, Matrix3x2f dest)Pre-multiply a translation to this matrix by translating by the given number of units in x and y and store the result indest.Matrix3x2ftranslation(float x, float y)Set this matrix to be a simple translation matrix in a two-dimensional coordinate system.Matrix3x2ftranslation(Vector2fc offset)Set this matrix to be a simple translation matrix in a two-dimensional coordinate system.Vector2funproject(float winX, float winY, int[] viewport, Vector2f dest)Unproject the given window coordinates(winX, winY)bythismatrix using the specified viewport.Vector2funprojectInv(float winX, float winY, int[] viewport, Vector2f dest)Unproject the given window coordinates(winX, winY)bythismatrix using the specified viewport.Matrix3x2fview(float left, float right, float bottom, float top)Apply a "view" transformation to this matrix that maps the given(left, bottom)and(right, top)corners to(-1, -1)and(1, 1)respectively.Matrix3x2fview(float left, float right, float bottom, float top, Matrix3x2f dest)Apply a "view" transformation to this matrix that maps the given(left, bottom)and(right, top)corners to(-1, -1)and(1, 1)respectively and store the result indest.float[]viewArea(float[] area)Obtain the extents of the view transformation ofthismatrix and store it inarea.voidwriteExternal(java.io.ObjectOutput out)Matrix3x2fzero()Set all values within this matrix to zero.
-
-
-
Constructor Detail
-
Matrix3x2f
public Matrix3x2f()
Create a newMatrix3x2fand set it toidentity.
-
Matrix3x2f
public Matrix3x2f(Matrix3x2fc mat)
Create a newMatrix3x2fand make it a copy of the given matrix.- Parameters:
mat- theMatrix3x2fcto copy the values from
-
Matrix3x2f
public Matrix3x2f(Matrix2fc mat)
Create a newMatrix3x2fby setting its left 2x2 submatrix to the values of the givenMatrix2fcand the rest to identity.- Parameters:
mat- theMatrix2fc
-
Matrix3x2f
public Matrix3x2f(float m00, float m01, float m10, float m11, float m20, float m21)Create a new 3x2 matrix using the supplied float values. The order of the parameter is column-major, so the first two parameters specify the two elements of the first column.- Parameters:
m00- the value of m00m01- the value of m01m10- the value of m10m11- the value of m11m20- the value of m20m21- the value of m21
-
Matrix3x2f
public Matrix3x2f(java.nio.FloatBuffer buffer)
Create a newMatrix3x2fby reading its 6 float components from the givenFloatBufferat the buffer's current position.That FloatBuffer is expected to hold the values in column-major order.
The buffer's position will not be changed by this method.
- Parameters:
buffer- theFloatBufferto read the matrix values from
-
-
Method Detail
-
m00
public float m00()
Description copied from interface:Matrix3x2fcReturn the value of the matrix element at column 0 and row 0.- Specified by:
m00in interfaceMatrix3x2fc- Returns:
- the value of the matrix element
-
m01
public float m01()
Description copied from interface:Matrix3x2fcReturn the value of the matrix element at column 0 and row 1.- Specified by:
m01in interfaceMatrix3x2fc- Returns:
- the value of the matrix element
-
m10
public float m10()
Description copied from interface:Matrix3x2fcReturn the value of the matrix element at column 1 and row 0.- Specified by:
m10in interfaceMatrix3x2fc- Returns:
- the value of the matrix element
-
m11
public float m11()
Description copied from interface:Matrix3x2fcReturn the value of the matrix element at column 1 and row 1.- Specified by:
m11in interfaceMatrix3x2fc- Returns:
- the value of the matrix element
-
m20
public float m20()
Description copied from interface:Matrix3x2fcReturn the value of the matrix element at column 2 and row 0.- Specified by:
m20in interfaceMatrix3x2fc- Returns:
- the value of the matrix element
-
m21
public float m21()
Description copied from interface:Matrix3x2fcReturn the value of the matrix element at column 2 and row 1.- Specified by:
m21in interfaceMatrix3x2fc- Returns:
- the value of the matrix element
-
set
public Matrix3x2f set(Matrix3x2fc m)
Set the elements of this matrix to the ones inm.- Parameters:
m- the matrix to copy the elements from- Returns:
- this
-
set
public Matrix3x2f set(Matrix2fc m)
Set the left 2x2 submatrix of thisMatrix3x2fto the givenMatrix2fcand don't change the other elements.- Parameters:
m- the 2x2 matrix- Returns:
- this
-
mul
public Matrix3x2f mul(Matrix3x2fc right)
Multiply this matrix by the suppliedrightmatrix by assuming a third row in both matrices of(0, 0, 1).If
Misthismatrix andRtherightmatrix, then the new matrix will beM * R. So when transforming a vectorvwith the new matrix by usingM * R * v, the transformation of the right matrix will be applied first!- Parameters:
right- the right operand of the matrix multiplication- Returns:
- this
-
mul
public Matrix3x2f mul(Matrix3x2fc right, Matrix3x2f dest)
Multiply this matrix by the suppliedrightmatrix by assuming a third row in both matrices of(0, 0, 1)and store the result indest.If
Misthismatrix andRtherightmatrix, then the new matrix will beM * R. So when transforming a vectorvwith the new matrix by usingM * R * v, the transformation of the right matrix will be applied first!- Specified by:
mulin interfaceMatrix3x2fc- Parameters:
right- the right operand of the matrix multiplicationdest- will hold the result- Returns:
- dest
-
mulLocal
public Matrix3x2f mulLocal(Matrix3x2fc left)
Pre-multiply this matrix by the suppliedleftmatrix and store the result inthis.If
Misthismatrix andLtheleftmatrix, then the new matrix will beL * M. So when transforming a vectorvwith the new matrix by usingL * M * v, the transformation ofthismatrix will be applied first!- Parameters:
left- the left operand of the matrix multiplication- Returns:
- this
-
mulLocal
public Matrix3x2f mulLocal(Matrix3x2fc left, Matrix3x2f dest)
Description copied from interface:Matrix3x2fcPre-multiply this matrix by the suppliedleftmatrix and store the result indest.If
Misthismatrix andLtheleftmatrix, then the new matrix will beL * M. So when transforming a vectorvwith the new matrix by usingL * M * v, the transformation ofthismatrix will be applied first!- Specified by:
mulLocalin interfaceMatrix3x2fc- Parameters:
left- the left operand of the matrix multiplicationdest- the destination matrix, which will hold the result- Returns:
- dest
-
set
public Matrix3x2f set(float m00, float m01, float m10, float m11, float m20, float m21)
Set the values within this matrix to the supplied float values. The result looks like this:m00, m10, m20
m01, m11, m21- Parameters:
m00- the new value of m00m01- the new value of m01m10- the new value of m10m11- the new value of m11m20- the new value of m20m21- the new value of m21- Returns:
- this
-
set
public Matrix3x2f set(float[] m)
Set the values in this matrix based on the supplied float array. The result looks like this:0, 2, 4
1, 3, 5
This method only uses the first 6 values, all others are ignored.- Parameters:
m- the array to read the matrix values from- Returns:
- this
-
determinant
public float determinant()
Return the determinant of this matrix.- Specified by:
determinantin interfaceMatrix3x2fc- Returns:
- the determinant
-
invert
public Matrix3x2f invert()
Invert this matrix by assuming a third row in this matrix of(0, 0, 1).- Returns:
- this
-
invert
public Matrix3x2f invert(Matrix3x2f dest)
Invert thethismatrix by assuming a third row in this matrix of(0, 0, 1)and store the result indest.- Specified by:
invertin interfaceMatrix3x2fc- Parameters:
dest- will hold the result- Returns:
- dest
-
translation
public Matrix3x2f translation(float x, float y)
Set this matrix to be a simple translation matrix in a two-dimensional coordinate system.The resulting matrix can be multiplied against another transformation matrix to obtain an additional translation.
In order to apply a translation via to an already existing transformation matrix, use
translate()instead.- Parameters:
x- the units to translate in xy- the units to translate in y- Returns:
- this
- See Also:
translate(float, float)
-
translation
public Matrix3x2f translation(Vector2fc offset)
Set this matrix to be a simple translation matrix in a two-dimensional coordinate system.The resulting matrix can be multiplied against another transformation matrix to obtain an additional translation.
In order to apply a translation via to an already existing transformation matrix, use
translate()instead.- Parameters:
offset- the translation- Returns:
- this
- See Also:
translate(Vector2fc)
-
setTranslation
public Matrix3x2f setTranslation(float x, float y)
Set only the translation components of this matrix(m20, m21)to the given values(x, y).To build a translation matrix instead, use
translation(float, float). To apply a translation to another matrix, usetranslate(float, float).- Parameters:
x- the offset to translate in xy- the offset to translate in y- Returns:
- this
- See Also:
translation(float, float),translate(float, float)
-
setTranslation
public Matrix3x2f setTranslation(Vector2f offset)
Set only the translation components of this matrix(m20, m21)to the given values(offset.x, offset.y).To build a translation matrix instead, use
translation(Vector2fc). To apply a translation to another matrix, usetranslate(Vector2fc).- Parameters:
offset- the new translation to set- Returns:
- this
- See Also:
translation(Vector2fc),translate(Vector2fc)
-
translate
public Matrix3x2f translate(float x, float y, Matrix3x2f dest)
Apply a translation to this matrix by translating by the given number of units in x and y and store the result indest.If
Misthismatrix andTthe translation matrix, then the new matrix will beM * T. So when transforming a vectorvwith the new matrix by usingM * T * v, the translation will be applied first!In order to set the matrix to a translation transformation without post-multiplying it, use
translation(float, float).- Specified by:
translatein interfaceMatrix3x2fc- Parameters:
x- the offset to translate in xy- the offset to translate in ydest- will hold the result- Returns:
- dest
- See Also:
translation(float, float)
-
translate
public Matrix3x2f translate(float x, float y)
Apply a translation to this matrix by translating by the given number of units in x and y.If
Misthismatrix andTthe translation matrix, then the new matrix will beM * T. So when transforming a vectorvwith the new matrix by usingM * T * v, the translation will be applied first!In order to set the matrix to a translation transformation without post-multiplying it, use
translation(float, float).- Parameters:
x- the offset to translate in xy- the offset to translate in y- Returns:
- this
- See Also:
translation(float, float)
-
translate
public Matrix3x2f translate(Vector2fc offset, Matrix3x2f dest)
Apply a translation to this matrix by translating by the given number of units in x and y, and store the result indest.If
Misthismatrix andTthe translation matrix, then the new matrix will beM * T. So when transforming a vectorvwith the new matrix by usingM * T * v, the translation will be applied first!In order to set the matrix to a translation transformation without post-multiplying it, use
translation(float, float).- Specified by:
translatein interfaceMatrix3x2fc- Parameters:
offset- the offset to translatedest- will hold the result- Returns:
- dest
- See Also:
translation(Vector2fc)
-
translate
public Matrix3x2f translate(Vector2fc offset)
Apply a translation to this matrix by translating by the given number of units in x and y.If
Misthismatrix andTthe translation matrix, then the new matrix will beM * T. So when transforming a vectorvwith the new matrix by usingM * T * v, the translation will be applied first!In order to set the matrix to a translation transformation without post-multiplying it, use
translation(float, float).- Parameters:
offset- the offset to translate- Returns:
- this
- See Also:
translation(Vector2fc)
-
translateLocal
public Matrix3x2f translateLocal(Vector2fc offset)
Pre-multiply a translation to this matrix by translating by the given number of units in x and y.If
Misthismatrix andTthe translation matrix, then the new matrix will beT * M. So when transforming a vectorvwith the new matrix by usingT * M * v, the translation will be applied last!In order to set the matrix to a translation transformation without pre-multiplying it, use
translation(Vector2fc).- Parameters:
offset- the number of units in x and y by which to translate- Returns:
- this
- See Also:
translation(Vector2fc)
-
translateLocal
public Matrix3x2f translateLocal(Vector2fc offset, Matrix3x2f dest)
Pre-multiply a translation to this matrix by translating by the given number of units in x and y and store the result indest.If
Misthismatrix andTthe translation matrix, then the new matrix will beT * M. So when transforming a vectorvwith the new matrix by usingT * M * v, the translation will be applied last!In order to set the matrix to a translation transformation without pre-multiplying it, use
translation(Vector2fc).- Specified by:
translateLocalin interfaceMatrix3x2fc- Parameters:
offset- the number of units in x and y by which to translatedest- will hold the result- Returns:
- dest
- See Also:
translation(Vector2fc)
-
translateLocal
public Matrix3x2f translateLocal(float x, float y, Matrix3x2f dest)
Pre-multiply a translation to this matrix by translating by the given number of units in x and y and store the result indest.If
Misthismatrix andTthe translation matrix, then the new matrix will beT * M. So when transforming a vectorvwith the new matrix by usingT * M * v, the translation will be applied last!In order to set the matrix to a translation transformation without pre-multiplying it, use
translation(float, float).- Specified by:
translateLocalin interfaceMatrix3x2fc- Parameters:
x- the offset to translate in xy- the offset to translate in ydest- will hold the result- Returns:
- dest
- See Also:
translation(float, float)
-
translateLocal
public Matrix3x2f translateLocal(float x, float y)
Pre-multiply a translation to this matrix by translating by the given number of units in x and y.If
Misthismatrix andTthe translation matrix, then the new matrix will beT * M. So when transforming a vectorvwith the new matrix by usingT * M * v, the translation will be applied last!In order to set the matrix to a translation transformation without pre-multiplying it, use
translation(float, float).- Parameters:
x- the offset to translate in xy- the offset to translate in y- Returns:
- this
- See Also:
translation(float, float)
-
toString
public java.lang.String toString()
Return a string representation of this matrix.This method creates a new
DecimalFormaton every invocation with the format string "0.000E0;-".- Overrides:
toStringin classjava.lang.Object- Returns:
- the string representation
-
toString
public java.lang.String toString(java.text.NumberFormat formatter)
Return a string representation of this matrix by formatting the matrix elements with the givenNumberFormat.- Parameters:
formatter- theNumberFormatused to format the matrix values with- Returns:
- the string representation
-
get
public Matrix3x2f get(Matrix3x2f dest)
Get the current values ofthismatrix and store them intodest.This is the reverse method of
set(Matrix3x2fc)and allows to obtain intermediate calculation results when chaining multiple transformations.- Specified by:
getin interfaceMatrix3x2fc- Parameters:
dest- the destination matrix- Returns:
- dest
- See Also:
set(Matrix3x2fc)
-
get
public java.nio.FloatBuffer get(java.nio.FloatBuffer buffer)
Store this matrix in column-major order into the suppliedFloatBufferat the current bufferposition.This method will not increment the position of the given FloatBuffer.
In order to specify the offset into the FloatBuffer at which the matrix is stored, use
get(int, FloatBuffer), taking the absolute position as parameter.- Specified by:
getin interfaceMatrix3x2fc- Parameters:
buffer- will receive the values of this matrix in column-major order at its current position- Returns:
- the passed in buffer
- See Also:
get(int, FloatBuffer)
-
get
public java.nio.FloatBuffer get(int index, java.nio.FloatBuffer buffer)Store this matrix in column-major order into the suppliedFloatBufferstarting at the specified absolute buffer position/index.This method will not increment the position of the given FloatBuffer.
- Specified by:
getin interfaceMatrix3x2fc- Parameters:
index- the absolute position into the FloatBufferbuffer- will receive the values of this matrix in column-major order- Returns:
- the passed in buffer
-
get
public java.nio.ByteBuffer get(java.nio.ByteBuffer buffer)
Store this matrix in column-major order into the suppliedByteBufferat the current bufferposition.This method will not increment the position of the given ByteBuffer.
In order to specify the offset into the ByteBuffer at which the matrix is stored, use
get(int, ByteBuffer), taking the absolute position as parameter.- Specified by:
getin interfaceMatrix3x2fc- Parameters:
buffer- will receive the values of this matrix in column-major order at its current position- Returns:
- the passed in buffer
- See Also:
get(int, ByteBuffer)
-
get
public java.nio.ByteBuffer get(int index, java.nio.ByteBuffer buffer)Store this matrix in column-major order into the suppliedByteBufferstarting at the specified absolute buffer position/index.This method will not increment the position of the given ByteBuffer.
- Specified by:
getin interfaceMatrix3x2fc- Parameters:
index- the absolute position into the ByteBufferbuffer- will receive the values of this matrix in column-major order- Returns:
- the passed in buffer
-
get3x3
public java.nio.FloatBuffer get3x3(java.nio.FloatBuffer buffer)
Store this matrix as an equivalent 3x3 matrix in column-major order into the suppliedFloatBufferat the current bufferposition.This method will not increment the position of the given FloatBuffer.
In order to specify the offset into the FloatBuffer at which the matrix is stored, use
get3x3(int, FloatBuffer), taking the absolute position as parameter.- Specified by:
get3x3in interfaceMatrix3x2fc- Parameters:
buffer- will receive the values of this matrix in column-major order at its current position- Returns:
- the passed in buffer
- See Also:
get3x3(int, FloatBuffer)
-
get3x3
public java.nio.FloatBuffer get3x3(int index, java.nio.FloatBuffer buffer)Store this matrix as an equivalent 3x3 matrix in column-major order into the suppliedFloatBufferstarting at the specified absolute buffer position/index.This method will not increment the position of the given FloatBuffer.
- Specified by:
get3x3in interfaceMatrix3x2fc- Parameters:
index- the absolute position into the FloatBufferbuffer- will receive the values of this matrix in column-major order- Returns:
- the passed in buffer
-
get3x3
public java.nio.ByteBuffer get3x3(java.nio.ByteBuffer buffer)
Store this matrix as an equivalent 3x3 matrix in column-major order into the suppliedByteBufferat the current bufferposition.This method will not increment the position of the given ByteBuffer.
In order to specify the offset into the ByteBuffer at which the matrix is stored, use
get3x3(int, ByteBuffer), taking the absolute position as parameter.- Specified by:
get3x3in interfaceMatrix3x2fc- Parameters:
buffer- will receive the values of this matrix in column-major order at its current position- Returns:
- the passed in buffer
- See Also:
get3x3(int, ByteBuffer)
-
get3x3
public java.nio.ByteBuffer get3x3(int index, java.nio.ByteBuffer buffer)Store this matrix as an equivalent 3x3 matrix in column-major order into the suppliedByteBufferstarting at the specified absolute buffer position/index.This method will not increment the position of the given ByteBuffer.
- Specified by:
get3x3in interfaceMatrix3x2fc- Parameters:
index- the absolute position into the ByteBufferbuffer- will receive the values of this matrix in column-major order- Returns:
- the passed in buffer
-
get4x4
public java.nio.FloatBuffer get4x4(java.nio.FloatBuffer buffer)
Store this matrix as an equivalent 4x4 matrix in column-major order into the suppliedFloatBufferat the current bufferposition.This method will not increment the position of the given FloatBuffer.
In order to specify the offset into the FloatBuffer at which the matrix is stored, use
get4x4(int, FloatBuffer), taking the absolute position as parameter.- Specified by:
get4x4in interfaceMatrix3x2fc- Parameters:
buffer- will receive the values of this matrix in column-major order at its current position- Returns:
- the passed in buffer
- See Also:
get4x4(int, FloatBuffer)
-
get4x4
public java.nio.FloatBuffer get4x4(int index, java.nio.FloatBuffer buffer)Store this matrix as an equivalent 4x4 matrix in column-major order into the suppliedFloatBufferstarting at the specified absolute buffer position/index.This method will not increment the position of the given FloatBuffer.
- Specified by:
get4x4in interfaceMatrix3x2fc- Parameters:
index- the absolute position into the FloatBufferbuffer- will receive the values of this matrix in column-major order- Returns:
- the passed in buffer
-
get4x4
public java.nio.ByteBuffer get4x4(java.nio.ByteBuffer buffer)
Store this matrix as an equivalent 4x4 matrix in column-major order into the suppliedByteBufferat the current bufferposition.This method will not increment the position of the given ByteBuffer.
In order to specify the offset into the ByteBuffer at which the matrix is stored, use
get4x4(int, ByteBuffer), taking the absolute position as parameter.- Specified by:
get4x4in interfaceMatrix3x2fc- Parameters:
buffer- will receive the values of this matrix in column-major order at its current position- Returns:
- the passed in buffer
- See Also:
get4x4(int, ByteBuffer)
-
get4x4
public java.nio.ByteBuffer get4x4(int index, java.nio.ByteBuffer buffer)Store this matrix as an equivalent 4x4 matrix in column-major order into the suppliedByteBufferstarting at the specified absolute buffer position/index.This method will not increment the position of the given ByteBuffer.
- Specified by:
get4x4in interfaceMatrix3x2fc- Parameters:
index- the absolute position into the ByteBufferbuffer- will receive the values of this matrix in column-major order- Returns:
- the passed in buffer
-
getToAddress
public Matrix3x2fc getToAddress(long address)
Description copied from interface:Matrix3x2fcStore this matrix in column-major order at the given off-heap address.This method will throw an
UnsupportedOperationExceptionwhen JOML is used with `-Djoml.nounsafe`.This method is unsafe as it can result in a crash of the JVM process when the specified address range does not belong to this process.
- Specified by:
getToAddressin interfaceMatrix3x2fc- Parameters:
address- the off-heap address where to store this matrix- Returns:
- this
-
get
public float[] get(float[] arr, int offset)Store this matrix into the supplied float array in column-major order at the given offset.- Specified by:
getin interfaceMatrix3x2fc- Parameters:
arr- the array to write the matrix values intooffset- the offset into the array- Returns:
- the passed in array
-
get
public float[] get(float[] arr)
Store this matrix into the supplied float array in column-major order.In order to specify an explicit offset into the array, use the method
get(float[], int).- Specified by:
getin interfaceMatrix3x2fc- Parameters:
arr- the array to write the matrix values into- Returns:
- the passed in array
- See Also:
get(float[], int)
-
get3x3
public float[] get3x3(float[] arr, int offset)Store this matrix as an equivalent 3x3 matrix in column-major order into the supplied float array at the given offset.- Specified by:
get3x3in interfaceMatrix3x2fc- Parameters:
arr- the array to write the matrix values intooffset- the offset into the array- Returns:
- the passed in array
-
get3x3
public float[] get3x3(float[] arr)
Store this matrix as an equivalent 3x3 matrix in column-major order into the supplied float array.In order to specify an explicit offset into the array, use the method
get3x3(float[], int).- Specified by:
get3x3in interfaceMatrix3x2fc- Parameters:
arr- the array to write the matrix values into- Returns:
- the passed in array
- See Also:
get3x3(float[], int)
-
get4x4
public float[] get4x4(float[] arr, int offset)Store this matrix as an equivalent 4x4 matrix in column-major order into the supplied float array at the given offset.- Specified by:
get4x4in interfaceMatrix3x2fc- Parameters:
arr- the array to write the matrix values intooffset- the offset into the array- Returns:
- the passed in array
-
get4x4
public float[] get4x4(float[] arr)
Store this matrix as an equivalent 4x4 matrix in column-major order into the supplied float array.In order to specify an explicit offset into the array, use the method
get4x4(float[], int).- Specified by:
get4x4in interfaceMatrix3x2fc- Parameters:
arr- the array to write the matrix values into- Returns:
- the passed in array
- See Also:
get4x4(float[], int)
-
set
public Matrix3x2f set(java.nio.FloatBuffer buffer)
Set the values of this matrix by reading 6 float values from the givenFloatBufferin column-major order, starting at its current position.The FloatBuffer is expected to contain the values in column-major order.
The position of the FloatBuffer will not be changed by this method.
- Parameters:
buffer- the FloatBuffer to read the matrix values from in column-major order- Returns:
- this
-
set
public Matrix3x2f set(java.nio.ByteBuffer buffer)
Set the values of this matrix by reading 6 float values from the givenByteBufferin column-major order, starting at its current position.The ByteBuffer is expected to contain the values in column-major order.
The position of the ByteBuffer will not be changed by this method.
- Parameters:
buffer- the ByteBuffer to read the matrix values from in column-major order- Returns:
- this
-
set
public Matrix3x2f set(int index, java.nio.FloatBuffer buffer)
Set the values of this matrix by reading 6 float values from the givenFloatBufferin column-major order, starting at the specified absolute buffer position/index.The FloatBuffer is expected to contain the values in column-major order.
The position of the FloatBuffer will not be changed by this method.
- Parameters:
index- the absolute position into the FloatBufferbuffer- the FloatBuffer to read the matrix values from in column-major order- Returns:
- this
-
set
public Matrix3x2f set(int index, java.nio.ByteBuffer buffer)
Set the values of this matrix by reading 6 float values from the givenByteBufferin column-major order, starting at the specified absolute buffer position/index.The ByteBuffer is expected to contain the values in column-major order.
The position of the ByteBuffer will not be changed by this method.
- Parameters:
index- the absolute position into the ByteBufferbuffer- the ByteBuffer to read the matrix values from in column-major order- Returns:
- this
-
setFromAddress
public Matrix3x2f setFromAddress(long address)
Set the values of this matrix by reading 6 float values from off-heap memory in column-major order, starting at the given address.This method will throw an
UnsupportedOperationExceptionwhen JOML is used with `-Djoml.nounsafe`.This method is unsafe as it can result in a crash of the JVM process when the specified address range does not belong to this process.
- Parameters:
address- the off-heap memory address to read the matrix values from in column-major order- Returns:
- this
-
zero
public Matrix3x2f zero()
Set all values within this matrix to zero.- Returns:
- this
-
identity
public Matrix3x2f identity()
Set this matrix to the identity.- Returns:
- this
-
scale
public Matrix3x2f scale(float x, float y, Matrix3x2f dest)
Apply scaling to this matrix by scaling the unit axes by the given x and y and store the result indest.If
Misthismatrix andSthe scaling matrix, then the new matrix will beM * S. So when transforming a vectorvwith the new matrix by usingM * S * v, the scaling will be applied first!- Specified by:
scalein interfaceMatrix3x2fc- Parameters:
x- the factor of the x componenty- the factor of the y componentdest- will hold the result- Returns:
- dest
-
scale
public Matrix3x2f scale(float x, float y)
Apply scaling to this matrix by scaling the base axes by the given x and y factors.If
Misthismatrix andSthe scaling matrix, then the new matrix will beM * S. So when transforming a vectorvwith the new matrix by usingM * S * v, the scaling will be applied first!- Parameters:
x- the factor of the x componenty- the factor of the y component- Returns:
- this
-
scale
public Matrix3x2f scale(Vector2fc xy)
Apply scaling to this matrix by scaling the base axes by the givenxyfactors.If
Misthismatrix andSthe scaling matrix, then the new matrix will beM * S. So when transforming a vectorvwith the new matrix by usingM * S * v, the scaling will be applied first!- Parameters:
xy- the factors of the x and y component, respectively- Returns:
- this
-
scale
public Matrix3x2f scale(Vector2fc xy, Matrix3x2f dest)
Apply scaling to this matrix by scaling the base axes by the givenxyfactors and store the result indest.If
Misthismatrix andSthe scaling matrix, then the new matrix will beM * S. So when transforming a vectorvwith the new matrix by usingM * S * v, the scaling will be applied first!- Specified by:
scalein interfaceMatrix3x2fc- Parameters:
xy- the factors of the x and y component, respectivelydest- will hold the result- Returns:
- dest
-
scale
public Matrix3x2f scale(float xy, Matrix3x2f dest)
Apply scaling to this matrix by uniformly scaling the two base axes by the givenxyfactor and store the result indest.If
Misthismatrix andSthe scaling matrix, then the new matrix will beM * S. So when transforming a vectorvwith the new matrix by usingM * S * v, the scaling will be applied first!- Specified by:
scalein interfaceMatrix3x2fc- Parameters:
xy- the factor for the two componentsdest- will hold the result- Returns:
- dest
- See Also:
scale(float, float, Matrix3x2f)
-
scale
public Matrix3x2f scale(float xy)
Apply scaling to this matrix by uniformly scaling the two base axes by the givenxyzfactor.If
Misthismatrix andSthe scaling matrix, then the new matrix will beM * S. So when transforming a vectorvwith the new matrix by usingM * S * v, the scaling will be applied first!- Parameters:
xy- the factor for the two components- Returns:
- this
- See Also:
scale(float, float)
-
scaleLocal
public Matrix3x2f scaleLocal(float x, float y, Matrix3x2f dest)
Description copied from interface:Matrix3x2fcPre-multiply scaling tothismatrix by scaling the base axes by the given x and y factors and store the result indest.If
Misthismatrix andSthe scaling matrix, then the new matrix will beS * M. So when transforming a vectorvwith the new matrix by usingS * M * v, the scaling will be applied last!- Specified by:
scaleLocalin interfaceMatrix3x2fc- Parameters:
x- the factor of the x componenty- the factor of the y componentdest- will hold the result- Returns:
- dest
-
scaleLocal
public Matrix3x2f scaleLocal(float x, float y)
Pre-multiply scaling to this matrix by scaling the base axes by the given x and y factors.If
Misthismatrix andSthe scaling matrix, then the new matrix will beS * M. So when transforming a vectorvwith the new matrix by usingS * M * v, the scaling will be applied last!- Parameters:
x- the factor of the x componenty- the factor of the y component- Returns:
- this
-
scaleLocal
public Matrix3x2f scaleLocal(float xy, Matrix3x2f dest)
Description copied from interface:Matrix3x2fcPre-multiply scaling tothismatrix by scaling the two base axes by the givenxyfactor, and store the result indest.If
Misthismatrix andSthe scaling matrix, then the new matrix will beS * M. So when transforming a vectorvwith the new matrix by usingS * M * v, the scaling will be applied last!- Specified by:
scaleLocalin interfaceMatrix3x2fc- Parameters:
xy- the factor to scale all two base axes bydest- will hold the result- Returns:
- dest
-
scaleLocal
public Matrix3x2f scaleLocal(float xy)
Pre-multiply scaling to this matrix by scaling the base axes by the given xy factor.If
Misthismatrix andSthe scaling matrix, then the new matrix will beS * M. So when transforming a vectorvwith the new matrix by usingS * M * v, the scaling will be applied last!- Parameters:
xy- the factor of the x and y component- Returns:
- this
-
scaleAround
public Matrix3x2f scaleAround(float sx, float sy, float ox, float oy, Matrix3x2f dest)
Apply scaling tothismatrix by scaling the base axes by the given sx and sy factors while using(ox, oy)as the scaling origin, and store the result indest.If
Misthismatrix andSthe scaling matrix, then the new matrix will beM * S. So when transforming a vectorvwith the new matrix by usingM * S * v, the scaling will be applied first!This method is equivalent to calling:
translate(ox, oy, dest).scale(sx, sy).translate(-ox, -oy)- Specified by:
scaleAroundin interfaceMatrix3x2fc- Parameters:
sx- the scaling factor of the x componentsy- the scaling factor of the y componentox- the x coordinate of the scaling originoy- the y coordinate of the scaling origindest- will hold the result- Returns:
- dest
-
scaleAround
public Matrix3x2f scaleAround(float sx, float sy, float ox, float oy)
Apply scaling to this matrix by scaling the base axes by the given sx and sy factors while using(ox, oy)as the scaling origin.If
Misthismatrix andSthe scaling matrix, then the new matrix will beM * S. So when transforming a vectorvwith the new matrix by usingM * S * v, the scaling will be applied first!This method is equivalent to calling:
translate(ox, oy).scale(sx, sy).translate(-ox, -oy)- Parameters:
sx- the scaling factor of the x componentsy- the scaling factor of the y componentox- the x coordinate of the scaling originoy- the y coordinate of the scaling origin- Returns:
- this
-
scaleAround
public Matrix3x2f scaleAround(float factor, float ox, float oy, Matrix3x2f dest)
Apply scaling to this matrix by scaling the base axes by the givenfactorwhile using(ox, oy)as the scaling origin, and store the result indest.If
Misthismatrix andSthe scaling matrix, then the new matrix will beM * S. So when transforming a vectorvwith the new matrix by usingM * S * v, the scaling will be applied first!This method is equivalent to calling:
translate(ox, oy, dest).scale(factor).translate(-ox, -oy)- Specified by:
scaleAroundin interfaceMatrix3x2fc- Parameters:
factor- the scaling factor for all three axesox- the x coordinate of the scaling originoy- the y coordinate of the scaling origindest- will hold the result- Returns:
- this
-
scaleAround
public Matrix3x2f scaleAround(float factor, float ox, float oy)
Apply scaling to this matrix by scaling the base axes by the givenfactorwhile using(ox, oy)as the scaling origin.If
Misthismatrix andSthe scaling matrix, then the new matrix will beM * S. So when transforming a vectorvwith the new matrix by usingM * S * v, the scaling will be applied first!This method is equivalent to calling:
translate(ox, oy).scale(factor).translate(-ox, -oy)- Parameters:
factor- the scaling factor for all axesox- the x coordinate of the scaling originoy- the y coordinate of the scaling origin- Returns:
- this
-
scaleAroundLocal
public Matrix3x2f scaleAroundLocal(float sx, float sy, float ox, float oy, Matrix3x2f dest)
Description copied from interface:Matrix3x2fcPre-multiply scaling tothismatrix by scaling the base axes by the given sx and sy factors while using the given(ox, oy)as the scaling origin, and store the result indest.If
Misthismatrix andSthe scaling matrix, then the new matrix will beS * M. So when transforming a vectorvwith the new matrix by usingS * M * v, the scaling will be applied last!This method is equivalent to calling:
new Matrix3x2f().translate(ox, oy).scale(sx, sy).translate(-ox, -oy).mul(this, dest)- Specified by:
scaleAroundLocalin interfaceMatrix3x2fc- Parameters:
sx- the scaling factor of the x componentsy- the scaling factor of the y componentox- the x coordinate of the scaling originoy- the y coordinate of the scaling origindest- will hold the result- Returns:
- dest
-
scaleAroundLocal
public Matrix3x2f scaleAroundLocal(float factor, float ox, float oy, Matrix3x2f dest)
Description copied from interface:Matrix3x2fcPre-multiply scaling to this matrix by scaling the base axes by the givenfactorwhile using(ox, oy)as the scaling origin, and store the result indest.If
Misthismatrix andSthe scaling matrix, then the new matrix will beS * M. So when transforming a vectorvwith the new matrix by usingS * M * v, the scaling will be applied last!This method is equivalent to calling:
new Matrix3x2f().translate(ox, oy).scale(factor).translate(-ox, -oy).mul(this, dest)- Specified by:
scaleAroundLocalin interfaceMatrix3x2fc- Parameters:
factor- the scaling factor for all three axesox- the x coordinate of the scaling originoy- the y coordinate of the scaling origindest- will hold the result- Returns:
- this
-
scaleAroundLocal
public Matrix3x2f scaleAroundLocal(float sx, float sy, float sz, float ox, float oy, float oz)
Pre-multiply scaling to this matrix by scaling the base axes by the given sx and sy factors while using(ox, oy)as the scaling origin.If
Misthismatrix andSthe scaling matrix, then the new matrix will beS * M. So when transforming a vectorvwith the new matrix by usingS * M * v, the scaling will be applied last!This method is equivalent to calling:
new Matrix3x2f().translate(ox, oy).scale(sx, sy).translate(-ox, -oy).mul(this, this)- Parameters:
sx- the scaling factor of the x componentsy- the scaling factor of the y componentsz- the scaling factor of the z componentox- the x coordinate of the scaling originoy- the y coordinate of the scaling originoz- the z coordinate of the scaling origin- Returns:
- this
-
scaleAroundLocal
public Matrix3x2f scaleAroundLocal(float factor, float ox, float oy)
Pre-multiply scaling to this matrix by scaling the base axes by the givenfactorwhile using(ox, oy)as the scaling origin.If
Misthismatrix andSthe scaling matrix, then the new matrix will beS * M. So when transforming a vectorvwith the new matrix by usingS * M * v, the scaling will be applied last!This method is equivalent to calling:
new Matrix3x2f().translate(ox, oy).scale(factor).translate(-ox, -oy).mul(this, this)- Parameters:
factor- the scaling factor for all three axesox- the x coordinate of the scaling originoy- the y coordinate of the scaling origin- Returns:
- this
-
scaling
public Matrix3x2f scaling(float factor)
Set this matrix to be a simple scale matrix, which scales the two base axes uniformly by the given factor.The resulting matrix can be multiplied against another transformation matrix to obtain an additional scaling.
In order to post-multiply a scaling transformation directly to a matrix, use
scale()instead.- Parameters:
factor- the scale factor in x and y- Returns:
- this
- See Also:
scale(float)
-
scaling
public Matrix3x2f scaling(float x, float y)
Set this matrix to be a simple scale matrix.- Parameters:
x- the scale in xy- the scale in y- Returns:
- this
-
rotation
public Matrix3x2f rotation(float angle)
Set this matrix to a rotation matrix which rotates the given radians.The resulting matrix can be multiplied against another transformation matrix to obtain an additional rotation.
In order to apply the rotation transformation to an existing transformation, use
rotate()instead.- Parameters:
angle- the angle in radians- Returns:
- this
- See Also:
rotate(float)
-
transform
public Vector3f transform(Vector3f v)
Transform/multiply the given vector by this matrix by assuming a third row in this matrix of(0, 0, 1)and store the result in that vector.- Specified by:
transformin interfaceMatrix3x2fc- Parameters:
v- the vector to transform and to hold the final result- Returns:
- v
- See Also:
Vector3f.mul(Matrix3x2fc)
-
transform
public Vector3f transform(Vector3f v, Vector3f dest)
Transform/multiply the given vector by this matrix by assuming a third row in this matrix of(0, 0, 1)and store the result indest.- Specified by:
transformin interfaceMatrix3x2fc- Parameters:
v- the vector to transformdest- will contain the result- Returns:
- dest
- See Also:
Vector3f.mul(Matrix3x2fc, Vector3f)
-
transform
public Vector3f transform(float x, float y, float z, Vector3f dest)
Transform/multiply the given vector(x, y, z)by this matrix and store the result indest.- Specified by:
transformin interfaceMatrix3x2fc- Parameters:
x- the x component of the vector to transformy- the y component of the vector to transformz- the z component of the vector to transformdest- will contain the result- Returns:
- dest
-
transformPosition
public Vector2f transformPosition(Vector2f v)
Transform/multiply the given 2D-vector, as if it was a 3D-vector with z=1, by this matrix and store the result in that vector.The given 2D-vector is treated as a 3D-vector with its z-component being 1.0, so it will represent a position/location in 2D-space rather than a direction.
In order to store the result in another vector, use
transformPosition(Vector2fc, Vector2f).- Specified by:
transformPositionin interfaceMatrix3x2fc- Parameters:
v- the vector to transform and to hold the final result- Returns:
- v
- See Also:
transformPosition(Vector2fc, Vector2f),transform(Vector3f)
-
transformPosition
public Vector2f transformPosition(Vector2fc v, Vector2f dest)
Transform/multiply the given 2D-vector, as if it was a 3D-vector with z=1, by this matrix and store the result indest.The given 2D-vector is treated as a 3D-vector with its z-component being 1.0, so it will represent a position/location in 2D-space rather than a direction.
In order to store the result in the same vector, use
transformPosition(Vector2f).- Specified by:
transformPositionin interfaceMatrix3x2fc- Parameters:
v- the vector to transformdest- will hold the result- Returns:
- dest
- See Also:
transformPosition(Vector2f),transform(Vector3f, Vector3f)
-
transformPosition
public Vector2f transformPosition(float x, float y, Vector2f dest)
Transform/multiply the given 2D-vector(x, y), as if it was a 3D-vector with z=1, by this matrix and store the result indest.The given 2D-vector is treated as a 3D-vector with its z-component being 1.0, so it will represent a position/location in 2D-space rather than a direction.
In order to store the result in the same vector, use
transformPosition(Vector2f).- Specified by:
transformPositionin interfaceMatrix3x2fc- Parameters:
x- the x component of the vector to transformy- the y component of the vector to transformdest- will hold the result- Returns:
- dest
- See Also:
transformPosition(Vector2f),transform(Vector3f, Vector3f)
-
transformDirection
public Vector2f transformDirection(Vector2f v)
Transform/multiply the given 2D-vector, as if it was a 3D-vector with z=0, by this matrix and store the result in that vector.The given 2D-vector is treated as a 3D-vector with its z-component being
0.0, so it will represent a direction in 2D-space rather than a position. This method will therefore not take the translation part of the matrix into account.In order to store the result in another vector, use
transformDirection(Vector2fc, Vector2f).- Specified by:
transformDirectionin interfaceMatrix3x2fc- Parameters:
v- the vector to transform and to hold the final result- Returns:
- v
- See Also:
transformDirection(Vector2fc, Vector2f)
-
transformDirection
public Vector2f transformDirection(Vector2fc v, Vector2f dest)
Transform/multiply the given 2D-vector, as if it was a 3D-vector with z=0, by this matrix and store the result indest.The given 2D-vector is treated as a 3D-vector with its z-component being
0.0, so it will represent a direction in 2D-space rather than a position. This method will therefore not take the translation part of the matrix into account.In order to store the result in the same vector, use
transformDirection(Vector2f).- Specified by:
transformDirectionin interfaceMatrix3x2fc- Parameters:
v- the vector to transformdest- will hold the result- Returns:
- dest
- See Also:
transformDirection(Vector2f)
-
transformDirection
public Vector2f transformDirection(float x, float y, Vector2f dest)
Transform/multiply the given 2D-vector(x, y), as if it was a 3D-vector with z=0, by this matrix and store the result indest.The given 2D-vector is treated as a 3D-vector with its z-component being
0.0, so it will represent a direction in 2D-space rather than a position. This method will therefore not take the translation part of the matrix into account.In order to store the result in the same vector, use
transformDirection(Vector2f).- Specified by:
transformDirectionin interfaceMatrix3x2fc- Parameters:
x- the x component of the vector to transformy- the y component of the vector to transformdest- will hold the result- Returns:
- dest
- See Also:
transformDirection(Vector2f)
-
writeExternal
public void writeExternal(java.io.ObjectOutput out) throws java.io.IOException- Specified by:
writeExternalin interfacejava.io.Externalizable- Throws:
java.io.IOException
-
readExternal
public void readExternal(java.io.ObjectInput in) throws java.io.IOException- Specified by:
readExternalin interfacejava.io.Externalizable- Throws:
java.io.IOException
-
rotate
public Matrix3x2f rotate(float ang)
Apply a rotation transformation to this matrix by rotating the given amount of radians.If
Misthismatrix andRthe rotation matrix, then the new matrix will beM * R. So when transforming a vectorvwith the new matrix by usingM * R * v, the rotation will be applied first!- Parameters:
ang- the angle in radians- Returns:
- this
-
rotate
public Matrix3x2f rotate(float ang, Matrix3x2f dest)
Apply a rotation transformation to this matrix by rotating the given amount of radians and store the result indest.If
Misthismatrix andRthe rotation matrix, then the new matrix will beM * R. So when transforming a vectorvwith the new matrix by usingM * R * v, the rotation will be applied first!- Specified by:
rotatein interfaceMatrix3x2fc- Parameters:
ang- the angle in radiansdest- will hold the result- Returns:
- dest
-
rotateLocal
public Matrix3x2f rotateLocal(float ang, Matrix3x2f dest)
Pre-multiply a rotation to this matrix by rotating the given amount of radians and store the result indest.If
Misthismatrix andRthe rotation matrix, then the new matrix will beR * M. So when transforming a vectorvwith the new matrix by usingR * M * v, the rotation will be applied last!In order to set the matrix to a rotation matrix without pre-multiplying the rotation transformation, use
rotation().Reference: http://en.wikipedia.org
- Specified by:
rotateLocalin interfaceMatrix3x2fc- Parameters:
ang- the angle in radians to rotatedest- will hold the result- Returns:
- dest
- See Also:
rotation(float)
-
rotateLocal
public Matrix3x2f rotateLocal(float ang)
Pre-multiply a rotation to this matrix by rotating the given amount of radians.If
Misthismatrix andRthe rotation matrix, then the new matrix will beR * M. So when transforming a vectorvwith the new matrix by usingR * M * v, the rotation will be applied last!In order to set the matrix to a rotation matrix without pre-multiplying the rotation transformation, use
rotation().Reference: http://en.wikipedia.org
- Parameters:
ang- the angle in radians to rotate- Returns:
- this
- See Also:
rotation(float)
-
rotateAbout
public Matrix3x2f rotateAbout(float ang, float x, float y)
Apply a rotation transformation to this matrix by rotating the given amount of radians about the specified rotation center(x, y).This method is equivalent to calling:
translate(x, y).rotate(ang).translate(-x, -y)If
Misthismatrix andRthe rotation matrix, then the new matrix will beM * R. So when transforming a vectorvwith the new matrix by usingM * R * v, the rotation will be applied first!- Parameters:
ang- the angle in radiansx- the x component of the rotation centery- the y component of the rotation center- Returns:
- this
- See Also:
translate(float, float),rotate(float)
-
rotateAbout
public Matrix3x2f rotateAbout(float ang, float x, float y, Matrix3x2f dest)
Apply a rotation transformation to this matrix by rotating the given amount of radians about the specified rotation center(x, y)and store the result indest.This method is equivalent to calling:
translate(x, y, dest).rotate(ang).translate(-x, -y)If
Misthismatrix andRthe rotation matrix, then the new matrix will beM * R. So when transforming a vectorvwith the new matrix by usingM * R * v, the rotation will be applied first!- Specified by:
rotateAboutin interfaceMatrix3x2fc- Parameters:
ang- the angle in radiansx- the x component of the rotation centery- the y component of the rotation centerdest- will hold the result- Returns:
- dest
- See Also:
translate(float, float, Matrix3x2f),rotate(float, Matrix3x2f)
-
rotateTo
public Matrix3x2f rotateTo(Vector2fc fromDir, Vector2fc toDir, Matrix3x2f dest)
Apply a rotation transformation to this matrix that rotates the given normalizedfromDirdirection vector to point along the normalizedtoDir, and store the result indest.If
Misthismatrix andRthe rotation matrix, then the new matrix will beM * R. So when transforming a vectorvwith the new matrix by usingM * R * v, the rotation will be applied first!- Specified by:
rotateToin interfaceMatrix3x2fc- Parameters:
fromDir- the normalized direction which should be rotate to point alongtoDirtoDir- the normalized destination directiondest- will hold the result- Returns:
- dest
-
rotateTo
public Matrix3x2f rotateTo(Vector2fc fromDir, Vector2fc toDir)
Apply a rotation transformation to this matrix that rotates the given normalizedfromDirdirection vector to point along the normalizedtoDir.If
Misthismatrix andRthe rotation matrix, then the new matrix will beM * R. So when transforming a vectorvwith the new matrix by usingM * R * v, the rotation will be applied first!- Parameters:
fromDir- the normalized direction which should be rotate to point alongtoDirtoDir- the normalized destination direction- Returns:
- this
-
view
public Matrix3x2f view(float left, float right, float bottom, float top, Matrix3x2f dest)
Apply a "view" transformation to this matrix that maps the given(left, bottom)and(right, top)corners to(-1, -1)and(1, 1)respectively and store the result indest.If
Misthismatrix andOthe orthographic projection matrix, then the new matrix will beM * O. So when transforming a vectorvwith the new matrix by usingM * O * v, the orthographic projection transformation will be applied first!- Specified by:
viewin interfaceMatrix3x2fc- Parameters:
left- the distance from the center to the left view edgeright- the distance from the center to the right view edgebottom- the distance from the center to the bottom view edgetop- the distance from the center to the top view edgedest- will hold the result- Returns:
- dest
- See Also:
setView(float, float, float, float)
-
view
public Matrix3x2f view(float left, float right, float bottom, float top)
Apply a "view" transformation to this matrix that maps the given(left, bottom)and(right, top)corners to(-1, -1)and(1, 1)respectively.If
Misthismatrix andOthe orthographic projection matrix, then the new matrix will beM * O. So when transforming a vectorvwith the new matrix by usingM * O * v, the orthographic projection transformation will be applied first!- Parameters:
left- the distance from the center to the left view edgeright- the distance from the center to the right view edgebottom- the distance from the center to the bottom view edgetop- the distance from the center to the top view edge- Returns:
- this
- See Also:
setView(float, float, float, float)
-
setView
public Matrix3x2f setView(float left, float right, float bottom, float top)
Set this matrix to define a "view" transformation that maps the given(left, bottom)and(right, top)corners to(-1, -1)and(1, 1)respectively.- Parameters:
left- the distance from the center to the left view edgeright- the distance from the center to the right view edgebottom- the distance from the center to the bottom view edgetop- the distance from the center to the top view edge- Returns:
- this
- See Also:
view(float, float, float, float)
-
origin
public Vector2f origin(Vector2f origin)
Obtain the position that gets transformed to the origin bythismatrix. This can be used to get the position of the "camera" from a given view transformation matrix.This method is equivalent to the following code:
Matrix3x2f inv = new Matrix3x2f(this).invert(); inv.transform(origin.set(0, 0));
- Specified by:
originin interfaceMatrix3x2fc- Parameters:
origin- will hold the position transformed to the origin- Returns:
- origin
-
viewArea
public float[] viewArea(float[] area)
Obtain the extents of the view transformation ofthismatrix and store it inarea. This can be used to determine which region of the screen (i.e. the NDC space) is covered by the view.- Specified by:
viewAreain interfaceMatrix3x2fc- Parameters:
area- will hold the view area as[minX, minY, maxX, maxY]- Returns:
- area
-
positiveX
public Vector2f positiveX(Vector2f dir)
Description copied from interface:Matrix3x2fcObtain the direction of+Xbefore the transformation represented bythismatrix is applied.This method uses the rotation component of the left 2x2 submatrix to obtain the direction that is transformed to
+Xbythismatrix.This method is equivalent to the following code:
Matrix3x2f inv = new Matrix3x2f(this).invert(); inv.transformDirection(dir.set(1, 0)).normalize();
Ifthisis already an orthogonal matrix, then consider usingMatrix3x2fc.normalizedPositiveX(Vector2f)instead.Reference: http://www.euclideanspace.com
- Specified by:
positiveXin interfaceMatrix3x2fc- Parameters:
dir- will hold the direction of+X- Returns:
- dir
-
normalizedPositiveX
public Vector2f normalizedPositiveX(Vector2f dir)
Description copied from interface:Matrix3x2fcObtain the direction of+Xbefore the transformation represented bythisorthogonal matrix is applied. This method only produces correct results ifthisis an orthogonal matrix.This method uses the rotation component of the left 2x2 submatrix to obtain the direction that is transformed to
+Xbythismatrix.This method is equivalent to the following code:
Matrix3x2f inv = new Matrix3x2f(this).transpose(); inv.transformDirection(dir.set(1, 0));
Reference: http://www.euclideanspace.com
- Specified by:
normalizedPositiveXin interfaceMatrix3x2fc- Parameters:
dir- will hold the direction of+X- Returns:
- dir
-
positiveY
public Vector2f positiveY(Vector2f dir)
Description copied from interface:Matrix3x2fcObtain the direction of+Ybefore the transformation represented bythismatrix is applied.This method uses the rotation component of the left 2x2 submatrix to obtain the direction that is transformed to
+Ybythismatrix.This method is equivalent to the following code:
Matrix3x2f inv = new Matrix3x2f(this).invert(); inv.transformDirection(dir.set(0, 1)).normalize();
Ifthisis already an orthogonal matrix, then consider usingMatrix3x2fc.normalizedPositiveY(Vector2f)instead.Reference: http://www.euclideanspace.com
- Specified by:
positiveYin interfaceMatrix3x2fc- Parameters:
dir- will hold the direction of+Y- Returns:
- dir
-
normalizedPositiveY
public Vector2f normalizedPositiveY(Vector2f dir)
Description copied from interface:Matrix3x2fcObtain the direction of+Ybefore the transformation represented bythisorthogonal matrix is applied. This method only produces correct results ifthisis an orthogonal matrix.This method uses the rotation component of the left 2x2 submatrix to obtain the direction that is transformed to
+Ybythismatrix.This method is equivalent to the following code:
Matrix3x2f inv = new Matrix3x2f(this).transpose(); inv.transformDirection(dir.set(0, 1));
Reference: http://www.euclideanspace.com
- Specified by:
normalizedPositiveYin interfaceMatrix3x2fc- Parameters:
dir- will hold the direction of+Y- Returns:
- dir
-
unproject
public Vector2f unproject(float winX, float winY, int[] viewport, Vector2f dest)
Unproject the given window coordinates(winX, winY)bythismatrix using the specified viewport.This method first converts the given window coordinates to normalized device coordinates in the range
[-1..1]and then transforms those NDC coordinates by the inverse ofthismatrix.As a necessary computation step for unprojecting, this method computes the inverse of
thismatrix. In order to avoid computing the matrix inverse with every invocation, the inverse ofthismatrix can be built once outside usinginvert(Matrix3x2f)and then the methodunprojectInv()can be invoked on it.- Specified by:
unprojectin interfaceMatrix3x2fc- Parameters:
winX- the x-coordinate in window coordinates (pixels)winY- the y-coordinate in window coordinates (pixels)viewport- the viewport described by[x, y, width, height]dest- will hold the unprojected position- Returns:
- dest
- See Also:
unprojectInv(float, float, int[], Vector2f),invert(Matrix3x2f)
-
unprojectInv
public Vector2f unprojectInv(float winX, float winY, int[] viewport, Vector2f dest)
Unproject the given window coordinates(winX, winY)bythismatrix using the specified viewport.This method differs from
unproject()in that it assumes thatthisis already the inverse matrix of the original projection matrix. It exists to avoid recomputing the matrix inverse with every invocation.- Specified by:
unprojectInvin interfaceMatrix3x2fc- Parameters:
winX- the x-coordinate in window coordinates (pixels)winY- the y-coordinate in window coordinates (pixels)viewport- the viewport described by[x, y, width, height]dest- will hold the unprojected position- Returns:
- dest
- See Also:
unproject(float, float, int[], Vector2f)
-
shearX
public Matrix3x2f shearX(float yFactor)
Apply shearing to this matrix by shearing along the X axis using the Y axis factoryFactor.- Parameters:
yFactor- the factor for the Y component to shear along the X axis- Returns:
- this
-
shearX
public Matrix3x2f shearX(float yFactor, Matrix3x2f dest)
Apply shearing to this matrix by shearing along the X axis using the Y axis factoryFactor, and store the result indest.- Parameters:
yFactor- the factor for the Y component to shear along the X axisdest- will hold the result- Returns:
- dest
-
shearY
public Matrix3x2f shearY(float xFactor)
Apply shearing to this matrix by shearing along the Y axis using the X axis factorxFactor.- Parameters:
xFactor- the factor for the X component to shear along the Y axis- Returns:
- this
-
shearY
public Matrix3x2f shearY(float xFactor, Matrix3x2f dest)
Apply shearing to this matrix by shearing along the Y axis using the X axis factorxFactor, and store the result indest.- Parameters:
xFactor- the factor for the X component to shear along the Y axisdest- will hold the result- Returns:
- dest
-
span
public Matrix3x2f span(Vector2f corner, Vector2f xDir, Vector2f yDir)
Compute the extents of the coordinate system before this transformation was applied and store the resulting corner coordinates incornerand the span vectors inxDirandyDir.That means, given the maximum extents of the coordinate system between
[-1..+1]in all dimensions, this method returns one corner and the length and direction of the two base axis vectors in the coordinate system before this transformation is applied, which transforms into the corner coordinates[-1, +1].- Parameters:
corner- will hold one corner of the spanxDir- will hold the direction and length of the span along the positive X axisyDir- will hold the direction and length of the span along the positive Y axis- Returns:
- this
-
testPoint
public boolean testPoint(float x, float y)Description copied from interface:Matrix3x2fcTest whether the given point(x, y)is within the frustum defined bythismatrix.This method assumes
thismatrix to be a transformation from any arbitrary coordinate system/spaceMinto standard OpenGL clip space and tests whether the given point with the coordinates(x, y, z)given in spaceMis within the clip space.Reference: Fast Extraction of Viewing Frustum Planes from the World-View-Projection Matrix
- Specified by:
testPointin interfaceMatrix3x2fc- Parameters:
x- the x-coordinate of the pointy- the y-coordinate of the point- Returns:
trueif the given point is inside the frustum;falseotherwise
-
testCircle
public boolean testCircle(float x, float y, float r)Description copied from interface:Matrix3x2fcTest whether the given circle is partly or completely within or outside of the frustum defined bythismatrix.This method assumes
thismatrix to be a transformation from any arbitrary coordinate system/spaceMinto standard OpenGL clip space and tests whether the given sphere with the coordinates(x, y, z)given in spaceMis within the clip space.Reference: Fast Extraction of Viewing Frustum Planes from the World-View-Projection Matrix
- Specified by:
testCirclein interfaceMatrix3x2fc- Parameters:
x- the x-coordinate of the circle's centery- the y-coordinate of the circle's centerr- the circle's radius- Returns:
trueif the given circle is partly or completely inside the frustum;falseotherwise
-
testAar
public boolean testAar(float minX, float minY, float maxX, float maxY)Description copied from interface:Matrix3x2fcTest whether the given axis-aligned rectangle is partly or completely within or outside of the frustum defined bythismatrix. The rectangle is specified via its min and max corner coordinates.This method assumes
thismatrix to be a transformation from any arbitrary coordinate system/spaceMinto standard OpenGL clip space and tests whether the given axis-aligned rectangle with its minimum corner coordinates(minX, minY, minZ)and maximum corner coordinates(maxX, maxY, maxZ)given in spaceMis within the clip space.Reference: Efficient View Frustum Culling
Reference: Fast Extraction of Viewing Frustum Planes from the World-View-Projection Matrix- Specified by:
testAarin interfaceMatrix3x2fc- Parameters:
minX- the x-coordinate of the minimum cornerminY- the y-coordinate of the minimum cornermaxX- the x-coordinate of the maximum cornermaxY- the y-coordinate of the maximum corner- Returns:
trueif the axis-aligned box is completely or partly inside of the frustum;falseotherwise
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equalsin classjava.lang.Object
-
equals
public boolean equals(Matrix3x2fc m, float delta)
Description copied from interface:Matrix3x2fcCompare the matrix elements ofthismatrix with the given matrix using the givendeltaand return whether all of them are equal within a maximum difference ofdelta.Please note that this method is not used by any data structure such as
ArrayListHashSetorHashMapand their operations, such asArrayList.contains(Object)orHashSet.remove(Object), since those data structures only use theObject.equals(Object)andObject.hashCode()methods.- Specified by:
equalsin interfaceMatrix3x2fc- Parameters:
m- the other matrixdelta- the allowed maximum difference- Returns:
truewhether all of the matrix elements are equal;falseotherwise
-
isFinite
public boolean isFinite()
Description copied from interface:Matrix3x2fcDetermine whether all matrix elements are finite floating-point values, that is, they are notNaNand notinfinity.- Specified by:
isFinitein interfaceMatrix3x2fc- Returns:
trueif all components are finite floating-point values;falseotherwise
-
clone
public java.lang.Object clone() throws java.lang.CloneNotSupportedException- Overrides:
clonein classjava.lang.Object- Throws:
java.lang.CloneNotSupportedException
-
-