Class Transform
Defined in File Transform.h
Class Documentation
-
class Transform
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.
Public Functions
-
inline Transform()
No initialization constructor.
-
inline explicit Transform(const Quaternion &q, const Vector3 &c = Vector3(tf2Scalar(0), tf2Scalar(0), tf2Scalar(0)))
Constructor from Quaternion (optional Vector3 )
- Parameters:
q – Rotation from quaternion
c – Translation from Vector (default 0,0,0)
-
inline explicit Transform(const Matrix3x3 &b, const Vector3 &c = Vector3(tf2Scalar(0), tf2Scalar(0), tf2Scalar(0)))
Constructor from Matrix3x3 (optional Vector3)
- Parameters:
b – Rotation from Matrix
c – Translation from Vector default (0,0,0)
-
inline void mult(const Transform &t1, const Transform &t2)
Set the current transform as the value of the product of two transforms.
-
inline Quaternion operator*(const Quaternion &q) const
Return the transform of the Quaternion.
-
inline Quaternion getRotation() const
Return a quaternion representing the rotation.
-
inline void setFromOpenGLMatrix(const tf2Scalar *m)
Set from an array.
- Parameters:
m – A pointer to a 15 element array (12 rotation(row major padded on the right by 1), and 3 translation
-
inline void getOpenGLMatrix(tf2Scalar *m) const
Fill an array representation.
- Parameters:
m – A pointer to a 15 element array (12 rotation(row major padded on the right by 1), and 3 translation
-
inline void setOrigin(const Vector3 &origin)
Set the translational element.
- Parameters:
origin – The vector to set the translation to
-
inline void setRotation(const Quaternion &q)
Set the rotational element by Quaternion.
-
inline void setIdentity()
Set this transformation to the identity.
-
inline Transform &operator*=(const Transform &t)
Multiply this Transform by another(this = this * another)
- Parameters:
t – The other transform
-
Transform inverseTimes(const Transform &t) const
Return the inverse of this transform times the other transform.
- Parameters:
t – The other transform return this.inverse() * the other
-
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)
-
inline Transform()