Structure describing scale, rotation and translation transformation in 3D space. More...
#include <kanzi/core/math/srt_value_3d.hpp>
Public Member Functions | |
| Quaternion | getRotation () const |
| Returns rotation as a quaternion. More... | |
| Vector3 | getScale () const |
| Returns the scale. More... | |
| float | getScaleX () const |
| Returns scale along X. More... | |
| float | getScaleY () const |
| Returns scale along Y. More... | |
| float | getScaleZ () const |
| Returns scale along Y. More... | |
| Vector3 | getTranslation () const |
| Returns translation. More... | |
| float | getTranslationX () const |
| Returns translation along X. More... | |
| float | getTranslationY () const |
| Returns translation along Y. More... | |
| float | getTranslationZ () const |
| Returns translation along Z. More... | |
| void | rotate (Quaternion rotation) |
| Applies rotation. More... | |
| void | scale (Vector3 factor) |
| Applies scale factor. More... | |
| void | setRotation (Quaternion value) |
| Sets rotation. More... | |
| void | setRotation (Vector3 eulerAnglesInRadians) |
| Sets rotation. More... | |
| void | setScale (Vector3 value) |
| Sets the scale. More... | |
| void | setScaleX (float value) |
| Sets scale along X. More... | |
| void | setScaleY (float value) |
| Sets scale along Y. More... | |
| void | setScaleZ (float value) |
| Sets scale along Z. More... | |
| void | setTranslation (Vector3 value) |
| Sets translation. More... | |
| void | setTranslationX (float value) |
| Sets translation along X. More... | |
| void | setTranslationY (float value) |
| Sets translation along Y. More... | |
| void | setTranslationZ (float value) |
| Sets translation along Z. More... | |
| SRTValue3D () | |
| Default constructor. More... | |
| SRTValue3D (Vector3 scale, Vector3 eulerAnglesInRadians, Vector3 translation) | |
| Constructor with supplied scale, rotation angle and translation. More... | |
| SRTValue3D (Vector3 scale, Quaternion rotation, Vector3 translation) | |
| Constructor with supplied scale, rotation as a quaternion and translation. More... | |
| Matrix4x4 | toMatrix () const |
| Converts the SRT representation to Matrix4x4 transform. More... | |
Static Public Member Functions | |
| static optional< SRTValue3D > | create (const Matrix4x4 &matrix) |
| Attempts to create a SRT object from a given transformation 4x4 matrix. More... | |
| static SRTValue3D | createScale (Vector3 scale) |
| Creates a scale SRT. More... | |
| static SRTValue3D | createTranslation (Vector3 translation) |
| Creates a translation SRT. More... | |
| static SRTValue3D | createUniformScale (float scale) |
| Creates a uniform scale SRT. More... | |
Friends | |
| bool | operator!= (const SRTValue3D &left, const SRTValue3D &right) |
| Operator !=. More... | |
| bool | operator== (const SRTValue3D &left, const SRTValue3D &right) |
| Operator ==. More... | |
Structure describing scale, rotation and translation transformation in 3D space.
Rotation is stored as quaternion, with the angle in radians.
|
inlineexplicit |
Default constructor.
|
inlineexplicit |
Constructor with supplied scale, rotation angle and translation.
|
inlineexplicit |
Constructor with supplied scale, rotation as a quaternion and translation.
|
inline |
Returns the scale.
|
inline |
Sets the scale.
|
inline |
Returns scale along X.
|
inline |
Sets scale along X.
|
inline |
Returns scale along Y.
|
inline |
Sets scale along Y.
|
inline |
Returns scale along Y.
|
inline |
Sets scale along Z.
|
inline |
Applies scale factor.
Multiplies current scale with provided factor.
|
inline |
Returns rotation as a quaternion.
|
inline |
Sets rotation.
| value | Rotation as a quaternion. |
|
inline |
Sets rotation.
| eulerAnglesInRadians | Rotation angle as Euler angle in radians. |
|
inline |
Returns translation.
|
inline |
Sets translation.
|
inline |
Returns translation along X.
|
inline |
Sets translation along X.
|
inline |
Returns translation along Y.
|
inline |
Sets translation along Y.
|
inline |
Returns translation along Z.
|
inline |
Sets translation along Z.
| void kanzi::SRTValue3D::rotate | ( | Quaternion | rotation | ) |
Applies rotation.
| rotation | Rotation quaternion. |
| Matrix4x4 kanzi::SRTValue3D::toMatrix | ( | ) | const |
Converts the SRT representation to Matrix4x4 transform.
|
static |
Attempts to create a SRT object from a given transformation 4x4 matrix.
Note: A matrix is decomposable into SRT if its column vectors are orthogonal to each other.
| matrix | The transformation 4x4 matrix. |
|
inlinestatic |
Creates a scale SRT.
|
inlinestatic |
Creates a uniform scale SRT.
|
inlinestatic |
Creates a translation SRT.
|
friend |
Operator ==.
|
friend |
Operator !=.