|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjautil.geometry.TRTransform
public class TRTransform
An TRTransform represents a homogeneous 3D transform which is composed of translations and rotations only.
This is a reworking of class SGMatrix with restrictions: we allow tranforms composed from translations and rotations (only) -- that is, with no scaling.
Hence each homogeneous tranfsorm is represented by a matrix with
the following features:
- The bottom row is [0 0 0 1].
- Its determinant is 1.
- The upper-left 3 x 3 submatrix represents a rotation
(whose determinant is also 1).
- The upper-right 3 x 1 column vector represents a translation.
We represent the transform by a 3 x 4 matrix (that is, the values in the 4th row are left implicit). In addition we allow a quaternion to be associated with the transform, corresponding to its rotation component. The presence of this quaternion allows products to be computed more efficiently.
Constructor Summary | |
---|---|
TRTransform()
Default constructor, giving the identity transform. |
|
TRTransform(float[] marray)
Constructs this transform using the given tranformation array (that is, using the array itself, not a copy); in this case there is NO associated rotation quaternion. |
|
TRTransform(Quaternion qrot)
Constructs a transformation from the given rotation quaternion qrot (which is copied) and a zero translation. |
Method Summary | |
---|---|
TRTransform |
getInverse()
Returns a new transformation representing the inverse of this one; note that the new transform does NOT have a rotation quaternion. |
float[] |
mat()
Returns the RT array for this transform. |
Quaternion |
quat()
Returns the rotation quaternion for this transform. |
void |
rotateVector(Vector3f vec,
float[] vecout)
Applies the rotation part of this transform to the given vector vec, giving the result in vecout. |
void |
set(float[] rot,
float[] trans)
Resets this transformation from the given rotation and translation arrays (rot and trans). |
void |
set(float X,
float Y,
float Z,
float angledeg)
Sets this transform to represent a rotation of angledeg degrees around the axis vector (X,Y,Z), which MUST have unit length, with a zero translation. |
void |
set(Quaternion qrot)
Resets this transformation from the given rotation qrot and a zero tranformation. |
void |
setComposition(TRTransform xpre,
float[] rot,
float[] trans)
Resets this transformation as the composition of the given transform with that represented by the given rotation and translation arrays. |
void |
setComposition(TRTransform xpre,
Quaternion qrot)
Resets this transformation as the composition of the given transform with the given rotation (and a zero translation). |
java.lang.String |
toString()
|
void |
transformPoint(Vector3f pt)
Applies this transform to the given point, pt. |
void |
transformPoint(Vector3f pt,
float[] ptout)
Applies this transform to the given point pt, giving the result in ptout. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public TRTransform()
public TRTransform(float[] marray)
public TRTransform(Quaternion qrot)
Method Detail |
---|
public float[] mat()
public Quaternion quat()
public void set(Quaternion qrot)
public void set(float[] rot, float[] trans)
public void setComposition(TRTransform xpre, float[] rot, float[] trans)
public void setComposition(TRTransform xpre, Quaternion qrot)
public void transformPoint(Vector3f pt)
public void transformPoint(Vector3f pt, float[] ptout)
public void rotateVector(Vector3f vec, float[] vecout)
public TRTransform getInverse()
public void set(float X, float Y, float Z, float angledeg)
public java.lang.String toString()
toString
in class java.lang.Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |