public interface Matrix3dc
| Modifier and Type | Method and Description |
|---|---|
Matrix3d |
add(Matrix3dc other,
Matrix3d dest)
Component-wise add
this and other and store the result in dest. |
double |
determinant()
Return the determinant of this matrix.
|
boolean |
equals(Matrix3dc m,
double 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. |
double[] |
get(double[] arr)
Store this matrix into the supplied double array in column-major order.
|
double[] |
get(double[] arr,
int offset)
Store this matrix into the supplied double array in column-major order at the given offset.
|
DoubleBuffer |
get(DoubleBuffer buffer)
Store this matrix into the supplied
DoubleBuffer at the current
buffer position using column-major order. |
float[] |
get(float[] arr)
Store the elements of this matrix as float values in column-major order into the supplied float array.
|
float[] |
get(float[] arr,
int offset)
Store the elements of this matrix as float values in column-major order into the supplied float array 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. |
DoubleBuffer |
get(int index,
DoubleBuffer buffer)
Store this matrix into the supplied
DoubleBuffer starting at the specified
absolute buffer position/index using column-major order. |
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. |
double |
get(int column,
int row)
Get the matrix element value at the given column and row.
|
Matrix3d |
get(Matrix3d dest)
Get the current values of
this matrix and store them into
dest. |
Vector3d |
getColumn(int column,
Vector3d dest)
Get the column at the given
column index, starting with 0. |
Vector3d |
getEulerAnglesZYX(Vector3d dest)
Extract the Euler angles from the rotation represented by
this matrix and store the extracted Euler angles in dest. |
ByteBuffer |
getFloats(ByteBuffer buffer)
Store the elements of this matrix as float values in column-major order into the supplied
ByteBuffer at the current
buffer position. |
ByteBuffer |
getFloats(int index,
ByteBuffer buffer)
Store the elements of this matrix as float values in column-major order into the supplied
ByteBuffer
starting at the specified absolute buffer position/index. |
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. |
Vector3d |
getRow(int row,
Vector3d dest)
Get the row at the given
row index, starting with 0. |
Vector3d |
getScale(Vector3d dest)
Get the scaling factors of
this matrix for the three base axes. |
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. |
Matrix3d |
invert(Matrix3d dest)
Invert
this matrix and store the result in dest. |
Matrix3d |
lerp(Matrix3dc other,
double t,
Matrix3d dest)
Linearly interpolate
this and other using the given interpolation factor t
and store the result in dest. |
Matrix3d |
lookAlong(double dirX,
double dirY,
double dirZ,
double upX,
double upY,
double upZ,
Matrix3d dest)
Apply a rotation transformation to this matrix to make
-z point along dir
and store the result in dest. |
Matrix3d |
lookAlong(Vector3dc dir,
Vector3dc up,
Matrix3d dest)
Apply a rotation transformation to this matrix to make
-z point along dir
and store the result in dest. |
double |
m00()
Return the value of the matrix element at column 0 and row 0.
|
double |
m01()
Return the value of the matrix element at column 0 and row 1.
|
double |
m02()
Return the value of the matrix element at column 0 and row 2.
|
double |
m10()
Return the value of the matrix element at column 1 and row 0.
|
double |
m11()
Return the value of the matrix element at column 1 and row 1.
|
double |
m12()
Return the value of the matrix element at column 1 and row 2.
|
double |
m20()
Return the value of the matrix element at column 2 and row 0.
|
double |
m21()
Return the value of the matrix element at column 2 and row 1.
|
double |
m22()
Return the value of the matrix element at column 2 and row 2.
|
Matrix3d |
mul(Matrix3dc right,
Matrix3d dest)
Multiply this matrix by the supplied matrix and store the result in
dest. |
Matrix3d |
mul(Matrix3fc right,
Matrix3d dest)
Multiply this matrix by the supplied matrix and store the result in
dest. |
Matrix3d |
mulComponentWise(Matrix3dc other,
Matrix3d dest)
Component-wise multiply
this by other and store the result in dest. |
Matrix3d |
mulLocal(Matrix3dc left,
Matrix3d dest)
Pre-multiply this matrix by the supplied
left matrix and store the result in dest. |
Matrix3d |
normal(Matrix3d dest)
Compute a normal matrix from
this matrix and store it into dest. |
Vector3d |
normalizedPositiveX(Vector3d dir)
Obtain the direction of
+X before the transformation represented by this orthogonal matrix is applied. |
Vector3d |
normalizedPositiveY(Vector3d dir)
Obtain the direction of
+Y before the transformation represented by this orthogonal matrix is applied. |
Vector3d |
normalizedPositiveZ(Vector3d dir)
Obtain the direction of
+Z before the transformation represented by this orthogonal matrix is applied. |
Matrix3d |
obliqueZ(double a,
double b,
Matrix3d dest)
Apply an oblique projection transformation to this matrix with the given values for
a and
b and store the result in dest. |
Vector3d |
positiveX(Vector3d dir)
Obtain the direction of
+X before the transformation represented by this matrix is applied. |
Vector3d |
positiveY(Vector3d dir)
Obtain the direction of
+Y before the transformation represented by this matrix is applied. |
Vector3d |
positiveZ(Vector3d dir)
Obtain the direction of
+Z before the transformation represented by this matrix is applied. |
Matrix3d |
rotate(AxisAngle4d axisAngle,
Matrix3d dest)
Apply a rotation transformation, rotating about the given
AxisAngle4d and store the result in dest. |
Matrix3d |
rotate(AxisAngle4f axisAngle,
Matrix3d dest)
Apply a rotation transformation, rotating about the given
AxisAngle4f and store the result in dest. |
Matrix3d |
rotate(double ang,
double x,
double y,
double z,
Matrix3d 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. |
Matrix3d |
rotate(double angle,
Vector3dc axis,
Matrix3d dest)
Apply a rotation transformation, rotating the given radians about the specified axis and store the result in
dest. |
Matrix3d |
rotate(double angle,
Vector3fc axis,
Matrix3d dest)
Apply a rotation transformation, rotating the given radians about the specified axis and store the result in
dest. |
Matrix3d |
rotate(Quaterniondc quat,
Matrix3d dest)
Apply the rotation - and possibly scaling - transformation of the given
Quaterniondc to this matrix and store
the result in dest. |
Matrix3d |
rotate(Quaternionfc quat,
Matrix3d dest)
Apply the rotation - and possibly scaling - transformation of the given
Quaternionfc to this matrix and store
the result in dest. |
Matrix3d |
rotateLocal(double ang,
double x,
double y,
double z,
Matrix3d 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. |
Matrix3d |
rotateLocal(Quaterniondc quat,
Matrix3d dest)
Pre-multiply the rotation - and possibly scaling - transformation of the given
Quaterniondc to this matrix and store
the result in dest. |
Matrix3d |
rotateLocal(Quaternionfc quat,
Matrix3d dest)
Pre-multiply the rotation - and possibly scaling - transformation of the given
Quaternionfc to this matrix and store
the result in dest. |
Matrix3d |
rotateLocalX(double ang,
Matrix3d 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. |
Matrix3d |
rotateLocalY(double ang,
Matrix3d 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. |
Matrix3d |
rotateLocalZ(double ang,
Matrix3d 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. |
Matrix3d |
rotateTowards(double dirX,
double dirY,
double dirZ,
double upX,
double upY,
double upZ,
Matrix3d 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. |
Matrix3d |
rotateTowards(Vector3dc direction,
Vector3dc up,
Matrix3d 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. |
Matrix3d |
rotateX(double ang,
Matrix3d dest)
Apply rotation about the X axis to this matrix by rotating the given amount of radians
and store the result in
dest. |
Matrix3d |
rotateXYZ(double angleX,
double angleY,
double angleZ,
Matrix3d 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. |
Matrix3d |
rotateY(double ang,
Matrix3d dest)
Apply rotation about the Y axis to this matrix by rotating the given amount of radians
and store the result in
dest. |
Matrix3d |
rotateYXZ(double angleY,
double angleX,
double angleZ,
Matrix3d 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. |
Matrix3d |
rotateZ(double ang,
Matrix3d dest)
Apply rotation about the Z axis to this matrix by rotating the given amount of radians
and store the result in
dest. |
Matrix3d |
rotateZYX(double angleZ,
double angleY,
double angleX,
Matrix3d 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. |
Matrix3d |
scale(double x,
double y,
double z,
Matrix3d 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. |
Matrix3d |
scale(double xyz,
Matrix3d dest)
Apply scaling to this matrix by uniformly scaling all base axes by the given
xyz factor
and store the result in dest. |
Matrix3d |
scale(Vector3dc xyz,
Matrix3d 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. |
Matrix3d |
scaleLocal(double x,
double y,
double z,
Matrix3d 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. |
Matrix3d |
sub(Matrix3dc subtrahend,
Matrix3d dest)
Component-wise subtract
subtrahend from this and store the result in dest. |
Vector3d |
transform(double x,
double y,
double z,
Vector3d dest)
Transform the vector
(x, y, z) by this matrix and store the result in dest. |
Vector3d |
transform(Vector3d v)
Transform the given vector by this matrix.
|
Vector3d |
transform(Vector3dc v,
Vector3d dest)
Transform the given vector 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. |
Vector3d |
transformTranspose(double x,
double y,
double z,
Vector3d dest)
Transform the vector
(x, y, z) by the transpose of this matrix and store the result in dest. |
Vector3d |
transformTranspose(Vector3d v)
Transform the given vector by the transpose of this matrix.
|
Vector3d |
transformTranspose(Vector3dc v,
Vector3d dest)
Transform the given vector by the transpose of this matrix and store the result in
dest. |
Matrix3d |
transpose(Matrix3d dest)
Transpose
this matrix and store the result in dest. |
double m00()
double m01()
double m02()
double m10()
double m11()
double m12()
double m20()
double m21()
double m22()
Matrix3d mul(Matrix3dc right, Matrix3d dest)
dest.
This matrix will be the left one.
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 operanddest - will hold the resultMatrix3d mulLocal(Matrix3dc left, Matrix3d 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 resultMatrix3d mul(Matrix3fc right, Matrix3d dest)
dest.
This matrix will be the left one.
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 operanddest - will hold the resultdouble determinant()
Matrix3d invert(Matrix3d dest)
this matrix and store the result in dest.dest - will hold the resultMatrix3d transpose(Matrix3d dest)
this matrix and store the result in dest.dest - will hold the resultMatrix3d get(Matrix3d dest)
this matrix and store them into
dest.dest - the destination matrixAxisAngle4f getRotation(AxisAngle4f dest)
this matrix and store the represented rotation
into the given AxisAngle4f.dest - the destination AxisAngle4fAxisAngle4f.set(Matrix3dc)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(Matrix3dc)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(Matrix3dc)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(Matrix3dc)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(Matrix3dc)DoubleBuffer get(DoubleBuffer buffer)
DoubleBuffer at the current
buffer position using column-major order.
This method will not increment the position of the given DoubleBuffer.
In order to specify the offset into the DoubleBuffer} at which
the matrix is stored, use get(int, DoubleBuffer), taking
the absolute position as parameter.
buffer - will receive the values of this matrix in column-major order at its current positionget(int, DoubleBuffer)DoubleBuffer get(int index, DoubleBuffer buffer)
DoubleBuffer starting at the specified
absolute buffer position/index using column-major order.
This method will not increment the position of the given DoubleBuffer.
index - the absolute position into the DoubleBufferbuffer - will receive the values of this matrix in column-major orderFloatBuffer 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.
Please note that due to this matrix storing double values those values will potentially lose precision when they are converted to float values before being put into the given FloatBuffer.
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.
Please note that due to this matrix storing double values those values will potentially lose precision when they are converted to float values before being put into 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 orderByteBuffer getFloats(ByteBuffer buffer)
ByteBuffer at the current
buffer position.
This method will not increment the position of the given ByteBuffer.
Please note that due to this matrix storing double values those values will potentially lose precision when they are converted to float values before being put into the given ByteBuffer.
In order to specify the offset into the ByteBuffer at which
the matrix is stored, use getFloats(int, ByteBuffer), taking
the absolute position as parameter.
buffer - will receive the elements of this matrix as float values in column-major order at its current positiongetFloats(int, ByteBuffer)ByteBuffer getFloats(int index, ByteBuffer buffer)
ByteBuffer
starting at the specified absolute buffer position/index.
This method will not increment the position of the given ByteBuffer.
Please note that due to this matrix storing double values those values will potentially lose precision when they are converted to float values before being put into the given ByteBuffer.
index - the absolute position into the ByteBufferbuffer - will receive the elements of this matrix as float values in column-major orderdouble[] get(double[] arr,
int offset)
arr - the array to write the matrix values intooffset - the offset into the arraydouble[] get(double[] arr)
In order to specify an explicit offset into the array, use the method get(double[], int).
arr - the array to write the matrix values intoget(double[], int)float[] get(float[] arr,
int offset)
Please note that due to this matrix storing double values those values will potentially lose precision when they are converted to float values before being put into the given float array.
arr - the array to write the matrix values intooffset - the offset into the arrayfloat[] get(float[] arr)
Please note that due to this matrix storing double values those values will potentially lose precision when they are converted to float values before being put into the given float array.
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)Matrix3d scale(Vector3dc xyz, Matrix3d 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 resultMatrix3d scale(double x, double y, double z, Matrix3d 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 resultMatrix3d scale(double xyz, Matrix3d 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(double, double, double, Matrix3d)Matrix3d scaleLocal(double x, double y, double z, Matrix3d 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 resultVector3d transform(Vector3d v)
v - the vector to transformVector3d transform(Vector3dc v, Vector3d dest)
dest.v - the vector to transformdest - 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 resultVector3d transform(double x, double y, double z, Vector3d 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 resultVector3d transformTranspose(Vector3d v)
v - the vector to transformVector3d transformTranspose(Vector3dc v, Vector3d dest)
dest.v - the vector to transformdest - will hold the resultVector3d transformTranspose(double x, double y, double z, Vector3d 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 resultMatrix3d rotateX(double ang, Matrix3d 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 resultMatrix3d rotateY(double ang, Matrix3d 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 resultMatrix3d rotateZ(double ang, Matrix3d 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 resultMatrix3d rotateXYZ(double angleX, double angleY, double angleZ, Matrix3d 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 resultMatrix3d rotateZYX(double angleZ, double angleY, double angleX, Matrix3d 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 resultMatrix3d rotateYXZ(double angleY, double angleX, double angleZ, Matrix3d 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 resultMatrix3d rotate(double ang, double x, double y, double z, Matrix3d 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 resultMatrix3d rotateLocal(double ang, double x, double y, double z, Matrix3d 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 resultMatrix3d rotateLocalX(double ang, Matrix3d 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 resultMatrix3d rotateLocalY(double ang, Matrix3d 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 resultMatrix3d rotateLocalZ(double ang, Matrix3d 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 resultMatrix3d rotateLocal(Quaterniondc quat, Matrix3d dest)
Quaterniondc 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 Quaterniondcdest - will hold the resultMatrix3d rotateLocal(Quaternionfc quat, Matrix3d 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 resultMatrix3d rotate(Quaterniondc quat, Matrix3d dest)
Quaterniondc 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 Quaterniondcdest - will hold the resultMatrix3d rotate(Quaternionfc quat, Matrix3d 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 resultMatrix3d rotate(AxisAngle4f axisAngle, Matrix3d 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(double, double, double, double, Matrix3d)Matrix3d rotate(AxisAngle4d axisAngle, Matrix3d dest)
AxisAngle4d 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 AxisAngle4d,
then the new matrix will be M * A. So when transforming a
vector v with the new matrix by using M * A * v,
the AxisAngle4d rotation will be applied first!
Reference: http://en.wikipedia.org
axisAngle - the AxisAngle4d (needs to be normalized)dest - will hold the resultrotate(double, double, double, double, Matrix3d)Matrix3d rotate(double angle, Vector3dc axis, Matrix3d dest)
dest.
The axis described by the axis vector 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 A the rotation matrix obtained from the given axis and angle,
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(double, double, double, double, Matrix3d)Matrix3d rotate(double angle, Vector3fc axis, Matrix3d dest)
dest.
The axis described by the axis vector 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 A the rotation matrix obtained from the given axis and angle,
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(double, double, double, double, Matrix3d)Vector3d getRow(int row, Vector3d 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]Vector3d getColumn(int column, Vector3d 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]double get(int column,
int row)
column - the colum index in [0..2]row - the row index in [0..2]Matrix3d normal(Matrix3d dest)
this matrix and store it into dest.dest - will hold the resultMatrix3d lookAlong(Vector3dc dir, Vector3dc up, Matrix3d 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(double, double, double, double, double, double, Matrix3d)Matrix3d lookAlong(double dirX, double dirY, double dirZ, double upX, double upY, double upZ, Matrix3d 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 resultVector3d getScale(Vector3d dest)
this matrix for the three base axes.dest - will hold the scaling factors for x, y and zVector3d positiveZ(Vector3d dir)
+Z before the transformation represented by this matrix is applied.
This method is equivalent to the following code:
Matrix3d inv = new Matrix3d(this).invert(); inv.transform(dir.set(0, 0, 1)).normalize();If
this is already an orthogonal matrix, then consider using normalizedPositiveZ(Vector3d) instead.
Reference: http://www.euclideanspace.com
dir - will hold the direction of +ZVector3d normalizedPositiveZ(Vector3d 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:
Matrix3d inv = new Matrix3d(this).transpose(); inv.transform(dir.set(0, 0, 1));
Reference: http://www.euclideanspace.com
dir - will hold the direction of +ZVector3d positiveX(Vector3d dir)
+X before the transformation represented by this matrix is applied.
This method is equivalent to the following code:
Matrix3d inv = new Matrix3d(this).invert(); inv.transform(dir.set(1, 0, 0)).normalize();If
this is already an orthogonal matrix, then consider using normalizedPositiveX(Vector3d) instead.
Reference: http://www.euclideanspace.com
dir - will hold the direction of +XVector3d normalizedPositiveX(Vector3d 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:
Matrix3d inv = new Matrix3d(this).transpose(); inv.transform(dir.set(1, 0, 0));
Reference: http://www.euclideanspace.com
dir - will hold the direction of +XVector3d positiveY(Vector3d dir)
+Y before the transformation represented by this matrix is applied.
This method is equivalent to the following code:
Matrix3d inv = new Matrix3d(this).invert(); inv.transform(dir.set(0, 1, 0)).normalize();If
this is already an orthogonal matrix, then consider using normalizedPositiveY(Vector3d) instead.
Reference: http://www.euclideanspace.com
dir - will hold the direction of +YVector3d normalizedPositiveY(Vector3d 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:
Matrix3d inv = new Matrix3d(this).transpose(); inv.transform(dir.set(0, 1, 0));
Reference: http://www.euclideanspace.com
dir - will hold the direction of +YMatrix3d add(Matrix3dc other, Matrix3d dest)
this and other and store the result in dest.other - the other addenddest - will hold the resultMatrix3d sub(Matrix3dc subtrahend, Matrix3d dest)
subtrahend from this and store the result in dest.subtrahend - the subtrahenddest - will hold the resultMatrix3d mulComponentWise(Matrix3dc other, Matrix3d dest)
this by other and store the result in dest.other - the other matrixdest - will hold the resultMatrix3d lerp(Matrix3dc other, double t, Matrix3d 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 resultMatrix3d rotateTowards(Vector3dc direction, Vector3dc up, Matrix3d 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 Matrix3d().lookAlong(new Vector3d(dir).negate(), up).invert(), dest)
direction - the direction to rotate towardsup - the model's up vectordest - will hold the resultrotateTowards(double, double, double, double, double, double, Matrix3d)Matrix3d rotateTowards(double dirX, double dirY, double dirZ, double upX, double upY, double upZ, Matrix3d 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 Matrix3d().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(Vector3dc, Vector3dc, Matrix3d)Vector3d getEulerAnglesZYX(Vector3d 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(double, double, double, Matrix3d) 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).
Matrix3d m = ...; // <- matrix only representing rotation Matrix3d n = new Matrix3d(); n.rotateZYX(m.getEulerAnglesZYX(new Vector3d()));
Reference: http://nghiaho.com/
dest - will hold the extracted Euler anglesMatrix3d obliqueZ(double a, double b, Matrix3d 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(Matrix3dc m, double 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.