public final class Transform extends java.lang.Object implements Savable, java.lang.Cloneable, java.io.Serializable
Constructor and Description |
---|
Transform() |
Transform(Quaternion rot) |
Transform(Vector3f translation) |
Transform(Vector3f translation,
Quaternion rot) |
Transform(Vector3f translation,
Quaternion rot,
Vector3f scale) |
Modifier and Type | Method and Description |
---|---|
Transform |
clone()
Create a copy of this transform.
|
Transform |
combineWithParent(Transform parent)
Changes the values of this Transform according to its parent.
|
boolean |
equals(java.lang.Object obj) |
void |
fromTransformMatrix(Matrix4f mat) |
Quaternion |
getRotation()
Return the rotation quaternion in this Transform.
|
Quaternion |
getRotation(Quaternion quat)
Stores this rotation value into the given Quaternion.
|
Vector3f |
getScale()
Return the scale vector in this Transform.
|
Vector3f |
getScale(Vector3f scale)
Stores this scale value into the given vector3f.
|
Vector3f |
getTranslation()
Return the translation vector in this Transform.
|
Vector3f |
getTranslation(Vector3f trans)
Stores this translation value into the given vector3f.
|
int |
hashCode() |
void |
interpolateTransforms(Transform t1,
Transform t2,
float delta)
Sets this transform to the interpolation between the first transform and
the second by delta amount.
|
Transform |
invert() |
boolean |
isIdentity()
Test for exact identity.
|
void |
loadIdentity()
Loads the identity.
|
void |
read(JmeImporter e)
De-serialize this transform from the specified importer, for example
when loading from a J3O file.
|
Transform |
set(Transform matrixQuat)
Sets this Transform to be equal to the given Transform.
|
Transform |
setRotation(Quaternion rot)
Sets this rotation to the given Quaternion value.
|
Transform |
setScale(float scale)
Sets this scale to the given value.
|
Transform |
setScale(float x,
float y,
float z)
Sets this transform's scale to the given x,y,z values.
|
Transform |
setScale(Vector3f scale)
Sets this scale to the given value.
|
Transform |
setTranslation(float x,
float y,
float z)
Sets this transform's translation to the given x,y,z values.
|
Transform |
setTranslation(Vector3f trans)
Sets this translation to the given value.
|
java.lang.String |
toString() |
Matrix4f |
toTransformMatrix() |
Matrix4f |
toTransformMatrix(Matrix4f store) |
Vector3f |
transformInverseVector(Vector3f in,
Vector3f store) |
Vector3f |
transformVector(Vector3f in,
Vector3f store) |
void |
write(JmeExporter e)
Serialize this transform to the specified exporter, for example when
saving to a J3O file.
|
public static final Transform IDENTITY
public Transform(Vector3f translation, Quaternion rot)
public Transform(Vector3f translation, Quaternion rot, Vector3f scale)
public Transform(Vector3f translation)
public Transform(Quaternion rot)
public Transform()
public Transform setRotation(Quaternion rot)
rot
- The new rotation for this Transform.public Transform setTranslation(Vector3f trans)
trans
- The new translation for this Transform.public Vector3f getTranslation()
public Transform setScale(Vector3f scale)
scale
- The new scale for this Transform.public Transform setScale(float scale)
scale
- The new scale for this Transform.public Vector3f getScale()
public Vector3f getTranslation(Vector3f trans)
trans
- The store location for this transform's translation.public Quaternion getRotation(Quaternion quat)
quat
- The store location for this transform's rotation.public Quaternion getRotation()
public Vector3f getScale(Vector3f scale)
scale
- The store location for this transform's scale.public void interpolateTransforms(Transform t1, Transform t2, float delta)
t1
- The beginning transform.t2
- The ending transform.delta
- An amount between 0 and 1 representing how far to
interpolate from t1 to t2.public Transform combineWithParent(Transform parent)
parent
- The parent Transform.public Transform setTranslation(float x, float y, float z)
x
- This transform's new x translation.y
- This transform's new y translation.z
- This transform's new z translation.public Transform setScale(float x, float y, float z)
x
- This transform's new x scale.y
- This transform's new y scale.z
- This transform's new z scale.public Matrix4f toTransformMatrix()
public void fromTransformMatrix(Matrix4f mat)
public Transform invert()
public void loadIdentity()
public boolean isIdentity()
IDENTITY
, otherwise falsepublic int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object
public Transform set(Transform matrixQuat)
matrixQuat
- The Transform to be equal to.public void write(JmeExporter e) throws java.io.IOException
public void read(JmeImporter e) throws java.io.IOException
public Transform clone()
clone
in class java.lang.Object