tf2  master
tf2 maintains the relationship between coordinate frames in a tree structure buffered in time, and lets the user transform points, vectors, etc between any two coordinate frames at any desired point in time.
Public Member Functions | Static Public Member Functions | List of all members
tf2::Transform Class Reference

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

 Transform ()
 No initialization constructor. More...
 
TF2SIMD_FORCE_INLINE Transform (const Quaternion &q, const Vector3 &c=Vector3(tf2Scalar(0), tf2Scalar(0), tf2Scalar(0)))
 Constructor from Quaternion (optional Vector3 ) More...
 
TF2SIMD_FORCE_INLINE Transform (const Matrix3x3 &b, const Vector3 &c=Vector3(tf2Scalar(0), tf2Scalar(0), tf2Scalar(0)))
 Constructor from Matrix3x3 (optional Vector3) More...
 
TF2SIMD_FORCE_INLINE Transform (const Transform &other)
 Copy constructor. More...
 
TF2SIMD_FORCE_INLINE Transformoperator= (const Transform &other)
 Assignment Operator. More...
 
TF2SIMD_FORCE_INLINE void mult (const Transform &t1, const Transform &t2)
 Set the current transform as the value of the product of two transforms. More...
 
TF2SIMD_FORCE_INLINE Vector3 operator() (const Vector3 &x) const
 Return the transform of the vector. More...
 
TF2SIMD_FORCE_INLINE Vector3 operator* (const Vector3 &x) const
 Return the transform of the vector. More...
 
TF2SIMD_FORCE_INLINE Quaternion operator* (const Quaternion &q) const
 Return the transform of the Quaternion. More...
 
TF2SIMD_FORCE_INLINE Matrix3x3getBasis ()
 Return the basis matrix for the rotation. More...
 
const TF2SIMD_FORCE_INLINE Matrix3x3getBasis () const
 Return the basis matrix for the rotation. More...
 
TF2SIMD_FORCE_INLINE Vector3 & getOrigin ()
 Return the origin vector translation. More...
 
const TF2SIMD_FORCE_INLINE Vector3 & getOrigin () const
 Return the origin vector translation. More...
 
Quaternion getRotation () const
 Return a quaternion representing the rotation. More...
 
void setFromOpenGLMatrix (const tf2Scalar *m)
 Set from an array. More...
 
void getOpenGLMatrix (tf2Scalar *m) const
 Fill an array representation. More...
 
TF2SIMD_FORCE_INLINE void setOrigin (const Vector3 &origin)
 Set the translational element. More...
 
TF2SIMD_FORCE_INLINE Vector3 invXform (const Vector3 &inVec) const
 
TF2SIMD_FORCE_INLINE void setBasis (const Matrix3x3 &basis)
 Set the rotational element by Matrix3x3. More...
 
TF2SIMD_FORCE_INLINE void setRotation (const Quaternion &q)
 Set the rotational element by Quaternion. More...
 
void setIdentity ()
 Set this transformation to the identity. More...
 
Transformoperator*= (const Transform &t)
 Multiply this Transform by another(this = this * another) 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...
 
Transform operator* (const Transform &t) const
 Return the product of this transform and the other. More...
 
void serialize (struct TransformData &dataOut) const
 
void serializeFloat (struct TransformFloatData &dataOut) const
 
void deSerialize (const struct TransformData &dataIn)
 
void deSerializeDouble (const struct TransformDoubleData &dataIn)
 
void deSerializeFloat (const struct TransformFloatData &dataIn)
 

Static Public Member Functions

static const TransformgetIdentity ()
 Return an identity transform. More...
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ Transform() [1/4]

tf2::Transform::Transform ( )
inline

No initialization constructor.

◆ Transform() [2/4]

TF2SIMD_FORCE_INLINE tf2::Transform::Transform ( const Quaternion q,
const Vector3 &  c = Vector3(tf2Scalar(0), tf2Scalar(0), tf2Scalar(0)) 
)
inlineexplicit

Constructor from Quaternion (optional Vector3 )

Parameters
qRotation from quaternion
cTranslation from Vector (default 0,0,0)

◆ Transform() [3/4]

TF2SIMD_FORCE_INLINE tf2::Transform::Transform ( const Matrix3x3 b,
const Vector3 &  c = Vector3(tf2Scalar(0), tf2Scalar(0), tf2Scalar(0)) 
)
inlineexplicit

Constructor from Matrix3x3 (optional Vector3)

Parameters
bRotation from Matrix
cTranslation from Vector default (0,0,0)

◆ Transform() [4/4]

TF2SIMD_FORCE_INLINE tf2::Transform::Transform ( const Transform other)
inline

Copy constructor.

Member Function Documentation

◆ operator=()

TF2SIMD_FORCE_INLINE Transform& tf2::Transform::operator= ( const Transform other)
inline

Assignment Operator.

◆ mult()

TF2SIMD_FORCE_INLINE void tf2::Transform::mult ( const Transform t1,
const Transform t2 
)
inline

Set the current transform as the value of the product of two transforms.

Parameters
t1Transform 1
t2Transform 2 This = Transform1 * Transform2

◆ operator()()

TF2SIMD_FORCE_INLINE Vector3 tf2::Transform::operator() ( const Vector3 &  x) const
inline

Return the transform of the vector.

◆ operator*() [1/3]

TF2SIMD_FORCE_INLINE Vector3 tf2::Transform::operator* ( const Vector3 &  x) const
inline

Return the transform of the vector.

◆ operator*() [2/3]

TF2SIMD_FORCE_INLINE Quaternion tf2::Transform::operator* ( const Quaternion q) const
inline

Return the transform of the Quaternion.

◆ getBasis() [1/2]

TF2SIMD_FORCE_INLINE Matrix3x3& tf2::Transform::getBasis ( )
inline

Return the basis matrix for the rotation.

◆ getBasis() [2/2]

const TF2SIMD_FORCE_INLINE Matrix3x3& tf2::Transform::getBasis ( ) const
inline

Return the basis matrix for the rotation.

◆ getOrigin() [1/2]

TF2SIMD_FORCE_INLINE Vector3& tf2::Transform::getOrigin ( )
inline

Return the origin vector translation.

◆ getOrigin() [2/2]

const TF2SIMD_FORCE_INLINE Vector3& tf2::Transform::getOrigin ( ) const
inline

Return the origin vector translation.

◆ getRotation()

Quaternion tf2::Transform::getRotation ( ) const
inline

Return a quaternion representing the rotation.

◆ setFromOpenGLMatrix()

void tf2::Transform::setFromOpenGLMatrix ( const tf2Scalar m)
inline

Set from an array.

Parameters
mA pointer to a 15 element array (12 rotation(row major padded on the right by 1), and 3 translation

◆ getOpenGLMatrix()

void tf2::Transform::getOpenGLMatrix ( tf2Scalar m) const
inline

Fill an array representation.

Parameters
mA pointer to a 15 element array (12 rotation(row major padded on the right by 1), and 3 translation

◆ setOrigin()

TF2SIMD_FORCE_INLINE void tf2::Transform::setOrigin ( const Vector3 &  origin)
inline

Set the translational element.

Parameters
originThe vector to set the translation to

◆ invXform()

TF2SIMD_FORCE_INLINE Vector3 tf2::Transform::invXform ( const Vector3 &  inVec) const

◆ setBasis()

TF2SIMD_FORCE_INLINE void tf2::Transform::setBasis ( const Matrix3x3 basis)
inline

Set the rotational element by Matrix3x3.

◆ setRotation()

TF2SIMD_FORCE_INLINE void tf2::Transform::setRotation ( const Quaternion q)
inline

Set the rotational element by Quaternion.

◆ setIdentity()

void tf2::Transform::setIdentity ( )
inline

Set this transformation to the identity.

◆ operator*=()

Transform& tf2::Transform::operator*= ( const Transform t)
inline

Multiply this Transform by another(this = this * another)

Parameters
tThe other transform

◆ inverse()

Transform tf2::Transform::inverse ( ) const
inline

Return the inverse of this transform.

◆ inverseTimes()

TF2SIMD_FORCE_INLINE Transform tf2::Transform::inverseTimes ( const Transform t) const

Return the inverse of this transform times the other transform.

Parameters
tThe other transform return this.inverse() * the other

◆ operator*() [3/3]

TF2SIMD_FORCE_INLINE Transform tf2::Transform::operator* ( const Transform t) const

Return the product of this transform and the other.

◆ getIdentity()

static const Transform& tf2::Transform::getIdentity ( )
inlinestatic

Return an identity transform.

◆ serialize()

TF2SIMD_FORCE_INLINE void tf2::Transform::serialize ( struct TransformData dataOut) const

◆ serializeFloat()

TF2SIMD_FORCE_INLINE void tf2::Transform::serializeFloat ( struct TransformFloatData dataOut) const

◆ deSerialize()

TF2SIMD_FORCE_INLINE void tf2::Transform::deSerialize ( const struct TransformData dataIn)

◆ deSerializeDouble()

TF2SIMD_FORCE_INLINE void tf2::Transform::deSerializeDouble ( const struct TransformDoubleData dataIn)

◆ deSerializeFloat()

TF2SIMD_FORCE_INLINE void tf2::Transform::deSerializeFloat ( const struct TransformFloatData dataIn)

The documentation for this class was generated from the following file: