A structure that describes the scale, rotation and translation transformation in 3D space. More...
#include <kanzi/core/math/srt_value_3d.hpp>
Public Member Functions | |
KZ_NO_DISCARD Quaternion | getRotation () const |
Returns the rotation as a quaternion. More... | |
KZ_NO_DISCARD Vector3 | getScale () const |
Returns the scale. More... | |
KZ_NO_DISCARD float | getScaleX () const |
Returns the scale along the x-axis. More... | |
KZ_NO_DISCARD float | getScaleY () const |
Returns the scale along the y-axis. More... | |
KZ_NO_DISCARD float | getScaleZ () const |
Returns the scale along the z-axis. More... | |
KZ_NO_DISCARD Vector3 | getTranslation () const |
Returns the translation. More... | |
KZ_NO_DISCARD float | getTranslationX () const |
Returns the translation along the x-axis. More... | |
KZ_NO_DISCARD float | getTranslationY () const |
Returns the translation along the y-axis. More... | |
KZ_NO_DISCARD float | getTranslationZ () const |
Returns the translation along the z-axis. More... | |
void | rotate (Quaternion rotation) |
Applies a rotation to the current rotation. More... | |
KZ_NO_DISCARD SRTValue3D | rotated (Quaternion rotation) const |
Rotates the SRT object. More... | |
void | scale (Vector3 factor) |
Multiplies the current scale with the provided scaling factor. More... | |
KZ_NO_DISCARD SRTValue3D | scaled (Vector3 scale) const |
Scales the SRT object. More... | |
void | setRotation (Quaternion value) |
Sets the rotation. More... | |
void | setRotation (Vector3 eulerAnglesInRadians) |
Sets the rotation. More... | |
void | setScale (Vector3 value) |
Sets the scale. More... | |
void | setScaleX (float value) |
Sets the scale along the x-axis. More... | |
void | setScaleY (float value) |
Sets the scale along the y-axis. More... | |
void | setScaleZ (float value) |
Sets the scale along the z-axis. More... | |
void | setTranslation (Vector3 value) |
Sets the translation. More... | |
void | setTranslationX (float value) |
Sets the translation along the x-axis. More... | |
void | setTranslationY (float value) |
Sets the translation along the y-axis. More... | |
void | setTranslationZ (float value) |
Sets the translation along the z-axis. More... | |
SRTValue3D () | |
Default constructor. More... | |
SRTValue3D (Vector3 scale, Vector3 eulerAnglesInRadians, Vector3 translation) | |
Constructor with the supplied scale, rotation angle, and translation. More... | |
SRTValue3D (Vector3 scale, Quaternion rotation, Vector3 translation) | |
Constructor with the supplied scale, rotation as a quaternion, and translation. More... | |
KZ_NO_DISCARD Matrix4x4 | toMatrix () const |
Converts the SRT representation to Matrix4x4 transform. More... | |
void | translate (Vector3 translation) |
Adds the provided translation to the current translation. More... | |
KZ_NO_DISCARD SRTValue3D | translated (Vector3 translation) const |
Translates the SRT object. More... | |
Static Public Member Functions | |
static KZ_NO_DISCARD optional< SRTValue3D > | create (const Matrix4x4 &matrix) |
Attempts to create an SRT object from a given transformation 4x4 matrix. More... | |
static KZ_NO_DISCARD SRTValue3D | createScale (Vector3 scale) |
Creates a scale SRT. More... | |
static KZ_NO_DISCARD SRTValue3D | createTranslation (Vector3 translation) |
Creates a translation SRT. More... | |
static KZ_NO_DISCARD SRTValue3D | createUniformScale (float scale) |
Creates a uniform scale SRT. More... | |
Friends | |
KZ_NO_DISCARD friend bool | operator!= (const SRTValue3D &left, const SRTValue3D &right) |
Inequality operator. More... | |
KZ_NO_DISCARD friend bool | operator== (const SRTValue3D &left, const SRTValue3D &right) |
Equality operator. More... | |
A structure that describes the scale, rotation and translation transformation in 3D space.
Rotation is stored as quaternion, with the angle in radians.
|
inlineexplicit |
Default constructor.
|
inlineexplicit |
Constructor with the supplied scale, rotation angle, and translation.
scale | The scale. |
eulerAnglesInRadians | The rotation in Euler angles (radians). |
translation | The translation. |
|
inlineexplicit |
Constructor with the supplied scale, rotation as a quaternion, and translation.
scale | The scale. |
rotation | The rotation. |
translation | The translation. |
|
inline |
Returns the scale.
|
inline |
Sets the scale.
value | The scale. |
|
inline |
Returns the scale along the x-axis.
|
inline |
Sets the scale along the x-axis.
value | The x component of the scale. |
|
inline |
Returns the scale along the y-axis.
|
inline |
Sets the scale along the y-axis.
value | The y component of the scale. |
|
inline |
Returns the scale along the z-axis.
|
inline |
Sets the scale along the z-axis.
value | The z component of the scale. |
|
inline |
Multiplies the current scale with the provided scaling factor.
factor | The scaling factor. |
|
inline |
Returns the rotation as a quaternion.
|
inline |
Sets the rotation.
value | Rotation as a quaternion. |
|
inline |
Sets the rotation.
eulerAnglesInRadians | Rotation angle as Euler angle in radians. |
|
inline |
Returns the translation.
|
inline |
Sets the translation.
value | The translation. |
|
inline |
Adds the provided translation to the current translation.
translation | The translation term. |
|
inline |
Returns the translation along the x-axis.
|
inline |
Sets the translation along the x-axis.
value | The x component of the translation. |
|
inline |
Returns the translation along the y-axis.
|
inline |
Sets the translation along the y-axis.
value | The y component of the translation. |
|
inline |
Returns the translation along the z-axis.
|
inline |
Sets the translation along the z-axis.
value | The z component of the translation. |
void kanzi::SRTValue3D::rotate | ( | Quaternion | rotation | ) |
Applies a rotation to the current rotation.
rotation | Rotation quaternion. |
KZ_NO_DISCARD Matrix4x4 kanzi::SRTValue3D::toMatrix | ( | ) | const |
Converts the SRT representation to Matrix4x4 transform.
|
static |
Attempts to create an SRT object from a given transformation 4x4 matrix.
Note that you can decompose a matrix into SRT only if its column vectors are orthogonal to each other.
matrix | The transformation 4x4 matrix. |
|
inlinestatic |
Creates a scale SRT.
scale | The scale. |
|
inlinestatic |
Creates a uniform scale SRT.
scale | The scale. |
|
inlinestatic |
Creates a translation SRT.
translation | The translation. |
|
inline |
Translates the SRT object.
translation | The translation term. |
|
inline |
Scales the SRT object.
scale | The scaling factor. |
|
inline |
Rotates the SRT object.
rotation | The rotation. |
|
friend |
Equality operator.
left | The left operand. |
right | The right operand. |
|
friend |
Inequality operator.
left | The left operand. |
right | The right operand. |