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.
|
float |
m00
The values of the matrix.
|
float |
m01 |
float |
m02 |
float |
m03 |
float |
m10
The values of the matrix.
|
float |
m11 |
float |
m12 |
float |
m13 |
float |
m20
The values of the matrix.
|
float |
m21 |
float |
m22 |
float |
m23 |
float |
m30
The values of the matrix.
|
float |
m31 |
float |
m32 |
float |
m33 |
Constructor and Description |
---|
Matrix4()
Creates an identity matrix.
|
Matrix4(float[] values)
Creates a matrix from an array of values.
|
Matrix4(FloatBuffer buf)
Creates a matrix from a float buffer.
|
Matrix4(float m00,
float m10,
float m20,
float m30,
float m01,
float m11,
float m21,
float m31,
float m02,
float m12,
float m22,
float m32,
float m03,
float m13,
float m23,
float m33)
Creates a matrix from its components.
|
Matrix4(IMatrix4 other)
Copy constructor.
|
Modifier and Type | Method and Description |
---|---|
float |
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,
float 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.
|
FloatBuffer |
get(FloatBuffer 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,
float t)
Linearly interpolates between this and the specified other matrix.
|
Matrix4 |
lerp(IMatrix4 other,
float t,
Matrix4 result)
Linearly interpolates between this and the specified other matrix, placing the result in
the object provided.
|
Matrix4 |
lerpAffine(IMatrix4 other,
float t)
Linearly interpolates between this and the specified other matrix, treating the matrices as
affine.
|
Matrix4 |
lerpAffine(IMatrix4 other,
float 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,
float 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,
float t)
Linearly interpolates between the this and the specified other matrix, placing the result in
this matrix.
|
float |
m00()
Returns the (0,0)th component of the matrix.
|
float |
m01()
Returns the (0,1)th component of the matrix.
|
float |
m02()
Returns the (0,2)th component of the matrix.
|
float |
m03()
Returns the (0,3)th component of the matrix.
|
float |
m10()
Returns the (1,0)th component of the matrix.
|
float |
m11()
Returns the (1,1)th component of the matrix.
|
float |
m12()
Returns the (1,2)th component of the matrix.
|
float |
m13()
Returns the (1,3)th component of the matrix.
|
float |
m20()
Returns the (2,0)th component of the matrix.
|
float |
m21()
Returns the (2,1)th component of the matrix.
|
float |
m22()
Returns the (2,2)th component of the matrix.
|
float |
m23()
Returns the (2,3)th component of the matrix.
|
float |
m30()
Returns the (3,0)th component of the matrix.
|
float |
m31()
Returns the (3,1)th component of the matrix.
|
float |
m32()
Returns the (3,2)th component of the matrix.
|
float |
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(float[] values)
Copies the elements of a row-major array.
|
Matrix4 |
set(FloatBuffer buf)
Sets the contents of this matrix from the supplied (column-major) buffer.
|
Matrix4 |
set(float m00,
float m10,
float m20,
float m30,
float m01,
float m11,
float m21,
float m31,
float m02,
float m12,
float m22,
float m32,
float m03,
float m13,
float m23,
float m33)
Sets all of the matrix's components at once.
|
Matrix4 |
set(IMatrix4 other)
Copies the contents of another matrix.
|
Matrix4 |
setToFrustum(float left,
float right,
float bottom,
float top,
float near,
float far)
Sets this to a perspective projection matrix.
|
Matrix4 |
setToFrustum(float left,
float right,
float bottom,
float top,
float near,
float far,
IVector3 nearFarNormal)
Sets this to a perspective projection matrix.
|
Matrix4 |
setToIdentity()
Sets this matrix to the identity matrix.
|
Matrix4 |
setToOrtho(float left,
float right,
float bottom,
float top,
float near,
float far)
Sets this to an orthographic projection matrix.
|
Matrix4 |
setToOrtho(float left,
float right,
float bottom,
float top,
float near,
float far,
IVector3 nearFarNormal)
Sets this to an orthographic projection matrix.
|
Matrix4 |
setToPerspective(float fovy,
float aspect,
float near,
float far)
Sets this to a perspective projection matrix.
|
Matrix4 |
setToReflection(float x,
float y,
float z)
Sets this to a reflection across a plane intersecting the origin with the supplied normal.
|
Matrix4 |
setToReflection(float x,
float y,
float z,
float 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,
float constant)
Sets this to a reflection across the specified plane.
|
Matrix4 |
setToRotation(float angle,
float x,
float y,
float z)
Sets this to a rotation matrix.
|
Matrix4 |
setToRotation(float 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.f.IMatrix3 rotScale)
Sets this to a rotation plus scale matrix.
|
Matrix4 |
setToScale(float s)
Sets this to a uniform scale matrix.
|
Matrix4 |
setToScale(float x,
float y,
float z)
Sets this to a scale matrix.
|
Matrix4 |
setToScale(IVector3 scale)
Sets this to a scale matrix.
|
Matrix4 |
setToSkew(float a,
float b,
float c,
float d,
float x,
float y,
float 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,
float 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,
float 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(float x,
float y,
float 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(float x,
float y,
float 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.
|
float |
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 float m00
mCOLROW
.public float m10
mCOLROW
.public float m20
mCOLROW
.public float m30
mCOLROW
.public float m01
public float m11
public float m21
public float m31
public float m02
public float m12
public float m22
public float m32
public float m03
public float m13
public float m23
public float m33
public Matrix4(float m00, float m10, float m20, float m30, float m01, float m11, float m21, float m31, float m02, float m12, float m22, float m32, float m03, float m13, float m23, float m33)
public Matrix4(float[] values)
public Matrix4(FloatBuffer 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, float scale)
public Matrix4 setToTransform(IVector3 translation, IQuaternion rotation, IVector3 scale)
public Matrix4 setToTranslation(IVector3 translation)
public Matrix4 setToTranslation(float x, float y, float z)
public Matrix4 setTranslation(IVector3 translation)
public Matrix4 setTranslation(float x, float y, float z)
public Matrix4 setToRotation(IVector3 from, IVector3 to)
public Matrix4 setToRotation(float angle, IVector3 axis)
public Matrix4 setToRotation(float angle, float x, float y, float z)
public Matrix4 setToRotation(IQuaternion quat)
public Matrix4 setToRotationScale(pythagoras.f.IMatrix3 rotScale)
public Matrix4 setToScale(IVector3 scale)
public Matrix4 setToScale(float s)
public Matrix4 setToScale(float x, float y, float z)
public Matrix4 setToReflection(IVector3 normal)
public Matrix4 setToReflection(float x, float y, float z)
public Matrix4 setToReflection(IPlane plane)
public Matrix4 setToReflection(IVector3 normal, float constant)
public Matrix4 setToReflection(float x, float y, float z, float w)
public Matrix4 setToSkew(IPlane plane, IVector3 amount)
public Matrix4 setToSkew(IVector3 normal, float constant, IVector3 amount)
public Matrix4 setToSkew(float a, float b, float c, float d, float x, float y, float z)
public Matrix4 setToPerspective(float fovy, float aspect, float near, float far)
public Matrix4 setToFrustum(float left, float right, float bottom, float top, float near, float far)
public Matrix4 setToFrustum(float left, float right, float bottom, float top, float near, float far, IVector3 nearFarNormal)
public Matrix4 setToOrtho(float left, float right, float bottom, float top, float near, float far)
public Matrix4 setToOrtho(float left, float right, float bottom, float top, float near, float far, IVector3 nearFarNormal)
public Matrix4 set(IMatrix4 other)
public Matrix4 set(float[] values)
public Matrix4 set(FloatBuffer buf)
public Matrix4 set(float m00, float m10, float m20, float m30, float m01, float m11, float m21, float m31, float m02, float m12, float m22, float m32, float m03, float m13, float m23, float 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, float t)
public Matrix4 lerpAffineLocal(IMatrix4 other, float t)
public float m00()
IMatrix4
public float m10()
IMatrix4
public float m20()
IMatrix4
public float m30()
IMatrix4
public float m01()
IMatrix4
public float m11()
IMatrix4
public float m21()
IMatrix4
public float m31()
IMatrix4
public float m02()
IMatrix4
public float m12()
IMatrix4
public float m22()
IMatrix4
public float m32()
IMatrix4
public float m03()
IMatrix4
public float m13()
IMatrix4
public float m23()
IMatrix4
public float 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, float t)
IMatrix4
public Matrix4 lerp(IMatrix4 other, float t, Matrix4 result)
IMatrix4
public Matrix4 lerpAffine(IMatrix4 other, float t)
IMatrix4
lerpAffine
in interface IMatrix4
public Matrix4 lerpAffine(IMatrix4 other, float t, Matrix4 result)
IMatrix4
lerpAffine
in interface IMatrix4
public FloatBuffer get(FloatBuffer 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 float 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 float approximateUniformScale()
IMatrix4
approximateUniformScale
in interface IMatrix4
public boolean epsilonEquals(IMatrix4 other, float epsilon)
IMatrix4
epsilonEquals
in interface IMatrix4
Copyright © 2017. All rights reserved.