|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.threerings.math.Transform3D
public final class Transform3D
Represents a 3D transformation in such a way as to accelerate operations such as composition and inversion by keeping track of the nature of the transform.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from interface com.threerings.io.Streamable |
|---|
com.threerings.io.Streamable.Closure |
| Field Summary | |
|---|---|
static int |
AFFINE
An affine transformation represented by the upper three rows of a 4x4 matrix. |
static int |
GENERAL
A general transformation represented by a 4x4 matrix. |
static int |
IDENTITY
An identity transformation. |
static int |
RIGID
A rigid transformation represented by a translation vector and a rotation quaternion. |
static int |
UNIFORM
A transformation represented by translation, rotation, and a uniform scale value. |
| Constructor Summary | |
|---|---|
Transform3D()
Creates an identity transformation. |
|
Transform3D(int type)
Creates an identity transformation of the specified type. |
|
Transform3D(Matrix4f matrix)
Creates a transformation from the values in the supplied matrix. |
|
Transform3D(Matrix4f matrix,
boolean affine)
Creates a transformation from the values in the supplied matrix. |
|
Transform3D(Transform2D transform)
Creates a transform from the supplied 2D transform. |
|
Transform3D(Transform3D transform)
Copy constructor. |
|
Transform3D(Vector3f translation,
Quaternion rotation)
Creates a transformation from the values in the supplied objects. |
|
Transform3D(Vector3f translation,
Quaternion rotation,
float scale)
Creates a transformation from the values in the supplied objects. |
|
Transform3D(Vector3f translation,
Quaternion rotation,
Vector3f scale)
Creates a transformation from the values in the supplied objects. |
|
| Method Summary | |
|---|---|
float |
approximateUniformScale()
Extracts an approximation of the uniform scale from this transform. |
Transform3D |
compose(Transform3D other)
Composes this transform with another. |
Transform3D |
compose(Transform3D other,
Transform3D result)
Composes this transform with another, storing the result in the object provided. |
Transform3D |
composeLocal(Transform3D other)
Composes this transform in-place with another. |
boolean |
equals(Object other)
|
Quaternion |
extractRotation()
Extracts the rotation component of the transform. |
Quaternion |
extractRotation(Quaternion result)
Extracts the rotation component of the transform and places it in the provided result quaternion. |
Vector3f |
extractScale()
Extracts the scale component of the transform. |
Vector3f |
extractScale(Vector3f result)
Extracts the scale component of the transform and places it in the provided result vector. |
Vector3f |
extractTranslation()
Extracts the translation component of the transform. |
Vector3f |
extractTranslation(Vector3f result)
Extracts the translation component of the transform and places it in the provided result vector. |
Matrix4f |
getMatrix()
Returns a reference to the transformation matrix, which is only definitive when the type is AFFINE or GENERAL. |
Quaternion |
getRotation()
Returns a reference to the rotation quaternion, which is only definitive when the type is RIGID or UNIFORM. |
float |
getScale()
Returns the uniform scale, which is only definitive when the type is UNIFORM. |
Vector3f |
getTranslation()
Returns a reference to the translation vector, which is only definitive when the type is RIGID or UNIFORM. |
int |
getType()
Returns the type of this transformation. |
int |
hashCode()
|
Transform3D |
invert()
Inverts this transform. |
Transform3D |
invert(Transform3D result)
Inverts this transform, storing the result in the provided object. |
Transform3D |
invertLocal()
Inverts this transform in-place. |
boolean |
isMirrored()
Checks whether the transform is mirrored. |
Transform3D |
lerp(Transform3D other,
float t)
Linearly interpolates between this and the specified other transform. |
Transform3D |
lerp(Transform3D other,
float t,
Transform3D result)
Linearly interpolates between this and the specified other transform, placing the result in the transform provided. |
Transform3D |
lerpLocal(Transform3D other,
float t)
Linearly interpolates between this and the specified other transform, placing the result in this transform. |
Transform3D |
promote(int type)
Promotes this transform to the specified type, which must be greater than or equal to its current type. |
void |
readFields(Importer in)
Custom field read method. |
Transform3D |
set(Matrix4f matrix)
Sets the transform using the supplied matrix. |
Transform3D |
set(Matrix4f matrix,
boolean affine)
Sets the transform using the supplied matrix. |
Transform3D |
set(Transform2D transform)
Copies the values contained in another transform. |
Transform3D |
set(Transform3D transform)
Copies the values contained in another transform. |
Transform3D |
set(Vector3f translation,
Quaternion rotation)
Sets the transform using the supplied values. |
Transform3D |
set(Vector3f translation,
Quaternion rotation,
float scale)
Sets the transform using the supplied values. |
Transform3D |
set(Vector3f translation,
Quaternion rotation,
Vector3f scale)
Sets the transform using the supplied values. |
float |
setScale(float scale)
Sets the uniform scale. |
Transform3D |
setToIdentity()
Sets the transform to the identity transform. |
void |
setType(int type)
Sets the type of the transformation. |
String |
toString()
|
Vector3f |
transformPoint(Vector3f pt)
Transforms a point by this transform. |
Vector3f |
transformPoint(Vector3f pt,
Vector3f result)
Transforms a point by this transform and places the result in the object provided. |
Vector3f |
transformPointLocal(Vector3f pt)
Transforms a point in-place by this transform. |
float |
transformPointZ(Vector3f pt)
Transforms a point by this transform and returns the z coordinate of the result. |
Vector3f |
transformVector(Vector3f vec)
Transforms a vector by this transform. |
Vector3f |
transformVector(Vector3f vec,
Vector3f result)
Transforms a vector by this transform and places the result in the object provided. |
Vector3f |
transformVectorLocal(Vector3f vec)
Transforms a vector in-place by this transform. |
Transform3D |
update(int utype)
Updates the transform fields corresponding to the specified type. |
void |
writeFields(Exporter out)
Custom field write method. |
| Methods inherited from class java.lang.Object |
|---|
getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final int IDENTITY
public static final int RIGID
public static final int UNIFORM
public static final int AFFINE
public static final int GENERAL
| Constructor Detail |
|---|
public Transform3D()
public Transform3D(int type)
public Transform3D(Vector3f translation,
Quaternion rotation)
public Transform3D(Vector3f translation,
Quaternion rotation,
float scale)
public Transform3D(Vector3f translation,
Quaternion rotation,
Vector3f scale)
public Transform3D(Matrix4f matrix)
public Transform3D(Matrix4f matrix,
boolean affine)
affine - whether or not the provided matrix is known to be affine.public Transform3D(Transform2D transform)
public Transform3D(Transform3D transform)
| Method Detail |
|---|
public int getType()
public void setType(int type)
null.
To promote to a more general transform type, see promote(int).
public Vector3f getTranslation()
RIGID or UNIFORM.
public Quaternion getRotation()
RIGID or UNIFORM.
public float getScale()
UNIFORM.
public float setScale(float scale)
public Matrix4f getMatrix()
AFFINE or GENERAL.
public Transform3D invertLocal()
public Transform3D invert()
public Transform3D invert(Transform3D result)
public Transform3D composeLocal(Transform3D other)
public Transform3D compose(Transform3D other)
public Transform3D compose(Transform3D other,
Transform3D result)
public Transform3D lerpLocal(Transform3D other,
float t)
public Transform3D lerp(Transform3D other,
float t)
public Transform3D lerp(Transform3D other,
float t,
Transform3D result)
public Transform3D set(Transform3D transform)
public Transform3D set(Transform2D transform)
public Transform3D setToIdentity()
public Transform3D set(Vector3f translation,
Quaternion rotation)
public Transform3D set(Vector3f translation,
Quaternion rotation,
float scale)
public Transform3D set(Vector3f translation,
Quaternion rotation,
Vector3f scale)
public Transform3D set(Matrix4f matrix)
public Transform3D set(Matrix4f matrix,
boolean affine)
affine - whether or not the provided matrix is affine.
public Transform3D promote(int type)
public Transform3D update(int utype)
IDENTITY and type is RIGID, then the translation
and rotation fields are set to zero and the identity quaternion, respectively.
utype - the desired type, which must be greater than or equal to the type of this
transform.
public Vector3f transformPointLocal(Vector3f pt)
public Vector3f transformPoint(Vector3f pt)
public Vector3f transformPoint(Vector3f pt,
Vector3f result)
public float transformPointZ(Vector3f pt)
public Vector3f transformVectorLocal(Vector3f vec)
public Vector3f transformVector(Vector3f vec)
public Vector3f transformVector(Vector3f vec,
Vector3f result)
public Vector3f extractTranslation()
public Vector3f extractTranslation(Vector3f result)
public Quaternion extractRotation()
public Quaternion extractRotation(Quaternion result)
public Vector3f extractScale()
public Vector3f extractScale(Vector3f result)
public float approximateUniformScale()
public boolean isMirrored()
public void writeFields(Exporter out)
throws IOException
IOException
public void readFields(Importer in)
throws IOException
IOExceptionpublic 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 | |||||||||