public final class Matrix4 extends Object implements IMatrix4, Serializable
Modifier and Type | Field and Description |
---|---|
static Matrix4[] |
EMPTY_ARRAY
An empty matrix array.
|
static IMatrix4 |
IDENTITY
The identity matrix.
|
double |
m00
The values of the matrix.
|
double |
m01 |
double |
m02 |
double |
m03 |
double |
m10
The values of the matrix.
|
double |
m11 |
double |
m12 |
double |
m13 |
double |
m20
The values of the matrix.
|
double |
m21 |
double |
m22 |
double |
m23 |
double |
m30
The values of the matrix.
|
double |
m31 |
double |
m32 |
double |
m33 |
Constructor and Description |
---|
Matrix4()
Creates an identity matrix.
|
Matrix4(double[] values)
Creates a matrix from an array of values.
|
Matrix4(DoubleBuffer buf)
Creates a matrix from a double buffer.
|
Matrix4(double m00,
double m10,
double m20,
double m30,
double m01,
double m11,
double m21,
double m31,
double m02,
double m12,
double m22,
double m32,
double m03,
double m13,
double m23,
double m33)
Creates a matrix from its components.
|
Matrix4(IMatrix4 other)
Copy constructor.
|
Modifier and Type | Method and Description |
---|---|
double |
approximateUniformScale()
Returns an approximation of the uniform scale for this matrix (the cube root of the
signed volume of the parallelepiped spanned by the axis vectors).
|
boolean |
epsilonEquals(IMatrix4 other,
double epsilon)
Compares this matrix to another with the provided epsilon.
|
boolean |
equals(Object other) |
Quaternion |
extractRotation()
Extracts the rotation component of the matrix.
|
Quaternion |
extractRotation(Quaternion result)
Extracts the rotation component of the matrix and places it in the provided result
quaternion.
|
Matrix3 |
extractRotationScale(Matrix3 result)
Extracts the rotation and scale components and places them in the provided result.
|
Vector3 |
extractScale()
Extracts the scale component of the matrix.
|
Vector3 |
extractScale(Vector3 result)
Extracts the scale component of the matrix and places it in the provided result vector.
|
DoubleBuffer |
get(DoubleBuffer buf)
Places the contents of this matrix into the given buffer in the standard OpenGL order.
|
int |
hashCode() |
Matrix4 |
invert()
Inverts this matrix.
|
Matrix4 |
invert(Matrix4 result)
Inverts this matrix and places the result in the given object.
|
Matrix4 |
invertAffine()
Inverts this matrix as an affine matrix.
|
Matrix4 |
invertAffine(Matrix4 result)
Inverts this matrix as an affine matrix and places the result in the given object.
|
Matrix4 |
invertAffineLocal()
Inverts this matrix in-place as an affine matrix.
|
Matrix4 |
invertLocal()
Inverts this matrix in-place.
|
boolean |
isAffine()
Determines whether this matrix represents an affine transformation.
|
boolean |
isMirrored()
Determines whether the matrix is mirrored.
|
Matrix4 |
lerp(IMatrix4 other,
double t)
Linearly interpolates between this and the specified other matrix.
|
Matrix4 |
lerp(IMatrix4 other,
double t,
Matrix4 result)
Linearly interpolates between this and the specified other matrix, placing the result in
the object provided.
|
Matrix4 |
lerpAffine(IMatrix4 other,
double t)
Linearly interpolates between this and the specified other matrix, treating the matrices as
affine.
|
Matrix4 |
lerpAffine(IMatrix4 other,
double t,
Matrix4 result)
Linearly interpolates between this and the specified other matrix (treating the matrices as
affine), placing the result in the object provided.
|
Matrix4 |
lerpAffineLocal(IMatrix4 other,
double t)
Linearly interpolates between this and the specified other matrix (treating the matrices as
affine), placing the result in this matrix.
|
Matrix4 |
lerpLocal(IMatrix4 other,
double t)
Linearly interpolates between the this and the specified other matrix, placing the result in
this matrix.
|
double |
m00()
Returns the (0,0)th component of the matrix.
|
double |
m01()
Returns the (0,1)th component of the matrix.
|
double |
m02()
Returns the (0,2)th component of the matrix.
|
double |
m03()
Returns the (0,3)th component of the matrix.
|
double |
m10()
Returns the (1,0)th component of the matrix.
|
double |
m11()
Returns the (1,1)th component of the matrix.
|
double |
m12()
Returns the (1,2)th component of the matrix.
|
double |
m13()
Returns the (1,3)th component of the matrix.
|
double |
m20()
Returns the (2,0)th component of the matrix.
|
double |
m21()
Returns the (2,1)th component of the matrix.
|
double |
m22()
Returns the (2,2)th component of the matrix.
|
double |
m23()
Returns the (2,3)th component of the matrix.
|
double |
m30()
Returns the (3,0)th component of the matrix.
|
double |
m31()
Returns the (3,1)th component of the matrix.
|
double |
m32()
Returns the (3,2)th component of the matrix.
|
double |
m33()
Returns the (3,3)th component of the matrix.
|
Matrix4 |
mult(IMatrix4 other)
Multiplies this matrix by another.
|
Matrix4 |
mult(IMatrix4 other,
Matrix4 result)
Multiplies this matrix by another and stores the result in the object provided.
|
Matrix4 |
multAffine(IMatrix4 other)
Multiplies this matrix by another, treating the matrices as affine.
|
Matrix4 |
multAffine(IMatrix4 other,
Matrix4 result)
Multiplies this matrix by another, treating the matrices as affine, and stores the result
in the object provided.
|
Matrix4 |
multAffineLocal(IMatrix4 other)
Multiplies this matrix in-place by another, treating the matricees as affine.
|
Matrix4 |
multLocal(IMatrix4 other)
Multiplies this matrix in-place by another.
|
Vector3 |
projectPoint(IVector3 point)
Projects the supplied point using this matrix.
|
Vector3 |
projectPoint(IVector3 point,
Vector3 result)
Projects the supplied point using this matrix and places the result in the object supplied.
|
Vector3 |
projectPointLocal(Vector3 point)
Projects the supplied point in-place using this matrix.
|
Matrix4 |
set(double[] values)
Copies the elements of a row-major array.
|
Matrix4 |
set(DoubleBuffer buf)
Sets the contents of this matrix from the supplied (column-major) buffer.
|
Matrix4 |
set(double m00,
double m10,
double m20,
double m30,
double m01,
double m11,
double m21,
double m31,
double m02,
double m12,
double m22,
double m32,
double m03,
double m13,
double m23,
double m33)
Sets all of the matrix's components at once.
|
Matrix4 |
set(IMatrix4 other)
Copies the contents of another matrix.
|
Matrix4 |
setToFrustum(double left,
double right,
double bottom,
double top,
double near,
double far)
Sets this to a perspective projection matrix.
|
Matrix4 |
setToFrustum(double left,
double right,
double bottom,
double top,
double near,
double far,
IVector3 nearFarNormal)
Sets this to a perspective projection matrix.
|
Matrix4 |
setToIdentity()
Sets this matrix to the identity matrix.
|
Matrix4 |
setToOrtho(double left,
double right,
double bottom,
double top,
double near,
double far)
Sets this to an orthographic projection matrix.
|
Matrix4 |
setToOrtho(double left,
double right,
double bottom,
double top,
double near,
double far,
IVector3 nearFarNormal)
Sets this to an orthographic projection matrix.
|
Matrix4 |
setToPerspective(double fovy,
double aspect,
double near,
double far)
Sets this to a perspective projection matrix.
|
Matrix4 |
setToReflection(double x,
double y,
double z)
Sets this to a reflection across a plane intersecting the origin with the supplied normal.
|
Matrix4 |
setToReflection(double x,
double y,
double z,
double w)
Sets this to a reflection across the specified plane.
|
Matrix4 |
setToReflection(IPlane plane)
Sets this to a reflection across the specified plane.
|
Matrix4 |
setToReflection(IVector3 normal)
Sets this to a reflection across a plane intersecting the origin with the supplied normal.
|
Matrix4 |
setToReflection(IVector3 normal,
double constant)
Sets this to a reflection across the specified plane.
|
Matrix4 |
setToRotation(double angle,
double x,
double y,
double z)
Sets this to a rotation matrix.
|
Matrix4 |
setToRotation(double angle,
IVector3 axis)
Sets this to a rotation matrix.
|
Matrix4 |
setToRotation(IQuaternion quat)
Sets this to a rotation matrix.
|
Matrix4 |
setToRotation(IVector3 from,
IVector3 to)
Sets this to a rotation matrix that rotates one vector onto another.
|
Matrix4 |
setToRotationScale(pythagoras.d.IMatrix3 rotScale)
Sets this to a rotation plus scale matrix.
|
Matrix4 |
setToScale(double s)
Sets this to a uniform scale matrix.
|
Matrix4 |
setToScale(double x,
double y,
double z)
Sets this to a scale matrix.
|
Matrix4 |
setToScale(IVector3 scale)
Sets this to a scale matrix.
|
Matrix4 |
setToSkew(double a,
double b,
double c,
double d,
double x,
double y,
double z)
Sets this to a skew by the specified amount relative to the given plane.
|
Matrix4 |
setToSkew(IPlane plane,
IVector3 amount)
Sets this to a skew by the specified amount relative to the given plane.
|
Matrix4 |
setToSkew(IVector3 normal,
double constant,
IVector3 amount)
Sets this to a skew by the specified amount relative to the given plane.
|
Matrix4 |
setToTransform(IVector3 translation,
IQuaternion rotation)
Sets this to a matrix that first rotates, then translates.
|
Matrix4 |
setToTransform(IVector3 translation,
IQuaternion rotation,
double scale)
Sets this to a matrix that first scales, then rotates, then translates.
|
Matrix4 |
setToTransform(IVector3 translation,
IQuaternion rotation,
IVector3 scale)
Sets this to a matrix that first scales, then rotates, then translates.
|
Matrix4 |
setToTranslation(double x,
double y,
double z)
Sets this to a translation matrix.
|
Matrix4 |
setToTranslation(IVector3 translation)
Sets this to a translation matrix.
|
Matrix4 |
setToZero()
Sets this matrix to all zeroes.
|
Matrix4 |
setTranslation(double x,
double y,
double z)
Sets the translation component of this matrix.
|
Matrix4 |
setTranslation(IVector3 translation)
Sets the translation component of this matrix.
|
String |
toString() |
Vector4 |
transform(IVector4 vector)
Transforms
vector by this matrix (M * V). |
Vector4 |
transform(IVector4 vector,
Vector4 result)
Transforms
vector by this matrix (M * V) and stores the result in the object
provided. |
Vector3 |
transformPoint(IVector3 point)
Transforms a point by this matrix.
|
Vector3 |
transformPoint(IVector3 point,
Vector3 result)
Transforms a point by this matrix and places the result in the object provided.
|
Vector3 |
transformPointLocal(Vector3 point)
Transforms a point in-place by this matrix.
|
double |
transformPointZ(IVector3 point)
Transforms a point by this matrix and returns the resulting z coordinate.
|
Vector3 |
transformVector(IVector3 vector)
Transforms a vector by this inner 3x3 part of this matrix.
|
Vector3 |
transformVector(IVector3 vector,
Vector3 result)
Transforms a vector by the inner 3x3 part of this matrix and places the result in the object
provided.
|
Vector3 |
transformVectorLocal(Vector3 vector)
Transforms a vector in-place by the inner 3x3 part of this matrix.
|
Matrix4 |
transpose()
Transposes this matrix.
|
Matrix4 |
transpose(Matrix4 result)
Transposes this matrix, storing the result in the provided object.
|
Matrix4 |
transposeLocal()
Transposes this matrix in-place.
|
public static final IMatrix4 IDENTITY
public static final Matrix4[] EMPTY_ARRAY
public double m00
mCOLROW
.public double m10
mCOLROW
.public double m20
mCOLROW
.public double m30
mCOLROW
.public double m01
public double m11
public double m21
public double m31
public double m02
public double m12
public double m22
public double m32
public double m03
public double m13
public double m23
public double m33
public Matrix4(double m00, double m10, double m20, double m30, double m01, double m11, double m21, double m31, double m02, double m12, double m22, double m32, double m03, double m13, double m23, double m33)
public Matrix4(double[] values)
public Matrix4(DoubleBuffer buf)
public Matrix4(IMatrix4 other)
public Matrix4()
public Matrix4 setToIdentity()
public Matrix4 setToZero()
public Matrix4 setToTransform(IVector3 translation, IQuaternion rotation)
public Matrix4 setToTransform(IVector3 translation, IQuaternion rotation, double scale)
public Matrix4 setToTransform(IVector3 translation, IQuaternion rotation, IVector3 scale)
public Matrix4 setToTranslation(IVector3 translation)
public Matrix4 setToTranslation(double x, double y, double z)
public Matrix4 setTranslation(IVector3 translation)
public Matrix4 setTranslation(double x, double y, double z)
public Matrix4 setToRotation(IVector3 from, IVector3 to)
public Matrix4 setToRotation(double angle, IVector3 axis)
public Matrix4 setToRotation(double angle, double x, double y, double z)
public Matrix4 setToRotation(IQuaternion quat)
public Matrix4 setToRotationScale(pythagoras.d.IMatrix3 rotScale)
public Matrix4 setToScale(IVector3 scale)
public Matrix4 setToScale(double s)
public Matrix4 setToScale(double x, double y, double z)
public Matrix4 setToReflection(IVector3 normal)
public Matrix4 setToReflection(double x, double y, double z)
public Matrix4 setToReflection(IPlane plane)
public Matrix4 setToReflection(IVector3 normal, double constant)
public Matrix4 setToReflection(double x, double y, double z, double w)
public Matrix4 setToSkew(IPlane plane, IVector3 amount)
public Matrix4 setToSkew(IVector3 normal, double constant, IVector3 amount)
public Matrix4 setToSkew(double a, double b, double c, double d, double x, double y, double z)
public Matrix4 setToPerspective(double fovy, double aspect, double near, double far)
public Matrix4 setToFrustum(double left, double right, double bottom, double top, double near, double far)
public Matrix4 setToFrustum(double left, double right, double bottom, double top, double near, double far, IVector3 nearFarNormal)
public Matrix4 setToOrtho(double left, double right, double bottom, double top, double near, double far)
public Matrix4 setToOrtho(double left, double right, double bottom, double top, double near, double far, IVector3 nearFarNormal)
public Matrix4 set(IMatrix4 other)
public Matrix4 set(double[] values)
public Matrix4 set(DoubleBuffer buf)
public Matrix4 set(double m00, double m10, double m20, double m30, double m01, double m11, double m21, double m31, double m02, double m12, double m22, double m32, double m03, double m13, double m23, double m33)
public Matrix4 transposeLocal()
public Matrix4 multLocal(IMatrix4 other)
public Matrix4 multAffineLocal(IMatrix4 other)
public Matrix4 invertLocal()
public Matrix4 invertAffineLocal()
public Matrix4 lerpLocal(IMatrix4 other, double t)
public Matrix4 lerpAffineLocal(IMatrix4 other, double t)
public double m00()
IMatrix4
public double m10()
IMatrix4
public double m20()
IMatrix4
public double m30()
IMatrix4
public double m01()
IMatrix4
public double m11()
IMatrix4
public double m21()
IMatrix4
public double m31()
IMatrix4
public double m02()
IMatrix4
public double m12()
IMatrix4
public double m22()
IMatrix4
public double m32()
IMatrix4
public double m03()
IMatrix4
public double m13()
IMatrix4
public double m23()
IMatrix4
public double m33()
IMatrix4
public Matrix4 transpose()
IMatrix4
public Matrix4 transpose(Matrix4 result)
IMatrix4
public Matrix4 mult(IMatrix4 other)
IMatrix4
public Matrix4 mult(IMatrix4 other, Matrix4 result)
IMatrix4
public boolean isAffine()
IMatrix4
public boolean isMirrored()
IMatrix4
isMirrored
in interface IMatrix4
public Matrix4 multAffine(IMatrix4 other)
IMatrix4
multAffine
in interface IMatrix4
public Matrix4 multAffine(IMatrix4 other, Matrix4 result)
IMatrix4
multAffine
in interface IMatrix4
public Matrix4 invert(Matrix4 result) throws SingularMatrixException
invert
in interface IMatrix4
SingularMatrixException
public Matrix4 invertAffine()
IMatrix4
invertAffine
in interface IMatrix4
public Matrix4 invertAffine(Matrix4 result) throws SingularMatrixException
IMatrix4
invertAffine
in interface IMatrix4
SingularMatrixException
public Matrix4 lerp(IMatrix4 other, double t)
IMatrix4
public Matrix4 lerp(IMatrix4 other, double t, Matrix4 result)
IMatrix4
public Matrix4 lerpAffine(IMatrix4 other, double t)
IMatrix4
lerpAffine
in interface IMatrix4
public Matrix4 lerpAffine(IMatrix4 other, double t, Matrix4 result)
IMatrix4
lerpAffine
in interface IMatrix4
public DoubleBuffer get(DoubleBuffer buf)
IMatrix4
public Vector3 projectPointLocal(Vector3 point)
IMatrix4
projectPointLocal
in interface IMatrix4
public Vector3 projectPoint(IVector3 point)
IMatrix4
projectPoint
in interface IMatrix4
public Vector3 projectPoint(IVector3 point, Vector3 result)
IMatrix4
projectPoint
in interface IMatrix4
public Vector3 transformPointLocal(Vector3 point)
IMatrix4
transformPointLocal
in interface IMatrix4
public Vector3 transformPoint(IVector3 point)
IMatrix4
transformPoint
in interface IMatrix4
public Vector3 transformPoint(IVector3 point, Vector3 result)
IMatrix4
transformPoint
in interface IMatrix4
public double transformPointZ(IVector3 point)
IMatrix4
transformPointZ
in interface IMatrix4
public Vector3 transformVectorLocal(Vector3 vector)
IMatrix4
transformVectorLocal
in interface IMatrix4
public Vector3 transformVector(IVector3 vector)
IMatrix4
transformVector
in interface IMatrix4
public Vector3 transformVector(IVector3 vector, Vector3 result)
IMatrix4
transformVector
in interface IMatrix4
public Vector4 transform(IVector4 vector)
IMatrix4
vector
by this matrix (M * V).public Vector4 transform(IVector4 vector, Vector4 result)
IMatrix4
vector
by this matrix (M * V) and stores the result in the object
provided.public Quaternion extractRotation()
IMatrix4
extractRotation
in interface IMatrix4
public Quaternion extractRotation(Quaternion result) throws SingularMatrixException
extractRotation
in interface IMatrix4
SingularMatrixException
public Matrix3 extractRotationScale(Matrix3 result)
IMatrix4
extractRotationScale
in interface IMatrix4
result
, for chaining.public Vector3 extractScale()
IMatrix4
extractScale
in interface IMatrix4
public Vector3 extractScale(Vector3 result)
IMatrix4
extractScale
in interface IMatrix4
public double approximateUniformScale()
IMatrix4
approximateUniformScale
in interface IMatrix4
public boolean epsilonEquals(IMatrix4 other, double epsilon)
IMatrix4
epsilonEquals
in interface IMatrix4
Copyright © 2017. All rights reserved.