public interface Matrix3fc
| Modifier and Type | Method and Description |
|---|---|
Matrix3f |
add(Matrix3fc other,
Matrix3f dest)
Component-wise add
this and other and store the result in dest. |
Matrix3f |
cofactor(Matrix3f dest)
Compute the cofactor matrix of
this and store it into dest. |
float |
determinant()
Return the determinant of this matrix.
|
boolean |
equals(Matrix3fc 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.
|
Matrix3f |
get(Matrix3f dest)
Get the current values of
this matrix and store them into
dest. |
Matrix4f |
get(Matrix4f dest)
Get the current values of
this matrix and store them as
the rotational component of dest. |
Vector3f |
getColumn(int column,
Vector3f dest)
Get the column at the given
column index, starting with 0. |
Vector3f |
getEulerAnglesZYX(Vector3f dest)
Extract the Euler angles from the rotation represented by
this matrix and store the extracted Euler angles in dest. |
Quaterniond |
getNormalizedRotation(Quaterniond dest)
Get the current values of
this matrix and store the represented rotation
into the given Quaterniond. |
Quaternionf |
getNormalizedRotation(Quaternionf dest)
Get the current values of
this matrix and store the represented rotation
into the given Quaternionf. |
AxisAngle4f |
getRotation(AxisAngle4f dest)
Get the current values of
this matrix and store the represented rotation
into the given AxisAngle4f. |
Vector3f |
getRow(int row,
Vector3f dest)
Get the row at the given
row index, starting with 0. |
Vector3f |
getScale(Vector3f 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. |
Quaterniond |
getUnnormalizedRotation(Quaterniond dest)
Get the current values of
this matrix and store the represented rotation
into the given Quaterniond. |
Quaternionf |
getUnnormalizedRotation(Quaternionf dest)
Get the current values of
this matrix and store the represented rotation
into the given Quaternionf. |
Matrix3f |
invert(Matrix3f dest)
Invert the
this matrix and store the result in dest. |
Matrix3f |
lerp(Matrix3fc other,
float t,
Matrix3f dest)
Linearly interpolate
this and other using the given interpolation factor t
and store the result in dest. |
Matrix3f |
lookAlong(float dirX,
float dirY,
float dirZ,
float upX,
float upY,
float upZ,
Matrix3f dest)
Apply a rotation transformation to this matrix to make
-z point along dir
and store the result in dest. |
Matrix3f |
lookAlong(Vector3fc dir,
Vector3fc up,
Matrix3f dest)
Apply a rotation transformation to this matrix to make
-z point along dir
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 |
m02()
Return the value of the matrix element at column 0 and row 2.
|
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 |
m12()
Return the value of the matrix element at column 1 and row 2.
|
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.
|
float |
m22()
Return the value of the matrix element at column 2 and row 2.
|
Matrix3f |
mul(Matrix3fc right,
Matrix3f dest)
Multiply this matrix by the supplied
right matrix and store the result in dest. |
Matrix3f |
mulComponentWise(Matrix3fc other,
Matrix3f dest)
Component-wise multiply
this by other and store the result in dest. |
Matrix3f |
mulLocal(Matrix3fc left,
Matrix3f dest)
Pre-multiply this matrix by the supplied
left matrix and store the result in dest. |
Matrix3f |
normal(Matrix3f dest)
Compute a normal matrix from
this matrix and store it into dest. |
Vector3f |
normalizedPositiveX(Vector3f dir)
Obtain the direction of
+X before the transformation represented by this orthogonal matrix is applied. |
Vector3f |
normalizedPositiveY(Vector3f dir)
Obtain the direction of
+Y before the transformation represented by this orthogonal matrix is applied. |
Vector3f |
normalizedPositiveZ(Vector3f dir)
Obtain the direction of
+Z before the transformation represented by this orthogonal matrix is applied. |
Matrix3f |
obliqueZ(float a,
float b,
Matrix3f dest)
Apply an oblique projection transformation to this matrix with the given values for
a and
b and store the result in dest. |
Vector3f |
positiveX(Vector3f dir)
Obtain the direction of
+X before the transformation represented by this matrix is applied. |
Vector3f |
positiveY(Vector3f dir)
Obtain the direction of
+Y before the transformation represented by this matrix is applied. |
Vector3f |
positiveZ(Vector3f dir)
Obtain the direction of
+Z before the transformation represented by this matrix is applied. |
Matrix3f |
reflect(float nx,
float ny,
float nz,
Matrix3f dest)
Apply a mirror/reflection transformation to this matrix that reflects through the given plane
specified via the plane normal
(nx, ny, nz), and store the result in dest. |
Matrix3f |
reflect(Quaternionfc orientation,
Matrix3f dest)
Apply a mirror/reflection transformation to this matrix that reflects through a plane
specified via the plane orientation, and store the result in
dest. |
Matrix3f |
reflect(Vector3fc normal,
Matrix3f dest)
Apply a mirror/reflection transformation to this matrix that reflects through the given plane
specified via the plane normal, and store the result in
dest. |
Matrix3f |
rotate(AxisAngle4f axisAngle,
Matrix3f dest)
Apply a rotation transformation, rotating about the given
AxisAngle4f and store the result in dest. |
Matrix3f |
rotate(float ang,
float x,
float y,
float z,
Matrix3f dest)
Apply rotation to this matrix by rotating the given amount of radians
about the given axis specified as x, y and z components, and store the result in
dest. |
Matrix3f |
rotate(float angle,
Vector3fc axis,
Matrix3f dest)
Apply a rotation transformation, rotating the given radians about the specified axis and store the result in
dest. |
Matrix3f |
rotate(Quaternionfc quat,
Matrix3f dest)
Apply the rotation - and possibly scaling - transformation of the given
Quaternionfc to this matrix and store
the result in dest. |
Matrix3f |
rotateLocal(float ang,
float x,
float y,
float z,
Matrix3f dest)
Pre-multiply a rotation to this matrix by rotating the given amount of radians
about the specified
(x, y, z) axis and store the result in dest. |
Matrix3f |
rotateLocal(Quaternionfc quat,
Matrix3f dest)
Pre-multiply the rotation - and possibly scaling - transformation of the given
Quaternionfc to this matrix and store
the result in dest. |
Matrix3f |
rotateLocalX(float ang,
Matrix3f dest)
Pre-multiply a rotation around the X axis to this matrix by rotating the given amount of radians
about the X axis and store the result in
dest. |
Matrix3f |
rotateLocalY(float ang,
Matrix3f dest)
Pre-multiply a rotation around the Y axis to this matrix by rotating the given amount of radians
about the Y axis and store the result in
dest. |
Matrix3f |
rotateLocalZ(float ang,
Matrix3f dest)
Pre-multiply a rotation around the Z axis to this matrix by rotating the given amount of radians
about the Z axis and store the result in
dest. |
Matrix3f |
rotateTowards(float dirX,
float dirY,
float dirZ,
float upX,
float upY,
float upZ,
Matrix3f dest)
Apply a model transformation to this matrix for a right-handed coordinate system,
that aligns the local
+Z axis with dir
and store the result in dest. |
Matrix3f |
rotateTowards(Vector3fc direction,
Vector3fc up,
Matrix3f dest)
Apply a model transformation to this matrix for a right-handed coordinate system,
that aligns the local
+Z axis with direction
and store the result in dest. |
Matrix3f |
rotateX(float ang,
Matrix3f dest)
Apply rotation about the X axis to this matrix by rotating the given amount of radians
and store the result in
dest. |
Matrix3f |
rotateXYZ(float angleX,
float angleY,
float angleZ,
Matrix3f dest)
Apply rotation of
angleX radians about the X axis, followed by a rotation of angleY radians about the Y axis and
followed by a rotation of angleZ radians about the Z axis and store the result in dest. |
Matrix3f |
rotateY(float ang,
Matrix3f dest)
Apply rotation about the Y axis to this matrix by rotating the given amount of radians
and store the result in
dest. |
Matrix3f |
rotateYXZ(float angleY,
float angleX,
float angleZ,
Matrix3f dest)
Apply rotation of
angleY radians about the Y axis, followed by a rotation of angleX radians about the X axis and
followed by a rotation of angleZ radians about the Z axis and store the result in dest. |
Matrix3f |
rotateZ(float ang,
Matrix3f dest)
Apply rotation about the Z axis to this matrix by rotating the given amount of radians
and store the result in
dest. |
Matrix3f |
rotateZYX(float angleZ,
float angleY,
float angleX,
Matrix3f dest)
Apply rotation of
angleZ radians about the Z axis, followed by a rotation of angleY radians about the Y axis and
followed by a rotation of angleX radians about the X axis and store the result in dest. |
Matrix3f |
scale(float x,
float y,
float z,
Matrix3f dest)
Apply scaling to this matrix by scaling the base axes by the given x,
y and z factors and store the result in
dest. |
Matrix3f |
scale(float xyz,
Matrix3f dest)
Apply scaling to this matrix by uniformly scaling all base axes by the given
xyz factor
and store the result in dest. |
Matrix3f |
scale(Vector3fc xyz,
Matrix3f dest)
Apply scaling to
this matrix by scaling the base axes by the given xyz.x,
xyz.y and xyz.z factors, respectively and store the result in dest. |
Matrix3f |
scaleLocal(float x,
float y,
float z,
Matrix3f dest)
Pre-multiply scaling to
this matrix by scaling the base axes by the given x,
y and z factors and store the result in dest. |
Matrix3f |
sub(Matrix3fc subtrahend,
Matrix3f dest)
Component-wise subtract
subtrahend from this and store the result in dest. |
Vector3f |
transform(float x,
float y,
float z,
Vector3f dest)
Transform the vector
(x, y, z) by this matrix and store the result in dest. |
Vector3f |
transform(Vector3f v)
Transform the given vector by this matrix.
|
Vector3f |
transform(Vector3fc v,
Vector3f dest)
Transform the given vector by this matrix and store the result in
dest. |
Vector3f |
transformTranspose(float x,
float y,
float z,
Vector3f dest)
Transform the vector
(x, y, z) by the transpose of this matrix and store the result in dest. |
Vector3f |
transformTranspose(Vector3f v)
Transform the given vector by the transpose of this matrix.
|
Vector3f |
transformTranspose(Vector3fc v,
Vector3f dest)
Transform the given vector by the transpose of this matrix and store the result in
dest. |
Matrix3f |
transpose(Matrix3f dest)
Transpose
this matrix and store the result in dest. |
float m00()
float m01()
float m02()
float m10()
float m11()
float m12()
float m20()
float m21()
float m22()
Matrix3f mul(Matrix3fc right, Matrix3f 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 resultMatrix3f mulLocal(Matrix3fc left, Matrix3f 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()
Matrix3f invert(Matrix3f dest)
this matrix and store the result in dest.dest - will hold the resultMatrix3f transpose(Matrix3f dest)
this matrix and store the result in dest.dest - will hold the resultMatrix3f get(Matrix3f dest)
this matrix and store them into
dest.dest - the destination matrixMatrix4f get(Matrix4f 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 matrixMatrix4f.set(Matrix3fc)AxisAngle4f getRotation(AxisAngle4f dest)
this matrix and store the represented rotation
into the given AxisAngle4f.dest - the destination AxisAngle4fAxisAngle4f.set(Matrix3fc)Quaternionf getUnnormalizedRotation(Quaternionf dest)
this matrix and store the represented rotation
into the given Quaternionf.
This method assumes that the three column vectors of this matrix are not normalized and thus allows to ignore any additional scaling factor that is applied to the matrix.
dest - the destination QuaternionfQuaternionf.setFromUnnormalized(Matrix3fc)Quaternionf getNormalizedRotation(Quaternionf dest)
this matrix and store the represented rotation
into the given Quaternionf.
This method assumes that the three column vectors of this matrix are normalized.
dest - the destination QuaternionfQuaternionf.setFromNormalized(Matrix3fc)Quaterniond getUnnormalizedRotation(Quaterniond dest)
this matrix and store the represented rotation
into the given Quaterniond.
This method assumes that the three column vectors of this matrix are not normalized and thus allows to ignore any additional scaling factor that is applied to the matrix.
dest - the destination QuaterniondQuaterniond.setFromUnnormalized(Matrix3fc)Quaterniond getNormalizedRotation(Quaterniond dest)
this matrix and store the represented rotation
into the given Quaterniond.
This method assumes that the three column vectors of this matrix are normalized.
dest - the destination QuaterniondQuaterniond.setFromNormalized(Matrix3fc)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)Matrix3f scale(Vector3fc xyz, Matrix3f dest)
this matrix by scaling the base axes by the given xyz.x,
xyz.y and xyz.z 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!
xyz - the factors of the x, y and z component, respectivelydest - will hold the resultMatrix3f scale(float x, float y, float z, Matrix3f 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 componentz - the factor of the z componentdest - will hold the resultMatrix3f scale(float xyz, Matrix3f dest)
xyz 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!
xyz - the factor for all componentsdest - will hold the resultscale(float, float, float, Matrix3f)Matrix3f scaleLocal(float x, float y, float z, Matrix3f dest)
this matrix by scaling the base axes by the given x,
y and z 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 componentz - the factor of the z componentdest - will hold the resultVector3f transform(Vector3f v)
v - the vector to transformVector3f transform(Vector3fc v, Vector3f dest)
dest.v - the vector to transformdest - will hold the resultVector3f transform(float x, float y, float z, Vector3f dest)
(x, y, z) 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 transformz - the z coordinate of the vector to transformdest - will hold the resultVector3f transformTranspose(Vector3f v)
v - the vector to transformVector3f transformTranspose(Vector3fc v, Vector3f dest)
dest.v - the vector to transformdest - will hold the resultVector3f transformTranspose(float x, float y, float z, Vector3f dest)
(x, y, z) 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 transformz - the z coordinate of the vector to transformdest - will hold the resultMatrix3f rotateX(float ang, Matrix3f dest)
dest.
When used with a right-handed coordinate system, the produced rotation will rotate a vector counter-clockwise around the rotation axis, when viewing along the negative axis direction towards the origin. When used with a left-handed coordinate system, the rotation is clockwise.
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 resultMatrix3f rotateY(float ang, Matrix3f dest)
dest.
When used with a right-handed coordinate system, the produced rotation will rotate a vector counter-clockwise around the rotation axis, when viewing along the negative axis direction towards the origin. When used with a left-handed coordinate system, the rotation is clockwise.
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 resultMatrix3f rotateZ(float ang, Matrix3f dest)
dest.
When used with a right-handed coordinate system, the produced rotation will rotate a vector counter-clockwise around the rotation axis, when viewing along the negative axis direction towards the origin. When used with a left-handed coordinate system, the rotation is clockwise.
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 resultMatrix3f rotateXYZ(float angleX, float angleY, float angleZ, Matrix3f dest)
angleX radians about the X axis, followed by a rotation of angleY radians about the Y axis and
followed by a rotation of angleZ radians about the Z axis and store the result in dest.
When used with a right-handed coordinate system, the produced rotation will rotate a vector counter-clockwise around the rotation axis, when viewing along the negative axis direction towards the origin. When used with a left-handed coordinate system, the rotation is clockwise.
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!
This method is equivalent to calling: rotateX(angleX, dest).rotateY(angleY).rotateZ(angleZ)
angleX - the angle to rotate about XangleY - the angle to rotate about YangleZ - the angle to rotate about Zdest - will hold the resultMatrix3f rotateZYX(float angleZ, float angleY, float angleX, Matrix3f dest)
angleZ radians about the Z axis, followed by a rotation of angleY radians about the Y axis and
followed by a rotation of angleX radians about the X axis and store the result in dest.
When used with a right-handed coordinate system, the produced rotation will rotate a vector counter-clockwise around the rotation axis, when viewing along the negative axis direction towards the origin. When used with a left-handed coordinate system, the rotation is clockwise.
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!
This method is equivalent to calling: rotateZ(angleZ, dest).rotateY(angleY).rotateX(angleX)
angleZ - the angle to rotate about ZangleY - the angle to rotate about YangleX - the angle to rotate about Xdest - will hold the resultMatrix3f rotateYXZ(float angleY, float angleX, float angleZ, Matrix3f dest)
angleY radians about the Y axis, followed by a rotation of angleX radians about the X axis and
followed by a rotation of angleZ radians about the Z axis and store the result in dest.
When used with a right-handed coordinate system, the produced rotation will rotate a vector counter-clockwise around the rotation axis, when viewing along the negative axis direction towards the origin. When used with a left-handed coordinate system, the rotation is clockwise.
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!
This method is equivalent to calling: rotateY(angleY, dest).rotateX(angleX).rotateZ(angleZ)
angleY - the angle to rotate about YangleX - the angle to rotate about XangleZ - the angle to rotate about Zdest - will hold the resultMatrix3f rotate(float ang, float x, float y, float z, Matrix3f dest)
dest.
The axis described by the three components needs to be a unit vector.
When used with a right-handed coordinate system, the produced rotation will rotate a vector counter-clockwise around the rotation axis, when viewing along the negative axis direction towards the origin. When used with a left-handed coordinate system, the rotation is clockwise.
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 radiansx - the x component of the axisy - the y component of the axisz - the z component of the axisdest - will hold the resultMatrix3f rotateLocal(float ang, float x, float y, float z, Matrix3f dest)
(x, y, z) axis and store the result in dest.
The axis described by the three components needs to be a unit vector.
When used with a right-handed coordinate system, the produced rotation will rotate a vector counter-clockwise around the rotation axis, when viewing along the negative axis direction towards the origin. When used with a left-handed coordinate system, the rotation is clockwise.
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 radiansx - the x component of the axisy - the y component of the axisz - the z component of the axisdest - will hold the resultMatrix3f rotateLocalX(float ang, Matrix3f dest)
dest.
When used with a right-handed coordinate system, the produced rotation will rotate a vector counter-clockwise around the rotation axis, when viewing along the negative axis direction towards the origin. When used with a left-handed coordinate system, the rotation is clockwise.
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 radians to rotate about the X axisdest - will hold the resultMatrix3f rotateLocalY(float ang, Matrix3f dest)
dest.
When used with a right-handed coordinate system, the produced rotation will rotate a vector counter-clockwise around the rotation axis, when viewing along the negative axis direction towards the origin. When used with a left-handed coordinate system, the rotation is clockwise.
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 radians to rotate about the Y axisdest - will hold the resultMatrix3f rotateLocalZ(float ang, Matrix3f dest)
dest.
When used with a right-handed coordinate system, the produced rotation will rotate a vector counter-clockwise around the rotation axis, when viewing along the negative axis direction towards the origin. When used with a left-handed coordinate system, the rotation is clockwise.
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 radians to rotate about the Z axisdest - will hold the resultMatrix3f rotate(Quaternionfc quat, Matrix3f dest)
Quaternionfc to this matrix and store
the result in dest.
When used with a right-handed coordinate system, the produced rotation will rotate a vector counter-clockwise around the rotation axis, when viewing along the negative axis direction towards the origin. When used with a left-handed coordinate system, the rotation is clockwise.
If M is this matrix and Q the rotation matrix obtained from the given quaternion,
then the new matrix will be M * Q. So when transforming a
vector v with the new matrix by using M * Q * v,
the quaternion rotation will be applied first!
Reference: http://en.wikipedia.org
quat - the Quaternionfcdest - will hold the resultMatrix3f rotateLocal(Quaternionfc quat, Matrix3f dest)
Quaternionfc to this matrix and store
the result in dest.
When used with a right-handed coordinate system, the produced rotation will rotate a vector counter-clockwise around the rotation axis, when viewing along the negative axis direction towards the origin. When used with a left-handed coordinate system, the rotation is clockwise.
If M is this matrix and Q the rotation matrix obtained from the given quaternion,
then the new matrix will be Q * M. So when transforming a
vector v with the new matrix by using Q * M * v,
the quaternion rotation will be applied last!
Reference: http://en.wikipedia.org
quat - the Quaternionfcdest - will hold the resultMatrix3f rotate(AxisAngle4f axisAngle, Matrix3f dest)
AxisAngle4f and store the result in dest.
When used with a right-handed coordinate system, the produced rotation will rotate a vector counter-clockwise around the rotation axis, when viewing along the negative axis direction towards the origin. When used with a left-handed coordinate system, the rotation is clockwise.
If M is this matrix and A the rotation matrix obtained from the given AxisAngle4f,
then the new matrix will be M * A. So when transforming a
vector v with the new matrix by using M * A * v,
the AxisAngle4f rotation will be applied first!
Reference: http://en.wikipedia.org
axisAngle - the AxisAngle4f (needs to be normalized)dest - will hold the resultrotate(float, float, float, float, Matrix3f)Matrix3f rotate(float angle, Vector3fc axis, Matrix3f dest)
dest.
When used with a right-handed coordinate system, the produced rotation will rotate a vector counter-clockwise around the rotation axis, when viewing along the negative axis direction towards the origin. When used with a left-handed coordinate system, the rotation is clockwise.
If M is this matrix and A the rotation matrix obtained from the given angle and axis,
then the new matrix will be M * A. So when transforming a
vector v with the new matrix by using M * A * v,
the axis-angle rotation will be applied first!
Reference: http://en.wikipedia.org
angle - the angle in radiansaxis - the rotation axis (needs to be normalized)dest - will hold the resultrotate(float, float, float, float, Matrix3f)Matrix3f lookAlong(Vector3fc dir, Vector3fc up, Matrix3f dest)
-z point along dir
and store the result in dest.
If M is this matrix and L the lookalong rotation matrix,
then the new matrix will be M * L. So when transforming a
vector v with the new matrix by using M * L * v, the
lookalong rotation transformation will be applied first!
dir - the direction in space to look alongup - the direction of 'up'dest - will hold the resultlookAlong(float, float, float, float, float, float, Matrix3f)Matrix3f lookAlong(float dirX, float dirY, float dirZ, float upX, float upY, float upZ, Matrix3f dest)
-z point along dir
and store the result in dest.
If M is this matrix and L the lookalong rotation matrix,
then the new matrix will be M * L. So when transforming a
vector v with the new matrix by using M * L * v, the
lookalong rotation transformation will be applied first!
dirX - the x-coordinate of the direction to look alongdirY - the y-coordinate of the direction to look alongdirZ - the z-coordinate of the direction to look alongupX - the x-coordinate of the up vectorupY - the y-coordinate of the up vectorupZ - the z-coordinate of the up vectordest - will hold the resultVector3f getRow(int row, Vector3f dest) throws IndexOutOfBoundsException
row index, starting with 0.row - the row index in [0..2]dest - will hold the row componentsIndexOutOfBoundsException - if row is not in [0..2]Vector3f getColumn(int column, Vector3f dest) throws IndexOutOfBoundsException
column index, starting with 0.column - the column index in [0..2]dest - will hold the column componentsIndexOutOfBoundsException - if column is not in [0..2]float get(int column,
int row)
column - the colum index in [0..2]row - the row index in [0..2]Matrix3f normal(Matrix3f dest)
this matrix and store it into dest.
The normal matrix of m is the transpose of the inverse of m.
dest - will hold the resultMatrix3f cofactor(Matrix3f dest)
this and store it into dest.
The cofactor matrix can be used instead of normal(Matrix3f) to transform normals
when the orientation of the normals with respect to the surface should be preserved.
dest - will hold the resultVector3f getScale(Vector3f dest)
this matrix for the three base axes.dest - will hold the scaling factors for x, y and zVector3f positiveZ(Vector3f dir)
+Z before the transformation represented by this matrix is applied.
This method is equivalent to the following code:
Matrix3f inv = new Matrix3f(this).invert(); inv.transform(dir.set(0, 0, 1)).normalize();If
this is already an orthogonal matrix, then consider using normalizedPositiveZ(Vector3f) instead.
Reference: http://www.euclideanspace.com
dir - will hold the direction of +ZVector3f normalizedPositiveZ(Vector3f dir)
+Z 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:
Matrix3f inv = new Matrix3f(this).transpose(); inv.transform(dir.set(0, 0, 1));
Reference: http://www.euclideanspace.com
dir - will hold the direction of +ZVector3f positiveX(Vector3f dir)
+X before the transformation represented by this matrix is applied.
This method is equivalent to the following code:
Matrix3f inv = new Matrix3f(this).invert(); inv.transform(dir.set(1, 0, 0)).normalize();If
this is already an orthogonal matrix, then consider using normalizedPositiveX(Vector3f) instead.
Reference: http://www.euclideanspace.com
dir - will hold the direction of +XVector3f normalizedPositiveX(Vector3f 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 is equivalent to the following code:
Matrix3f inv = new Matrix3f(this).transpose(); inv.transform(dir.set(1, 0, 0));
Reference: http://www.euclideanspace.com
dir - will hold the direction of +XVector3f positiveY(Vector3f dir)
+Y before the transformation represented by this matrix is applied.
This method is equivalent to the following code:
Matrix3f inv = new Matrix3f(this).invert(); inv.transform(dir.set(0, 1, 0)).normalize();If
this is already an orthogonal matrix, then consider using normalizedPositiveY(Vector3f) instead.
Reference: http://www.euclideanspace.com
dir - will hold the direction of +YVector3f normalizedPositiveY(Vector3f 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 is equivalent to the following code:
Matrix3f inv = new Matrix3f(this).transpose(); inv.transform(dir.set(0, 1, 0));
Reference: http://www.euclideanspace.com
dir - will hold the direction of +YMatrix3f add(Matrix3fc other, Matrix3f dest)
this and other and store the result in dest.other - the other addenddest - will hold the resultMatrix3f sub(Matrix3fc subtrahend, Matrix3f dest)
subtrahend from this and store the result in dest.subtrahend - the subtrahenddest - will hold the resultMatrix3f mulComponentWise(Matrix3fc other, Matrix3f dest)
this by other and store the result in dest.other - the other matrixdest - will hold the resultMatrix3f lerp(Matrix3fc other, float t, Matrix3f 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 resultMatrix3f rotateTowards(Vector3fc direction, Vector3fc up, Matrix3f dest)
+Z axis with direction
and store the result in dest.
If M is this matrix and L the lookat matrix,
then the new matrix will be M * L. So when transforming a
vector v with the new matrix by using M * L * v,
the lookat transformation will be applied first!
This method is equivalent to calling: mul(new Matrix3f().lookAlong(new Vector3f(dir).negate(), up).invert(), dest)
direction - the direction to rotate towardsup - the model's up vectordest - will hold the resultrotateTowards(float, float, float, float, float, float, Matrix3f)Matrix3f rotateTowards(float dirX, float dirY, float dirZ, float upX, float upY, float upZ, Matrix3f dest)
+Z axis with dir
and store the result in dest.
If M is this matrix and L the lookat matrix,
then the new matrix will be M * L. So when transforming a
vector v with the new matrix by using M * L * v,
the lookat transformation will be applied first!
This method is equivalent to calling: mul(new Matrix3f().lookAlong(-dirX, -dirY, -dirZ, upX, upY, upZ).invert(), dest)
dirX - the x-coordinate of the direction to rotate towardsdirY - the y-coordinate of the direction to rotate towardsdirZ - the z-coordinate of the direction to rotate towardsupX - the x-coordinate of the up vectorupY - the y-coordinate of the up vectorupZ - the z-coordinate of the up vectordest - will hold the resultrotateTowards(Vector3fc, Vector3fc, Matrix3f)Vector3f getEulerAnglesZYX(Vector3f dest)
this matrix and store the extracted Euler angles in dest.
This method assumes that this matrix only represents a rotation without scaling.
Note that the returned Euler angles must be applied in the order Z * Y * X to obtain the identical matrix.
This means that calling rotateZYX(float, float, float, Matrix3f) using the obtained Euler angles will yield
the same rotation as the original matrix from which the Euler angles were obtained, so in the below code the matrix
m2 should be identical to m (disregarding possible floating-point inaccuracies).
Matrix3f m = ...; // <- matrix only representing rotation Matrix3f n = new Matrix3f(); n.rotateZYX(m.getEulerAnglesZYX(new Vector3f()));
Reference: http://nghiaho.com/
dest - will hold the extracted Euler anglesMatrix3f obliqueZ(float a, float b, Matrix3f dest)
a and
b and store the result in dest.
If M is this matrix and O the oblique transformation 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
oblique transformation will be applied first!
The oblique transformation is defined as:
x' = x + a*z y' = y + a*z z' = zor in matrix form:
1 0 a 0 1 b 0 0 1
a - the value for the z factor that applies to xb - the value for the z factor that applies to ydest - will hold the resultboolean equals(Matrix3fc 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 otherwiseMatrix3f reflect(float nx, float ny, float nz, Matrix3f dest)
(nx, ny, nz), and store the result in dest.
If M is this matrix and R the reflection 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
reflection will be applied first!
nx - the x-coordinate of the plane normalny - the y-coordinate of the plane normalnz - the z-coordinate of the plane normaldest - will hold the resultMatrix3f reflect(Quaternionfc orientation, Matrix3f dest)
dest.
This method can be used to build a reflection transformation based on the orientation of a mirror object in the scene.
It is assumed that the default mirror plane's normal is (0, 0, 1). So, if the given Quaternionfc is
the identity (does not apply any additional rotation), the reflection plane will be z=0.
If M is this matrix and R the reflection 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
reflection will be applied first!
orientation - the plane orientationdest - will hold the resultMatrix3f reflect(Vector3fc normal, Matrix3f dest)
dest.
If M is this matrix and R the reflection 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
reflection will be applied first!
normal - the plane normaldest - will hold the resultCopyright © 2015–2019 JOML. All rights reserved.