public interface Matrix3x2fc
| Modifier and Type | Method and Description |
|---|---|
float |
determinant()
Return the determinant of this matrix.
|
boolean |
equals(Matrix3x2fc m,
float delta)
Compare the matrix elements of
this matrix with the given matrix using the given delta
and return whether all of them are equal within a maximum difference of delta. |
ByteBuffer |
get(ByteBuffer buffer)
Store this matrix in column-major order into the supplied
ByteBuffer at the current
buffer position. |
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.
|
FloatBuffer |
get(FloatBuffer buffer)
Store this matrix in column-major order into the supplied
FloatBuffer at the current
buffer position. |
ByteBuffer |
get(int index,
ByteBuffer buffer)
Store this matrix in column-major order into the supplied
ByteBuffer starting at the specified
absolute buffer position/index. |
FloatBuffer |
get(int index,
FloatBuffer buffer)
Store this matrix in column-major order into the supplied
FloatBuffer starting at the specified
absolute buffer position/index. |
Matrix3x2f |
get(Matrix3x2f dest)
Get the current values of
this matrix and store them into
dest. |
ByteBuffer |
get3x3(ByteBuffer buffer)
Store this matrix as an equivalent 3x3 matrix in column-major order into the supplied
ByteBuffer at the current
buffer position. |
float[] |
get3x3(float[] arr)
Store this matrix as an equivalent 3x3 matrix into the supplied float array in column-major order.
|
float[] |
get3x3(float[] arr,
int offset)
Store this matrix as an equivalent 3x3 matrix into the supplied float array in column-major order at the given offset.
|
FloatBuffer |
get3x3(FloatBuffer buffer)
Store this matrix as an equivalent 3x3 matrix in column-major order into the supplied
FloatBuffer at the current
buffer position. |
ByteBuffer |
get3x3(int index,
ByteBuffer buffer)
Store this matrix as an equivalent 3x3 matrix in column-major order into the supplied
ByteBuffer starting at the specified
absolute buffer position/index. |
FloatBuffer |
get3x3(int index,
FloatBuffer buffer)
Store this matrix as an equivalent 3x3 matrix in column-major order into the supplied
FloatBuffer starting at the specified
absolute buffer position/index. |
ByteBuffer |
get4x4(ByteBuffer buffer)
Store this matrix as an equivalent 4x4 matrix in column-major order into the supplied
ByteBuffer at the current
buffer position. |
float[] |
get4x4(float[] arr)
Store this matrix as an equivalent 4x4 matrix into the supplied float array in column-major order.
|
float[] |
get4x4(float[] arr,
int offset)
Store this matrix as an equivalent 4x4 matrix into the supplied float array in column-major order at the given offset.
|
FloatBuffer |
get4x4(FloatBuffer buffer)
Store this matrix as an equivalent 4x4 matrix in column-major order into the supplied
FloatBuffer at the current
buffer position. |
ByteBuffer |
get4x4(int index,
ByteBuffer buffer)
Store this matrix as an equivalent 4x4 matrix in column-major order into the supplied
ByteBuffer starting at the specified
absolute buffer position/index. |
FloatBuffer |
get4x4(int index,
FloatBuffer buffer)
Store this matrix as an equivalent 4x4 matrix in column-major order into the supplied
FloatBuffer starting at the specified
absolute buffer position/index. |
Matrix3x2f |
invert(Matrix3x2f dest)
Invert the
this matrix by assuming a third row in this matrix of (0, 0, 1)
and store the result in dest. |
float |
m00()
Return the value of the matrix element at column 0 and row 0.
|
float |
m01()
Return the value of the matrix element at column 0 and row 1.
|
float |
m10()
Return the value of the matrix element at column 1 and row 0.
|
float |
m11()
Return the value of the matrix element at column 1 and row 1.
|
float |
m20()
Return the value of the matrix element at column 2 and row 0.
|
float |
m21()
Return the value of the matrix element at column 2 and row 1.
|
Matrix3x2f |
mul(Matrix3x2fc right,
Matrix3x2f dest)
Multiply this matrix by the supplied
right matrix by assuming a third row in
both matrices of (0, 0, 1) and store the result in dest. |
Matrix3x2f |
mulLocal(Matrix3x2fc left,
Matrix3x2f dest)
Pre-multiply this matrix by the supplied
left matrix and store the result in dest. |
Vector2f |
normalizedPositiveX(Vector2f dir)
Obtain the direction of
+X before the transformation represented by this orthogonal matrix is applied. |
Vector2f |
normalizedPositiveY(Vector2f dir)
Obtain the direction of
+Y before the transformation represented by this orthogonal matrix is applied. |
Vector2f |
origin(Vector2f origin)
Obtain the position that gets transformed to the origin by
this matrix. |
Vector2f |
positiveX(Vector2f dir)
Obtain the direction of
+X before the transformation represented by this matrix is applied. |
Vector2f |
positiveY(Vector2f dir)
Obtain the direction of
+Y before the transformation represented by this matrix is applied. |
Matrix3x2f |
rotate(float ang,
Matrix3x2f dest)
Apply a rotation transformation to this matrix by rotating the given amount of radians and store the result in
dest. |
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 in dest. |
Matrix3x2f |
rotateLocal(float ang,
Matrix3x2f dest)
Pre-multiply a rotation to this matrix by rotating the given amount of radians and store the result in
dest. |
Matrix3x2f |
rotateTo(Vector2fc fromDir,
Vector2fc toDir,
Matrix3x2f dest)
Apply a rotation transformation to this matrix that rotates the given normalized
fromDir direction vector
to point along the normalized toDir, and store the result in dest. |
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 in
dest. |
Matrix3x2f |
scale(float xy,
Matrix3x2f dest)
Apply scaling to this matrix by uniformly scaling the two base axes by the given
xy factor
and store the result in dest. |
Matrix3x2f |
scale(Vector2fc xy,
Matrix3x2f dest)
Apply scaling to this matrix by scaling the base axes by the given
xy factors
and store the result in dest. |
Matrix3x2f |
scaleAround(float sx,
float sy,
float ox,
float oy,
Matrix3x2f dest)
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, and store the result in dest. |
Matrix3x2f |
scaleAround(float factor,
float ox,
float oy,
Matrix3x2f dest)
Apply scaling to this matrix by scaling the base axes by the given
factor
while using (ox, oy) as the scaling origin,
and store the result in dest. |
Matrix3x2f |
scaleAroundLocal(float sx,
float sy,
float ox,
float oy,
Matrix3x2f dest)
Pre-multiply scaling to
this matrix 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 in dest. |
Matrix3x2f |
scaleAroundLocal(float factor,
float ox,
float oy,
Matrix3x2f dest)
Pre-multiply scaling to this matrix by scaling the base axes by the given
factor
while using (ox, oy) as the scaling origin,
and store the result in dest. |
Matrix3x2f |
scaleLocal(float x,
float y,
Matrix3x2f dest)
Pre-multiply scaling to
this matrix by scaling the base axes by the given x and y
factors and store the result in dest. |
Matrix3x2f |
scaleLocal(float xy,
Matrix3x2f dest)
Pre-multiply scaling to
this matrix by scaling the two base axes by the given xy factor,
and store the result in dest. |
boolean |
testAar(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 by
this matrix. |
boolean |
testCircle(float x,
float y,
float r)
Test whether the given circle is partly or completely within or outside of the frustum defined by
this matrix. |
boolean |
testPoint(float x,
float y)
Test whether the given point
(x, y) is within the frustum defined by this matrix. |
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 in dest. |
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. |
Vector3f |
transform(Vector3f v,
Vector3f dest)
Transform/multiply the given vector by this matrix and store the result in
dest. |
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 in dest. |
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.
|
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 in
dest. |
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 in dest. |
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.
|
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 in
dest. |
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
in
dest. |
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 in
dest. |
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 in
dest. |
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 in
dest. |
Vector2f |
unproject(float winX,
float winY,
int[] viewport,
Vector2f dest)
Unproject the given window coordinates
(winX, winY) by this matrix using the specified viewport. |
Vector2f |
unprojectInv(float winX,
float winY,
int[] viewport,
Vector2f dest)
Unproject the given window coordinates
(winX, winY) by this matrix using the specified viewport. |
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 in dest. |
float[] |
viewArea(float[] area)
Obtain the extents of the view transformation of
this matrix and store it in area. |
float m00()
float m01()
float m10()
float m11()
float m20()
float m21()
Matrix3x2f mul(Matrix3x2fc right, Matrix3x2f dest)
right matrix by assuming a third row in
both matrices of (0, 0, 1) and store the result in dest.
If M is this matrix and R the right matrix,
then the new matrix will be M * R. So when transforming a
vector v with the new matrix by using M * R * v, the
transformation of the right matrix will be applied first!
right - the right operand of the matrix multiplicationdest - will hold the resultMatrix3x2f mulLocal(Matrix3x2fc left, Matrix3x2f dest)
left matrix and store the result in dest.
If M is this matrix and L the left matrix,
then the new matrix will be L * M. So when transforming a
vector v with the new matrix by using L * M * v, the
transformation of this matrix will be applied first!
left - the left operand of the matrix multiplicationdest - the destination matrix, which will hold the resultfloat determinant()
Matrix3x2f invert(Matrix3x2f dest)
this matrix by assuming a third row in this matrix of (0, 0, 1)
and store the result in dest.dest - will hold the resultMatrix3x2f translate(float x, float y, Matrix3x2f dest)
dest.
If M is this matrix and T the translation
matrix, then the new matrix will be M * T. So when
transforming a vector v with the new matrix by using
M * T * v, the translation will be applied first!
x - the offset to translate in xy - the offset to translate in ydest - will hold the resultMatrix3x2f translate(Vector2fc offset, Matrix3x2f dest)
dest.
If M is this matrix and T the translation
matrix, then the new matrix will be M * T. So when
transforming a vector v with the new matrix by using
M * T * v, the translation will be applied first!
offset - the offset to translatedest - will hold the resultMatrix3x2f translateLocal(Vector2fc offset, Matrix3x2f dest)
dest.
If M is this matrix and T the translation
matrix, then the new matrix will be T * M. So when
transforming a vector v with the new matrix by using
T * M * v, the translation will be applied last!
offset - the number of units in x and y by which to translatedest - will hold the resultMatrix3x2f translateLocal(float x, float y, Matrix3x2f dest)
dest.
If M is this matrix and T the translation
matrix, then the new matrix will be T * M. So when
transforming a vector v with the new matrix by using
T * M * v, the translation will be applied last!
x - the offset to translate in xy - the offset to translate in ydest - will hold the resultMatrix3x2f get(Matrix3x2f dest)
this matrix and store them into
dest.dest - the destination matrixFloatBuffer get(FloatBuffer buffer)
FloatBuffer at the current
buffer position.
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.
buffer - will receive the values of this matrix in column-major order at its current positionget(int, FloatBuffer)FloatBuffer get(int index, FloatBuffer buffer)
FloatBuffer starting at the specified
absolute buffer position/index.
This method will not increment the position of the given FloatBuffer.
index - the absolute position into the FloatBufferbuffer - will receive the values of this matrix in column-major orderByteBuffer get(ByteBuffer buffer)
ByteBuffer at the current
buffer position.
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.
buffer - will receive the values of this matrix in column-major order at its current positionget(int, ByteBuffer)ByteBuffer get(int index, ByteBuffer buffer)
ByteBuffer starting at the specified
absolute buffer position/index.
This method will not increment the position of the given ByteBuffer.
index - the absolute position into the ByteBufferbuffer - will receive the values of this matrix in column-major orderFloatBuffer get3x3(FloatBuffer buffer)
FloatBuffer at the current
buffer position.
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.
buffer - will receive the values of this matrix in column-major order at its current positionget3x3(int, FloatBuffer)FloatBuffer get3x3(int index, FloatBuffer buffer)
FloatBuffer starting at the specified
absolute buffer position/index.
This method will not increment the position of the given FloatBuffer.
index - the absolute position into the FloatBufferbuffer - will receive the values of this matrix in column-major orderByteBuffer get3x3(ByteBuffer buffer)
ByteBuffer at the current
buffer position.
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.
buffer - will receive the values of this matrix in column-major order at its current positionget3x3(int, ByteBuffer)ByteBuffer get3x3(int index, ByteBuffer buffer)
ByteBuffer starting at the specified
absolute buffer position/index.
This method will not increment the position of the given ByteBuffer.
index - the absolute position into the ByteBufferbuffer - will receive the values of this matrix in column-major orderFloatBuffer get4x4(FloatBuffer buffer)
FloatBuffer at the current
buffer position.
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.
buffer - will receive the values of this matrix in column-major order at its current positionget4x4(int, FloatBuffer)FloatBuffer get4x4(int index, FloatBuffer buffer)
FloatBuffer starting at the specified
absolute buffer position/index.
This method will not increment the position of the given FloatBuffer.
index - the absolute position into the FloatBufferbuffer - will receive the values of this matrix in column-major orderByteBuffer get4x4(ByteBuffer buffer)
ByteBuffer at the current
buffer position.
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.
buffer - will receive the values of this matrix in column-major order at its current positionget4x4(int, ByteBuffer)ByteBuffer get4x4(int index, ByteBuffer buffer)
ByteBuffer starting at the specified
absolute buffer position/index.
This method will not increment the position of the given ByteBuffer.
index - the absolute position into the ByteBufferbuffer - will receive the values of this matrix in column-major orderfloat[] get(float[] arr,
int offset)
arr - the array to write the matrix values intooffset - the offset into the arrayfloat[] get(float[] arr)
In order to specify an explicit offset into the array, use the method get(float[], int).
arr - the array to write the matrix values intoget(float[], int)float[] get3x3(float[] arr,
int offset)
arr - the array to write the matrix values intooffset - the offset into the arrayfloat[] get3x3(float[] arr)
In order to specify an explicit offset into the array, use the method get3x3(float[], int).
arr - the array to write the matrix values intoget3x3(float[], int)float[] get4x4(float[] arr,
int offset)
arr - the array to write the matrix values intooffset - the offset into the arrayfloat[] get4x4(float[] arr)
In order to specify an explicit offset into the array, use the method get4x4(float[], int).
arr - the array to write the matrix values intoget4x4(float[], int)Matrix3x2f scale(float x, float y, Matrix3x2f dest)
dest.
If M is this matrix and S the scaling matrix,
then the new matrix will be M * S. So when transforming a
vector v with the new matrix by using M * S * v, the scaling will be applied first!
x - the factor of the x componenty - the factor of the y componentdest - will hold the resultMatrix3x2f scale(Vector2fc xy, Matrix3x2f dest)
xy factors
and store the result in dest.
If M is this matrix and S the scaling matrix,
then the new matrix will be M * S. So when transforming a
vector v with the new matrix by using M * S * v, the scaling will be applied first!
xy - the factors of the x and y component, respectivelydest - will hold the resultMatrix3x2f scaleAroundLocal(float sx, float sy, float ox, float oy, Matrix3x2f dest)
this matrix 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 in dest.
If M is this matrix and S the scaling matrix,
then the new matrix will be S * M. So when transforming a
vector v with the new matrix by using S * 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)
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 resultMatrix3x2f scaleAroundLocal(float factor, float ox, float oy, Matrix3x2f dest)
factor
while using (ox, oy) as the scaling origin,
and store the result in dest.
If M is this matrix and S the scaling matrix,
then the new matrix will be S * M. So when transforming a
vector v with the new matrix by using S * 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)
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 resultMatrix3x2f scale(float xy, Matrix3x2f dest)
xy factor
and store the result in dest.
If M is this matrix and S the scaling matrix,
then the new matrix will be M * S. So when transforming a
vector v with the new matrix by using M * S * v, the scaling will be applied first!
xy - the factor for the two componentsdest - will hold the resultscale(float, float, Matrix3x2f)Matrix3x2f scaleLocal(float xy, Matrix3x2f dest)
this matrix by scaling the two base axes by the given xy factor,
and store the result in dest.
If M is this matrix and S the scaling matrix,
then the new matrix will be S * M. So when transforming a
vector v with the new matrix by using S * M * v
, the scaling will be applied last!
xy - the factor to scale all two base axes bydest - will hold the resultMatrix3x2f scaleLocal(float x, float y, Matrix3x2f dest)
this matrix by scaling the base axes by the given x and y
factors and store the result in dest.
If M is this matrix and S the scaling matrix,
then the new matrix will be S * M. So when transforming a
vector v with the new matrix by using S * M * v
, the scaling will be applied last!
x - the factor of the x componenty - the factor of the y componentdest - will hold the resultMatrix3x2f scaleAround(float sx, float sy, float ox, float oy, Matrix3x2f dest)
this matrix by scaling the base axes by the given sx and
sy factors while using (ox, oy) as the scaling origin, and store the result in dest.
If M is this matrix and S the scaling matrix,
then the new matrix will be M * S. So when transforming a
vector v with the new matrix by using M * S * v
, the scaling will be applied first!
This method is equivalent to calling: translate(ox, oy, dest).scale(sx, sy).translate(-ox, -oy)
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 resultMatrix3x2f scaleAround(float factor, float ox, float oy, Matrix3x2f dest)
factor
while using (ox, oy) as the scaling origin,
and store the result in dest.
If M is this matrix and S the scaling matrix,
then the new matrix will be M * S. So when transforming a
vector v with the new matrix by using M * S * v, the
scaling will be applied first!
This method is equivalent to calling: translate(ox, oy, dest).scale(factor).translate(-ox, -oy)
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 resultVector3f transform(Vector3f v)
(0, 0, 1)
and store the result in that vector.v - the vector to transform and to hold the final resultVector3f.mul(Matrix3x2fc)Vector3f transform(Vector3f v, Vector3f dest)
dest.v - the vector to transformdest - will contain the resultVector3f.mul(Matrix3x2fc, Vector3f)Vector3f transform(float x, float y, float z, Vector3f dest)
(x, y, z) by this matrix and store the result in dest.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 resultVector2f transformPosition(Vector2f v)
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).
v - the vector to transform and to hold the final resulttransformPosition(Vector2fc, Vector2f),
transform(Vector3f)Vector2f transformPosition(Vector2fc v, Vector2f dest)
dest.
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).
v - the vector to transformdest - will hold the resulttransformPosition(Vector2f),
transform(Vector3f, Vector3f)Vector2f transformPosition(float x, float y, Vector2f dest)
(x, y), as if it was a 3D-vector with z=1, by
this matrix and store the result in dest.
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).
x - the x component of the vector to transformy - the y component of the vector to transformdest - will hold the resulttransformPosition(Vector2f),
transform(Vector3f, Vector3f)Vector2f transformDirection(Vector2f v)
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).
v - the vector to transform and to hold the final resulttransformDirection(Vector2fc, Vector2f)Vector2f transformDirection(Vector2fc v, Vector2f dest)
dest.
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).
v - the vector to transformdest - will hold the resulttransformDirection(Vector2f)Vector2f transformDirection(float x, float y, Vector2f dest)
(x, y), as if it was a 3D-vector with z=0, by
this matrix and store the result in dest.
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).
x - the x component of the vector to transformy - the y component of the vector to transformdest - will hold the resulttransformDirection(Vector2f)Matrix3x2f rotate(float ang, Matrix3x2f dest)
dest.
If M is this matrix and R the rotation matrix,
then the new matrix will be M * R. So when transforming a
vector v with the new matrix by using M * R * v, the rotation will be applied first!
ang - the angle in radiansdest - will hold the resultMatrix3x2f rotateLocal(float ang, Matrix3x2f dest)
dest.
If M is this matrix and R the rotation matrix,
then the new matrix will be R * M. So when transforming a
vector v with the new matrix by using R * M * v, the
rotation will be applied last!
Reference: http://en.wikipedia.org
ang - the angle in radiansdest - will hold the resultMatrix3x2f rotateAbout(float ang, float x, float y, Matrix3x2f dest)
(x, y) and store the result in dest.
This method is equivalent to calling: translate(x, y, dest).rotate(ang).translate(-x, -y)
If M is this matrix and R the rotation matrix,
then the new matrix will be M * R. So when transforming a
vector v with the new matrix by using M * R * v, the rotation will be applied first!
ang - the angle in radiansx - the x component of the rotation centery - the y component of the rotation centerdest - will hold the resulttranslate(float, float, Matrix3x2f),
rotate(float, Matrix3x2f)Matrix3x2f rotateTo(Vector2fc fromDir, Vector2fc toDir, Matrix3x2f dest)
fromDir direction vector
to point along the normalized toDir, and store the result in dest.
If M is this matrix and R the rotation matrix,
then the new matrix will be M * R. So when transforming a
vector v with the new matrix by using M * R * v, the rotation will be applied first!
fromDir - the normalized direction which should be rotate to point along toDirtoDir - the normalized destination directiondest - will hold the resultMatrix3x2f view(float left, float right, float bottom, float top, Matrix3x2f dest)
(left, bottom) and
(right, top) corners to (-1, -1) and (1, 1) respectively and store the result in dest.
If M is this matrix and O the orthographic projection matrix,
then the new matrix will be M * O. So when transforming a
vector v with the new matrix by using M * O * v, the
orthographic projection transformation will be applied first!
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 resultVector2f origin(Vector2f origin)
this matrix.
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).invertAffine(); inv.transform(origin.set(0, 0));
origin - will hold the position transformed to the originfloat[] viewArea(float[] area)
this matrix and store it in area.
This can be used to determine which region of the screen (i.e. the NDC space) is covered by the view.area - will hold the view area as [minX, minY, maxX, maxY]Vector2f positiveX(Vector2f dir)
+X before the transformation represented by this matrix is applied.
This method uses the rotation component of the left 2x2 submatrix to obtain the direction
that is transformed to +X by this matrix.
This method is equivalent to the following code:
Matrix3x2f inv = new Matrix3x2f(this).invert(); inv.transformDirection(dir.set(1, 0)).normalize();If
this is already an orthogonal matrix, then consider using normalizedPositiveX(Vector2f) instead.
Reference: http://www.euclideanspace.com
dir - will hold the direction of +XVector2f normalizedPositiveX(Vector2f dir)
+X before the transformation represented by this orthogonal matrix is applied.
This method only produces correct results if this is an orthogonal matrix.
This method uses the rotation component of the left 2x2 submatrix to obtain the direction
that is transformed to +X by this matrix.
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
dir - will hold the direction of +XVector2f positiveY(Vector2f dir)
+Y before the transformation represented by this matrix is applied.
This method uses the rotation component of the left 2x2 submatrix to obtain the direction
that is transformed to +Y by this matrix.
This method is equivalent to the following code:
Matrix3x2f inv = new Matrix3x2f(this).invert(); inv.transformDirection(dir.set(0, 1)).normalize();If
this is already an orthogonal matrix, then consider using normalizedPositiveY(Vector2f) instead.
Reference: http://www.euclideanspace.com
dir - will hold the direction of +YVector2f normalizedPositiveY(Vector2f dir)
+Y before the transformation represented by this orthogonal matrix is applied.
This method only produces correct results if this is an orthogonal matrix.
This method uses the rotation component of the left 2x2 submatrix to obtain the direction
that is transformed to +Y by this matrix.
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
dir - will hold the direction of +YVector2f unproject(float winX, float winY, int[] viewport, Vector2f dest)
(winX, winY) by this matrix 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 of this matrix.
As a necessary computation step for unprojecting, this method computes the inverse of this matrix.
In order to avoid computing the matrix inverse with every invocation, the inverse of this matrix can be built
once outside using invert(Matrix3x2f) and then the method unprojectInv() can be invoked on it.
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 positionunprojectInv(float, float, int[], Vector2f),
invert(Matrix3x2f)Vector2f unprojectInv(float winX, float winY, int[] viewport, Vector2f dest)
(winX, winY) by this matrix using the specified viewport.
This method differs from unproject()
in that it assumes that this is already the inverse matrix of the original projection matrix.
It exists to avoid recomputing the matrix inverse with every invocation.
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 positionunproject(float, float, int[], Vector2f)boolean testPoint(float x,
float y)
(x, y) is within the frustum defined by this matrix.
This method assumes this matrix to be a transformation from any arbitrary coordinate system/space M
into standard OpenGL clip space and tests whether the given point with the coordinates (x, y, z) given
in space M is within the clip space.
Reference: Fast Extraction of Viewing Frustum Planes from the World-View-Projection Matrix
x - the x-coordinate of the pointy - the y-coordinate of the pointtrue if the given point is inside the frustum; false otherwiseboolean testCircle(float x,
float y,
float r)
this matrix.
This method assumes this matrix to be a transformation from any arbitrary coordinate system/space M
into standard OpenGL clip space and tests whether the given sphere with the coordinates (x, y, z) given
in space M is within the clip space.
Reference: Fast Extraction of Viewing Frustum Planes from the World-View-Projection Matrix
x - the x-coordinate of the circle's centery - the y-coordinate of the circle's centerr - the circle's radiustrue if the given circle is partly or completely inside the frustum; false otherwiseboolean testAar(float minX,
float minY,
float maxX,
float maxY)
this matrix.
The rectangle is specified via its min and max corner coordinates.
This method assumes this matrix to be a transformation from any arbitrary coordinate system/space M
into 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 space M is within the clip space.
Reference: Efficient View Frustum Culling
Reference:
Fast Extraction of Viewing Frustum Planes from the World-View-Projection Matrix
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 cornertrue if the axis-aligned box is completely or partly inside of the frustum; false otherwiseboolean equals(Matrix3x2fc m, float delta)
this matrix with the given matrix using the given delta
and return whether all of them are equal within a maximum difference of delta.
Please note that this method is not used by any data structure such as ArrayList HashSet or HashMap
and their operations, such as ArrayList.contains(Object) or HashSet.remove(Object), since those
data structures only use the Object.equals(Object) and Object.hashCode() methods.
m - the other matrixdelta - the allowed maximum differencetrue whether all of the matrix elements are equal; false otherwiseCopyright © 2015–2019 JOML. All rights reserved.