|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.threerings.math.Matrix4f
public final class Matrix4f
A 4x4 column-major matrix.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from interface com.threerings.io.Streamable |
|---|
com.threerings.io.Streamable.Closure |
| Field Summary | |
|---|---|
static Matrix4f[] |
EMPTY_ARRAY
An empty matrix array. |
static Matrix4f |
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 Summary | |
|---|---|
Matrix4f()
Creates an identity matrix. |
|
Matrix4f(float[] values)
Creates a matrix from an array of values. |
|
Matrix4f(FloatBuffer buf)
Creates a matrix from a float buffer. |
|
Matrix4f(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. |
|
Matrix4f(Matrix4f other)
Copy constructor. |
|
| Method Summary | |
|---|---|
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). |
void |
decodeFromStream(DataInputStream in)
Initializes this object with data read from the specified stream. |
void |
decodeFromString(String string)
Initializes this object with the contents of the specified string. |
void |
encodeToStream(DataOutputStream out)
Encodes this object to the specified stream. |
String |
encodeToString()
Returns a string representation of this object. |
boolean |
epsilonEquals(Matrix4f 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. |
Vector3f |
extractScale()
Extracts the scale component of the matrix. |
Vector3f |
extractScale(Vector3f 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()
|
Matrix4f |
invert()
Inverts this matrix. |
Matrix4f |
invert(Matrix4f result)
Inverts this matrix and places the result in the given object. |
Matrix4f |
invertAffine()
Inverts this matrix as an affine matrix. |
Matrix4f |
invertAffine(Matrix4f result)
Inverts this matrix as an affine matrix and places the result in the given object. |
Matrix4f |
invertAffineLocal()
Inverts this matrix in-place as an affine matrix. |
Matrix4f |
invertLocal()
Inverts this matrix in-place. |
boolean |
isAffine()
Determines whether this matrix represents an affine transformation. |
boolean |
isMirrored()
Determines whether the matrix is mirrored. |
Matrix4f |
lerp(Matrix4f other,
float t)
Linearly interpolates between this and the specified other matrix. |
Matrix4f |
lerp(Matrix4f other,
float t,
Matrix4f result)
Linearly interpolates between this and the specified other matrix, placing the result in the object provided. |
Matrix4f |
lerpAffine(Matrix4f other,
float t)
Linearly interpolates between this and the specified other matrix, treating the matrices as affine. |
Matrix4f |
lerpAffine(Matrix4f other,
float t,
Matrix4f result)
Linearly interpolates between this and the specified other matrix (treating the matrices as affine), placing the result in the object provided. |
Matrix4f |
lerpAffineLocal(Matrix4f other,
float t)
Linearly interpolates between this and the specified other matrix (treating the matrices as affine), placing the result in this matrix. |
Matrix4f |
lerpLocal(Matrix4f other,
float t)
Linearly interpolates between the this and the specified other matrix, placing the result in this matrix. |
Matrix4f |
mult(Matrix4f other)
Multiplies this matrix by another. |
Matrix4f |
mult(Matrix4f other,
Matrix4f result)
Multiplies this matrix by another and stores the result in the object provided. |
Matrix4f |
multAffine(Matrix4f other)
Multiplies this matrix by another, treating the matrices as affine. |
Matrix4f |
multAffine(Matrix4f other,
Matrix4f result)
Multiplies this matrix by another, treating the matrices as affine, and stores the result in the object provided. |
Matrix4f |
multAffineLocal(Matrix4f other)
Multiplies this matrix in-place by another, treating the matricees as affine. |
Matrix4f |
multLocal(Matrix4f other)
Multiplies this matrix in-place by another. |
Vector3f |
projectPoint(Vector3f point)
Projects the supplied point using this matrix. |
Vector3f |
projectPoint(Vector3f point,
Vector3f result)
Projects the supplied point using this matrix and places the result in the object supplied. |
Vector3f |
projectPointLocal(Vector3f point)
Projects the supplied point in-place using this matrix. |
Matrix4f |
set(float[] values)
Copies the elements of an array. |
Matrix4f |
set(FloatBuffer buf)
Sets the contents of this matrix from the supplied buffer. |
Matrix4f |
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. |
Matrix4f |
set(Matrix4f other)
Copies the contents of another matrix. |
Matrix4f |
setToFrustum(float left,
float right,
float bottom,
float top,
float near,
float far)
Sets this to a perspective projection matrix. |
Matrix4f |
setToFrustum(float left,
float right,
float bottom,
float top,
float near,
float far,
Vector3f nearFarNormal)
Sets this to a perspective projection matrix. |
Matrix4f |
setToIdentity()
Sets this matrix to the identity matrix. |
Matrix4f |
setToOrtho(float left,
float right,
float bottom,
float top,
float near,
float far)
Sets this to an orthographic projection matrix. |
Matrix4f |
setToOrtho(float left,
float right,
float bottom,
float top,
float near,
float far,
Vector3f nearFarNormal)
Sets this to an orthographic projection matrix. |
Matrix4f |
setToPerspective(float fovy,
float aspect,
float near,
float far)
Sets this to a perspective projection matrix. |
Matrix4f |
setToReflection(float x,
float y,
float z)
Sets this to a reflection across a plane intersecting the origin with the supplied normal. |
Matrix4f |
setToReflection(float x,
float y,
float z,
float w)
Sets this to a reflection across the specified plane. |
Matrix4f |
setToReflection(Plane plane)
Sets this to a reflection across the specified plane. |
Matrix4f |
setToReflection(Vector3f normal)
Sets this to a reflection across a plane intersecting the origin with the supplied normal. |
Matrix4f |
setToReflection(Vector3f normal,
float constant)
Sets this to a reflection across the specified plane. |
Matrix4f |
setToRotation(float angle,
float x,
float y,
float z)
Sets this to a rotation matrix. |
Matrix4f |
setToRotation(float angle,
Vector3f axis)
Sets this to a rotation matrix. |
Matrix4f |
setToRotation(Quaternion quat)
Sets this to a rotation matrix. |
Matrix4f |
setToRotation(Vector3f from,
Vector3f to)
Sets this to a rotation matrix that rotates one vector onto another. |
Matrix4f |
setToScale(float s)
Sets this to a uniform scale matrix. |
Matrix4f |
setToScale(float x,
float y,
float z)
Sets this to a scale matrix. |
Matrix4f |
setToScale(Vector3f scale)
Sets this to a scale matrix. |
Matrix4f |
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. |
Matrix4f |
setToSkew(Plane plane,
Vector3f amount)
Sets this to a skew by the specified amount relative to the given plane. |
Matrix4f |
setToSkew(Vector3f normal,
float constant,
Vector3f amount)
Sets this to a skew by the specified amount relative to the given plane. |
Matrix4f |
setToTransform(Vector3f translation,
Quaternion rotation)
Sets this to a matrix that first rotates, then translates. |
Matrix4f |
setToTransform(Vector3f translation,
Quaternion rotation,
float scale)
Sets this to a matrix that first scales, then rotates, then translates. |
Matrix4f |
setToTransform(Vector3f translation,
Quaternion rotation,
Vector3f scale)
Sets this to a matrix that first scales, then rotates, then translates. |
Matrix4f |
setToTranslation(float x,
float y,
float z)
Sets this to a translation matrix. |
Matrix4f |
setToTranslation(Vector3f translation)
Sets this to a translation matrix. |
Matrix4f |
setTranslation(float x,
float y,
float z)
Sets the translation component of this matrix. |
Matrix4f |
setTranslation(Vector3f translation)
Sets the translation component of this matrix. |
String |
toString()
|
Vector3f |
transformPoint(Vector3f point)
Transforms a point by this matrix. |
Vector3f |
transformPoint(Vector3f point,
Vector3f result)
Transforms a point by this matrix and places the result in the object provided. |
Vector3f |
transformPointLocal(Vector3f point)
Transforms a point in-place by this matrix. |
float |
transformPointZ(Vector3f point)
Transforms a point by this matrix and returns the resulting z coordinate. |
Vector3f |
transformVector(Vector3f vector)
Transforms a vector by this inner 3x3 part of this matrix. |
Vector3f |
transformVector(Vector3f vector,
Vector3f result)
Transforms a vector by the inner 3x3 part of this matrix and places the result in the object provided. |
Vector3f |
transformVectorLocal(Vector3f vector)
Transforms a vector in-place by the inner 3x3 part of this matrix. |
Matrix4f |
transpose()
Transposes this matrix. |
Matrix4f |
transpose(Matrix4f result)
Transposes this matrix, storing the result in the provided object. |
Matrix4f |
transposeLocal()
Transposes this matrix in-place. |
| Methods inherited from class java.lang.Object |
|---|
getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final Matrix4f IDENTITY
public static final Matrix4f[] EMPTY_ARRAY
public float m00
public float m10
public float m20
public float m30
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
| Constructor Detail |
|---|
public Matrix4f(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 Matrix4f(float[] values)
public Matrix4f(FloatBuffer buf)
public Matrix4f(Matrix4f other)
public Matrix4f()
| Method Detail |
|---|
public Matrix4f setToIdentity()
public Matrix4f setToTransform(Vector3f translation,
Quaternion rotation)
public Matrix4f setToTransform(Vector3f translation,
Quaternion rotation,
float scale)
public Matrix4f setToTransform(Vector3f translation,
Quaternion rotation,
Vector3f scale)
public Matrix4f setToTranslation(Vector3f translation)
public Matrix4f setToTranslation(float x,
float y,
float z)
public Matrix4f setTranslation(Vector3f translation)
public Matrix4f setTranslation(float x,
float y,
float z)
public Matrix4f setToRotation(Vector3f from,
Vector3f to)
public Matrix4f setToRotation(float angle,
Vector3f axis)
public Matrix4f setToRotation(float angle,
float x,
float y,
float z)
public Matrix4f setToRotation(Quaternion quat)
public Matrix4f setToScale(Vector3f scale)
public Matrix4f setToScale(float s)
public Matrix4f setToScale(float x,
float y,
float z)
public Matrix4f setToReflection(Vector3f normal)
public Matrix4f setToReflection(float x,
float y,
float z)
public Matrix4f setToReflection(Plane plane)
public Matrix4f setToReflection(Vector3f normal,
float constant)
public Matrix4f setToReflection(float x,
float y,
float z,
float w)
public Matrix4f setToSkew(Plane plane,
Vector3f amount)
public Matrix4f setToSkew(Vector3f normal,
float constant,
Vector3f amount)
public Matrix4f setToSkew(float a,
float b,
float c,
float d,
float x,
float y,
float z)
public Matrix4f setToPerspective(float fovy,
float aspect,
float near,
float far)
public Matrix4f setToFrustum(float left,
float right,
float bottom,
float top,
float near,
float far)
public Matrix4f setToFrustum(float left,
float right,
float bottom,
float top,
float near,
float far,
Vector3f nearFarNormal)
public Matrix4f setToOrtho(float left,
float right,
float bottom,
float top,
float near,
float far)
public Matrix4f setToOrtho(float left,
float right,
float bottom,
float top,
float near,
float far,
Vector3f nearFarNormal)
public Matrix4f transposeLocal()
public Matrix4f transpose()
public Matrix4f transpose(Matrix4f result)
public Matrix4f multLocal(Matrix4f other)
public Matrix4f mult(Matrix4f other)
public Matrix4f mult(Matrix4f other,
Matrix4f result)
public boolean isAffine()
public boolean isMirrored()
public Matrix4f multAffineLocal(Matrix4f other)
public Matrix4f multAffine(Matrix4f other)
public Matrix4f multAffine(Matrix4f other,
Matrix4f result)
public Matrix4f invertLocal()
public Matrix4f invert()
public Matrix4f invert(Matrix4f result)
throws SingularMatrixException
SingularMatrixExceptionpublic Matrix4f invertAffineLocal()
public Matrix4f invertAffine()
public Matrix4f invertAffine(Matrix4f result)
throws SingularMatrixException
SingularMatrixException
public Matrix4f lerpLocal(Matrix4f other,
float t)
public Matrix4f lerp(Matrix4f other,
float t)
public Matrix4f lerp(Matrix4f other,
float t,
Matrix4f result)
public Matrix4f lerpAffineLocal(Matrix4f other,
float t)
public Matrix4f lerpAffine(Matrix4f other,
float t)
public Matrix4f lerpAffine(Matrix4f other,
float t,
Matrix4f result)
public Matrix4f set(Matrix4f other)
public Matrix4f set(float[] values)
public Matrix4f set(FloatBuffer buf)
public Matrix4f 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 FloatBuffer get(FloatBuffer buf)
public Vector3f projectPointLocal(Vector3f point)
public Vector3f projectPoint(Vector3f point)
public Vector3f projectPoint(Vector3f point,
Vector3f result)
public Vector3f transformPointLocal(Vector3f point)
public Vector3f transformPoint(Vector3f point)
public Vector3f transformPoint(Vector3f point,
Vector3f result)
public float transformPointZ(Vector3f point)
public Vector3f transformVectorLocal(Vector3f vector)
public Vector3f transformVector(Vector3f vector)
public Vector3f transformVector(Vector3f vector,
Vector3f result)
public Quaternion extractRotation()
public Quaternion extractRotation(Quaternion result)
public Vector3f extractScale()
public Vector3f extractScale(Vector3f result)
public float approximateUniformScale()
public boolean epsilonEquals(Matrix4f other,
float epsilon)
public String encodeToString()
Encodable
encodeToString in interface Encodable
public void decodeFromString(String string)
throws Exception
Encodable
decodeFromString in interface EncodableException
public void encodeToStream(DataOutputStream out)
throws IOException
Encodable
encodeToStream in interface EncodableIOException
public void decodeFromStream(DataInputStream in)
throws IOException
Encodable
decodeFromStream in interface EncodableIOExceptionpublic String toString()
toString in class Objectpublic int hashCode()
hashCode in class Objectpublic boolean equals(Object other)
equals in class Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||