The Transform class supports rigid transforms with only translation and rotation and no scaling/shear. It can be used in combination with Vector3, Quaternion and Matrix3x3 linear algebra classes. More...
#include <Transform.h>
Public Member Functions | |
void | deSerialize (const struct TransformData &dataIn) |
void | deSerializeDouble (const struct TransformDoubleData &dataIn) |
void | deSerializeFloat (const struct TransformFloatData &dataIn) |
TFSIMD_FORCE_INLINE Matrix3x3 & | getBasis () |
Return the basis matrix for the rotation. More... | |
const TFSIMD_FORCE_INLINE Matrix3x3 & | getBasis () const |
Return the basis matrix for the rotation. More... | |
void | getOpenGLMatrix (tfScalar *m) const |
Fill an array representation. More... | |
TFSIMD_FORCE_INLINE Vector3 & | getOrigin () |
Return the origin vector translation. More... | |
const TFSIMD_FORCE_INLINE Vector3 & | getOrigin () const |
Return the origin vector translation. More... | |
Quaternion | getRotation () const |
Return a quaternion representing the rotation. More... | |
Transform | inverse () const |
Return the inverse of this transform. More... | |
Transform | inverseTimes (const Transform &t) const |
Return the inverse of this transform times the other transform. More... | |
TFSIMD_FORCE_INLINE Vector3 | invXform (const Vector3 &inVec) const |
TFSIMD_FORCE_INLINE void | mult (const Transform &t1, const Transform &t2) |
Set the current transform as the value of the product of two transforms. More... | |
TFSIMD_FORCE_INLINE Vector3 | operator() (const Vector3 &x) const |
Return the transform of the vector. More... | |
TFSIMD_FORCE_INLINE Quaternion | operator* (const Quaternion &q) const |
Return the transform of the Quaternion. More... | |
Transform | operator* (const Transform &t) const |
Return the product of this transform and the other. More... | |
TFSIMD_FORCE_INLINE Vector3 | operator* (const Vector3 &x) const |
Return the transform of the vector. More... | |
Transform & | operator*= (const Transform &t) |
Multiply this Transform by another(this = this * another) More... | |
TFSIMD_FORCE_INLINE Transform & | operator= (const Transform &other) |
Assignment Operator. More... | |
void | serialize (struct TransformData &dataOut) const |
void | serializeFloat (struct TransformFloatData &dataOut) const |
TFSIMD_FORCE_INLINE void | setBasis (const Matrix3x3 &basis) |
Set the rotational element by Matrix3x3. More... | |
void | setFromOpenGLMatrix (const tfScalar *m) |
Set from an array. More... | |
void | setIdentity () |
Set this transformation to the identity. More... | |
TFSIMD_FORCE_INLINE void | setOrigin (const Vector3 &origin) |
Set the translational element. More... | |
TFSIMD_FORCE_INLINE void | setRotation (const Quaternion &q) |
Set the rotational element by Quaternion. More... | |
Transform () | |
No initialization constructor. More... | |
TFSIMD_FORCE_INLINE | Transform (const Matrix3x3 &b, const Vector3 &c=Vector3(tfScalar(0), tfScalar(0), tfScalar(0))) |
Constructor from Matrix3x3 (optional Vector3) More... | |
TFSIMD_FORCE_INLINE | Transform (const Quaternion &q, const Vector3 &c=Vector3(tfScalar(0), tfScalar(0), tfScalar(0))) |
Constructor from Quaternion (optional Vector3 ) More... | |
TFSIMD_FORCE_INLINE | Transform (const Transform &other) |
Copy constructor. More... | |
Static Public Member Functions | |
static const Transform & | getIdentity () |
Return an identity transform. More... | |
Private Attributes | |
Matrix3x3 | m_basis |
Storage for the rotation. More... | |
Vector3 | m_origin |
Storage for the translation. More... | |
The Transform class supports rigid transforms with only translation and rotation and no scaling/shear. It can be used in combination with Vector3, Quaternion and Matrix3x3 linear algebra classes.
Definition at line 31 of file Transform.h.
|
inline |
No initialization constructor.
Definition at line 41 of file Transform.h.
|
inlineexplicit |
Constructor from Quaternion (optional Vector3 )
q | Rotation from quaternion |
c | Translation from Vector (default 0,0,0) |
Definition at line 45 of file Transform.h.
|
inlineexplicit |
Constructor from Matrix3x3 (optional Vector3)
b | Rotation from Matrix |
c | Translation from Vector default (0,0,0) |
Definition at line 54 of file Transform.h.
|
inline |
Copy constructor.
Definition at line 60 of file Transform.h.
void tf::Transform::deSerialize | ( | const struct TransformData & | dataIn | ) |
void tf::Transform::deSerializeDouble | ( | const struct TransformDoubleData & | dataIn | ) |
void tf::Transform::deSerializeFloat | ( | const struct TransformFloatData & | dataIn | ) |
|
inline |
Return the basis matrix for the rotation.
Definition at line 110 of file Transform.h.
|
inline |
Return the basis matrix for the rotation.
Definition at line 112 of file Transform.h.
|
inlinestatic |
Return an identity transform.
Definition at line 201 of file Transform.h.
|
inline |
Fill an array representation.
m | A pointer to a 15 element array (12 rotation(row major padded on the right by 1), and 3 translation |
Definition at line 137 of file Transform.h.
|
inline |
Return the origin vector translation.
Definition at line 115 of file Transform.h.
|
inline |
Return the origin vector translation.
Definition at line 117 of file Transform.h.
|
inline |
Return a quaternion representing the rotation.
Definition at line 120 of file Transform.h.
|
inline |
Return the inverse of this transform.
Definition at line 186 of file Transform.h.
TFSIMD_FORCE_INLINE Transform tf::Transform::inverseTimes | ( | const Transform & | t | ) | const |
Return the inverse of this transform times the other transform.
t | The other transform return this.inverse() * the other |
Definition at line 228 of file Transform.h.
TFSIMD_FORCE_INLINE Vector3 tf::Transform::invXform | ( | const Vector3 & | inVec | ) | const |
Definition at line 221 of file Transform.h.
|
inline |
Set the current transform as the value of the product of two transforms.
Definition at line 77 of file Transform.h.
|
inline |
Return the transform of the vector.
Definition at line 90 of file Transform.h.
|
inline |
Return the transform of the Quaternion.
Definition at line 104 of file Transform.h.
TFSIMD_FORCE_INLINE Transform tf::Transform::operator* | ( | const Transform & | t | ) | const |
Return the product of this transform and the other.
Definition at line 236 of file Transform.h.
|
inline |
Return the transform of the vector.
Definition at line 98 of file Transform.h.
Multiply this Transform by another(this = this * another)
t | The other transform |
Definition at line 178 of file Transform.h.
|
inline |
Assignment Operator.
Definition at line 66 of file Transform.h.
TFSIMD_FORCE_INLINE void tf::Transform::serialize | ( | struct TransformData & | dataOut | ) | const |
Definition at line 265 of file Transform.h.
TFSIMD_FORCE_INLINE void tf::Transform::serializeFloat | ( | struct TransformFloatData & | dataOut | ) | const |
Definition at line 271 of file Transform.h.
|
inline |
Set the rotational element by Matrix3x3.
Definition at line 157 of file Transform.h.
|
inline |
Set from an array.
m | A pointer to a 15 element array (12 rotation(row major padded on the right by 1), and 3 translation |
Definition at line 129 of file Transform.h.
|
inline |
Set this transformation to the identity.
Definition at line 170 of file Transform.h.
|
inline |
Set the translational element.
origin | The vector to set the translation to |
Definition at line 148 of file Transform.h.
|
inline |
Set the rotational element by Quaternion.
Definition at line 163 of file Transform.h.
|
private |
Storage for the rotation.
Definition at line 34 of file Transform.h.
|
private |
Storage for the translation.
Definition at line 36 of file Transform.h.