|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectcom.jme.math.TransformMatrix
TransformMatrix holds a rotation (Matrix3f) and translation (Vector3f) for point manipulation
| Constructor Summary | |
TransformMatrix()
Constructor instantiates a new TransformMatrix that is set to the
identity matrix by default. |
|
TransformMatrix(Quaternion myRot,
Vector3f myPos)
Constructor instantiates a new TransformMatrix that has rotation
and translation defined by its parameters |
|
TransformMatrix(TransformMatrix mat)
Constructor instantiates a new TransformMatrix that is set to the
provided matrix. |
|
| Method Summary | |
void |
applyToSpatial(Spatial spatial)
Applies this TransformMatrix to the given spatial, by updating the spatial's local translation, rotation, scale. |
TransformMatrix |
combineWithParent(TransformMatrix parent)
Combines this TransformMatrix with a parent TransformMatrix. |
Matrix3f |
getRotation(Matrix3f rotStore)
Stores the rotational part of this matrix into the passed matrix. |
Quaternion |
getRotation(Quaternion rotStore)
Stores the rotational part of this matrix into the passed Quaternion. |
Vector3f |
getScale(Vector3f storeS)
Returns this TransformMatrix's scale factor |
Vector3f |
getTranslation(Vector3f tranStore)
Stores the translational part of this matrix into the passed matrix. |
void |
interpolateTransforms(TransformMatrix start,
TransformMatrix end,
float delta)
Sets this transform to an interpolation between the start and end transforms. |
void |
interpolateTransforms(TransformMatrix start,
TransformMatrix end,
float delta,
Quaternion q1,
Quaternion q2)
Sets this transform to an interpolation between the start and end transforms. |
void |
inverse()
inverse turns this matrix into it's own inverse |
void |
loadIdentity()
loadIdentity sets this matrix to the identity matrix,
namely all zeros with ones along the diagonal. |
void |
mult(float scalar)
Multiplies every value in the matrix by a scalar |
TransformMatrix |
multLocal(TransformMatrix child,
Vector3f tempStore)
multLocal multiplies this matrix with another matrix and stores
the result back in this, returning this. |
Vector3f |
multNormal(Vector3f vec)
mult multiplies a normal about a transform matrix and
stores the result back in vec. |
Vector3f |
multPoint(Vector3f vec)
mult multiplies a vector about a transform matrix. |
void |
set(Quaternion quaternion)
set defines the values of the matrix based on a supplied
Quaternion. |
void |
set(Quaternion rotation,
Vector3f translation)
set changes this matrix's rotational and translational components
to that represented by the given parameters |
void |
set(TransformMatrix matrix)
set transfers the contents of a given matrix to this
matrix. |
void |
setEulerRot(float x,
float y,
float z)
Sets the rotational component of this transform to the matrix represented by an Euler rotation about x, y, then z. |
void |
setEulerRot(Vector3f eulerVec)
setEulerRot is equivalent to
setEulerRot(eulerVec.x,eulverVec.y,eulverVec.z){ |
void |
setRotation(Matrix3f rot)
Sets the rotation matrix to the given rotation matrix via a copy. |
void |
setRotationQuaternion(Quaternion quat)
setRotationQuaternion builds a rotation from a
Quaternion. |
void |
setScale(float x,
float y,
float z)
Sets this TransformMatrix's scale to the given x,y,z |
void |
setScale(Vector3f scale)
Sets this TransformMatrix's scale to the given scale (x,y,z) |
void |
setTranslation(float[] transArray)
setTranslation will set the matrix's translation values. |
void |
setTranslation(float x,
float y,
float z)
Sets the Transform's Translational component |
void |
setTranslation(Vector3f trans)
setTranslation will copy the given Vector3f's values
into this Matrix's translational component |
java.lang.String |
toString()
toString returns the string representation of this object. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
public TransformMatrix()
TransformMatrix that is set to the
identity matrix by default.
public TransformMatrix(TransformMatrix mat)
TransformMatrix that is set to the
provided matrix. This constructor copies a given matrix. If the
provided matrix is null, the constructor sets the matrix to the
identity.
mat - the matrix to copy.
public TransformMatrix(Quaternion myRot,
Vector3f myPos)
TransformMatrix that has rotation
and translation defined by its parameters
myRot - The given rotation, as a QuaternionmyPos - The given translation, as a Vector3f| Method Detail |
public void set(TransformMatrix matrix)
set transfers the contents of a given matrix to this
matrix. If a null matrix is supplied, this matrix is set to the
identity matrix.
matrix - the matrix to copy.public void set(Quaternion quaternion)
set defines the values of the matrix based on a supplied
Quaternion. It should be noted that all previous values
will be overridden.
quaternion - the quaternion to create a rotational matrix from.public void loadIdentity()
loadIdentity sets this matrix to the identity matrix,
namely all zeros with ones along the diagonal.
public void mult(float scalar)
scalar -
public TransformMatrix multLocal(TransformMatrix child,
Vector3f tempStore)
multLocal multiplies this matrix with another matrix and stores
the result back in this, returning this. if null is passed, nothing happens
This function changes this matrix to what the child would look like if this were applied as it's parent
child - The matrix to multiply bytempStore - A temporary Vector3f object for this TransformMatrix to use during the calculation.
public void interpolateTransforms(TransformMatrix start,
TransformMatrix end,
float delta)
start - Begining transform (delta=0)end - Ending transform (delta=1)delta - Value between 0.0 and 1.0 to show which side the transform leans towards
public void interpolateTransforms(TransformMatrix start,
TransformMatrix end,
float delta,
Quaternion q1,
Quaternion q2)
start - Begining transform (delta=0)end - Ending transform (delta=1)delta - Value between 0.0 and 1.0 to show which side the transform leans towardsq1 - A temporary Quaternionq2 - Another temporary Quaternionpublic Vector3f multNormal(Vector3f vec)
mult multiplies a normal about a transform matrix and
stores the result back in vec. The resulting vector is returned
with translational ignored.
vec - the rotation normal.
public Vector3f multPoint(Vector3f vec)
mult multiplies a vector about a transform matrix. The
resulting vector is saved in vec and returned.
vec - The point to rotate.
public void setRotation(Matrix3f rot)
rot - The new rotationpublic void setTranslation(float[] transArray)
setTranslation will set the matrix's translation values.
transArray - the new values for the translation.
JmeException - if translation is null or not size 3.public void setTranslation(Vector3f trans)
setTranslation will copy the given Vector3f's values
into this Matrix's translational component
trans -
public void setTranslation(float x,
float y,
float z)
x - New X translationy - New Y translationz - New Z translation
public void setEulerRot(float x,
float y,
float z)
x - The X rotation, in radiansy - The Y rotation, in radiansz - The Z rotation, in radianspublic void setRotationQuaternion(Quaternion quat)
setRotationQuaternion builds a rotation from a
Quaternion.
quat - The quaternion to build the rotation from.
JmeException - if quat is null.public Matrix3f getRotation(Matrix3f rotStore)
rotStore - The matrix to store rotation values
public Vector3f getTranslation(Vector3f tranStore)
tranStore - The vector to store translation values
public Quaternion getRotation(Quaternion rotStore)
rotStore - The Quat to store translation values
public java.lang.String toString()
toString returns the string representation of this object.
It is simply a toString() call of the rotational matrix and the translational vector
public void inverse()
inverse turns this matrix into it's own inverse
public void setEulerRot(Vector3f eulerVec)
setEulerRot is equivalent to
setEulerRot(eulerVec.x,eulverVec.y,eulverVec.z){
eulerVec - A Vector3f representing the new rotation in Euler angles
public void set(Quaternion rotation,
Vector3f translation)
set changes this matrix's rotational and translational components
to that represented by the given parameters
rotation - The new rotaitontranslation - The new translationpublic void setScale(Vector3f scale)
scale - The new scale
public void setScale(float x,
float y,
float z)
x - The x scaley - The y scalez - The z scalepublic Vector3f getScale(Vector3f storeS)
storeS - The place to store the current scale factor
public void applyToSpatial(Spatial spatial)
spatial - The spatial to updatepublic TransformMatrix combineWithParent(TransformMatrix parent)
parent - The parent matrix.
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||