public interface Matrix2fc
| Modifier and Type | Method and Description |
|---|---|
Matrix2f |
add(Matrix2fc other,
Matrix2f dest)
Component-wise add
this and other and store the result in dest. |
float |
determinant()
Return the determinant of this matrix.
|
boolean |
equals(Matrix2fc 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. |
float |
get(int column,
int row)
Get the matrix element value at the given column and row.
|
Matrix2f |
get(Matrix2f dest)
Get the current values of
this matrix and store them into
dest. |
Matrix3f |
get(Matrix3f dest)
Get the current values of
this matrix and store them as
the rotational component of dest. |
Matrix3x2f |
get(Matrix3x2f dest)
Get the current values of
this matrix and store them as
the rotational component of dest. |
Vector2f |
getColumn(int column,
Vector2f dest)
Get the column at the given
column index, starting with 0. |
float |
getRotation()
Get the angle of the rotation component of
this matrix. |
Vector2f |
getRow(int row,
Vector2f dest)
Get the row at the given
row index, starting with 0. |
Vector2f |
getScale(Vector2f dest)
Get the scaling factors of
this matrix for the three base axes. |
ByteBuffer |
getTransposed(ByteBuffer buffer)
Store the transpose of this matrix in column-major order into the supplied
ByteBuffer at the current
buffer position. |
FloatBuffer |
getTransposed(FloatBuffer buffer)
Store the transpose of this matrix in column-major order into the supplied
FloatBuffer at the current
buffer position. |
ByteBuffer |
getTransposed(int index,
ByteBuffer buffer)
Store the transpose of this matrix in column-major order into the supplied
ByteBuffer starting at the specified
absolute buffer position/index. |
FloatBuffer |
getTransposed(int index,
FloatBuffer buffer)
Store the transpose of this matrix in column-major order into the supplied
FloatBuffer starting at the specified
absolute buffer position/index. |
Matrix2f |
invert(Matrix2f dest)
Invert the
this matrix and store the result in dest. |
Matrix2f |
lerp(Matrix2fc other,
float t,
Matrix2f dest)
Linearly interpolate
this and other using the given interpolation factor t
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.
|
Matrix2f |
mul(Matrix2fc right,
Matrix2f dest)
Multiply this matrix by the supplied
right matrix and store the result in dest. |
Matrix2f |
mulComponentWise(Matrix2fc other,
Matrix2f dest)
Component-wise multiply
this by other and store the result in dest. |
Matrix2f |
mulLocal(Matrix2fc left,
Matrix2f dest)
Pre-multiply this matrix by the supplied
left matrix and store the result in dest. |
Matrix2f |
normal(Matrix2f dest)
Compute a normal matrix from
this matrix and store it into dest. |
Vector2f |
normalizedPositiveX(Vector2f dest)
Obtain the direction of
+X before the transformation represented by this orthogonal matrix is applied. |
Vector2f |
normalizedPositiveY(Vector2f dest)
Obtain the direction of
+Y before the transformation represented by this orthogonal matrix is applied. |
Vector2f |
positiveX(Vector2f dest)
Obtain the direction of
+X before the transformation represented by this matrix is applied. |
Vector2f |
positiveY(Vector2f dest)
Obtain the direction of
+Y before the transformation represented by this matrix is applied. |
Matrix2f |
rotate(float ang,
Matrix2f dest)
Apply rotation to this matrix by rotating the given amount of radians
and store the result in
dest. |
Matrix2f |
rotateLocal(float ang,
Matrix2f dest)
Pre-multiply a rotation to this matrix by rotating the given amount of radians
and store the result in
dest. |
Matrix2f |
scale(float x,
float y,
Matrix2f dest)
Apply scaling to this matrix by scaling the base axes by the given x and
y factors and store the result in
dest. |
Matrix2f |
scale(float xy,
Matrix2f dest)
Apply scaling to this matrix by uniformly scaling all base axes by the given
xy factor
and store the result in dest. |
Matrix2f |
scale(Vector2fc xy,
Matrix2f dest)
Apply scaling to
this matrix by scaling the base axes by the given xy.x and
xy.y factors, respectively and store the result in dest. |
Matrix2f |
scaleLocal(float x,
float y,
Matrix2f 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. |
Matrix2f |
sub(Matrix2fc subtrahend,
Matrix2f dest)
Component-wise subtract
subtrahend from this and store the result in dest. |
Vector2f |
transform(float x,
float y,
Vector2f dest)
Transform the vector
(x, y) by this matrix and store the result in dest. |
Vector2f |
transform(Vector2f v)
Transform the given vector by this matrix.
|
Vector2f |
transform(Vector2fc v,
Vector2f dest)
Transform the given vector by this matrix and store the result in
dest. |
Vector2f |
transformTranspose(float x,
float y,
Vector2f dest)
Transform the vector
(x, y) by the transpose of this matrix and store the result in dest. |
Vector2f |
transformTranspose(Vector2f v)
Transform the given vector by the transpose of this matrix.
|
Vector2f |
transformTranspose(Vector2fc v,
Vector2f dest)
Transform the given vector by the transpose of this matrix and store the result in
dest. |
Matrix2f |
transpose(Matrix2f dest)
Transpose
this matrix and store the result in dest. |
float m00()
float m01()
float m10()
float m11()
Matrix2f mul(Matrix2fc right, Matrix2f dest)
right matrix 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 resultMatrix2f mulLocal(Matrix2fc left, Matrix2f 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()
Matrix2f invert(Matrix2f dest)
this matrix and store the result in dest.dest - will hold the resultMatrix2f transpose(Matrix2f dest)
this matrix and store the result in dest.dest - will hold the resultMatrix2f get(Matrix2f dest)
this matrix and store them into
dest.dest - the destination matrixMatrix3x2f get(Matrix3x2f dest)
this matrix and store them as
the rotational component of dest. All other values of dest will
be set to 0.dest - the destination matrixMatrix3x2f.set(Matrix2fc)Matrix3f get(Matrix3f dest)
this matrix and store them as
the rotational component of dest. All other values of dest will
be set to identity.dest - the destination matrixMatrix3f.set(Matrix2fc)float getRotation()
this matrix.
This method assumes that there is a valid rotation to be returned, i.e. that
atan2(-m10, m00) == atan2(m01, m11).
FloatBuffer 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 getTransposed(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 getTransposed(int, FloatBuffer), taking
the absolute position as parameter.
buffer - will receive the values of this matrix in column-major order at its current positiongetTransposed(int, FloatBuffer)FloatBuffer getTransposed(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 getTransposed(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 getTransposed(int, ByteBuffer), taking
the absolute position as parameter.
buffer - will receive the values of this matrix in column-major order at its current positiongetTransposed(int, ByteBuffer)ByteBuffer getTransposed(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)Matrix2f scale(Vector2fc xy, Matrix2f dest)
this matrix by scaling the base axes by the given xy.x and
xy.y factors, respectively 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 resultMatrix2f scale(float x, float y, Matrix2f 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 resultMatrix2f scale(float xy, Matrix2f 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 all componentsdest - will hold the resultscale(float, float, Matrix2f)Matrix2f scaleLocal(float x, float y, Matrix2f 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 resultVector2f transform(Vector2f v)
v - the vector to transformVector2f transform(Vector2fc v, Vector2f dest)
dest.v - the vector to transformdest - will hold the resultVector2f transform(float x, float y, Vector2f dest)
(x, y) by this matrix and store the result in dest.x - the x coordinate of the vector to transformy - the y coordinate of the vector to transformdest - will hold the resultVector2f transformTranspose(Vector2f v)
v - the vector to transformVector2f transformTranspose(Vector2fc v, Vector2f dest)
dest.v - the vector to transformdest - will hold the resultVector2f transformTranspose(float x, float y, Vector2f dest)
(x, y) by the transpose of this matrix and store the result in dest.x - the x coordinate of the vector to transformy - the y coordinate of the vector to transformdest - will hold the resultMatrix2f rotate(float ang, Matrix2f dest)
dest.
The produced rotation will rotate a vector counter-clockwise around the origin.
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!
Reference: http://en.wikipedia.org
ang - the angle in radiansdest - will hold the resultMatrix2f rotateLocal(float ang, Matrix2f dest)
dest.
The produced rotation will rotate a vector counter-clockwise around the origin.
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 resultVector2f getRow(int row, Vector2f dest) throws IndexOutOfBoundsException
row index, starting with 0.row - the row index in [0..1]dest - will hold the row componentsIndexOutOfBoundsException - if row is not in [0..1]Vector2f getColumn(int column, Vector2f dest) throws IndexOutOfBoundsException
column index, starting with 0.column - the column index in [0..1]dest - will hold the column componentsIndexOutOfBoundsException - if column is not in [0..1]float get(int column,
int row)
column - the colum index in [0..1]row - the row index in [0..1]Matrix2f normal(Matrix2f dest)
this matrix and store it into dest.dest - will hold the resultVector2f getScale(Vector2f dest)
this matrix for the three base axes.dest - will hold the scaling factors for x and yVector2f positiveX(Vector2f dest)
+X before the transformation represented by this matrix is applied.
This method is equivalent to the following code:
Matrix2f inv = new Matrix2f(this).invert(); inv.transform(dir.set(1, 0)).normalize();If
this is already an orthogonal matrix, then consider using normalizedPositiveX(Vector2f) instead.dest - will hold the direction of +XVector2f normalizedPositiveX(Vector2f dest)
+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 is equivalent to the following code:
Matrix2f inv = new Matrix2f(this).transpose(); inv.transform(dir.set(1, 0));
dest - will hold the direction of +XVector2f positiveY(Vector2f dest)
+Y before the transformation represented by this matrix is applied.
This method is equivalent to the following code:
Matrix2f inv = new Matrix2f(this).invert(); inv.transform(dir.set(0, 1)).normalize();If
this is already an orthogonal matrix, then consider using normalizedPositiveY(Vector2f) instead.dest - will hold the direction of +YVector2f normalizedPositiveY(Vector2f dest)
+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 is equivalent to the following code:
Matrix2f inv = new Matrix2f(this).transpose(); inv.transform(dir.set(0, 1));
dest - will hold the direction of +YMatrix2f add(Matrix2fc other, Matrix2f dest)
this and other and store the result in dest.other - the other addenddest - will hold the resultMatrix2f sub(Matrix2fc subtrahend, Matrix2f dest)
subtrahend from this and store the result in dest.subtrahend - the subtrahenddest - will hold the resultMatrix2f mulComponentWise(Matrix2fc other, Matrix2f dest)
this by other and store the result in dest.other - the other matrixdest - will hold the resultMatrix2f lerp(Matrix2fc other, float t, Matrix2f dest)
this and other using the given interpolation factor t
and store the result in dest.
If t is 0.0 then the result is this. If the interpolation factor is 1.0
then the result is other.
other - the other matrixt - the interpolation factor between 0.0 and 1.0dest - will hold the resultboolean equals(Matrix2fc 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.