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. | |
KZ_NO_DISCARD Vector3 | getScale () const |
Returns the scale. | |
KZ_NO_DISCARD float | getScaleX () const |
Returns the scale along the x-axis. | |
KZ_NO_DISCARD float | getScaleY () const |
Returns the scale along the y-axis. | |
KZ_NO_DISCARD float | getScaleZ () const |
Returns the scale along the z-axis. | |
KZ_NO_DISCARD Vector3 | getTranslation () const |
Returns the translation. | |
KZ_NO_DISCARD float | getTranslationX () const |
Returns the translation along the x-axis. | |
KZ_NO_DISCARD float | getTranslationY () const |
Returns the translation along the y-axis. | |
KZ_NO_DISCARD float | getTranslationZ () const |
Returns the translation along the z-axis. | |
void | rotate (Quaternion rotation) |
Applies a rotation to the current rotation. | |
KZ_NO_DISCARD SRTValue3D | rotated (Quaternion rotation) const |
Rotates the SRT object. | |
void | scale (Vector3 factor) |
Multiplies the current scale with the provided scaling factor. | |
KZ_NO_DISCARD SRTValue3D | scaled (Vector3 scale) const |
Scales the SRT object. | |
void | setRotation (Quaternion value) |
Sets the rotation. | |
void | setRotation (Vector3 eulerAnglesInRadians) |
Sets the rotation. | |
void | setScale (Vector3 value) |
Sets the scale. | |
void | setScaleX (float value) |
Sets the scale along the x-axis. | |
void | setScaleY (float value) |
Sets the scale along the y-axis. | |
void | setScaleZ (float value) |
Sets the scale along the z-axis. | |
void | setTranslation (Vector3 value) |
Sets the translation. | |
void | setTranslationX (float value) |
Sets the translation along the x-axis. | |
void | setTranslationY (float value) |
Sets the translation along the y-axis. | |
void | setTranslationZ (float value) |
Sets the translation along the z-axis. | |
SRTValue3D () | |
Default constructor. | |
SRTValue3D (Vector3 scale, Quaternion rotation, Vector3 translation) | |
Constructor with the supplied scale, rotation as a quaternion, and translation. | |
SRTValue3D (Vector3 scale, Vector3 eulerAnglesInRadians, Vector3 translation) | |
Constructor with the supplied scale, rotation angle, and translation. | |
KZ_NO_DISCARD Matrix4x4 | toMatrix () const |
Converts the SRT representation to Matrix4x4 transform. | |
void | translate (Vector3 translation) |
Adds the provided translation to the current translation. | |
KZ_NO_DISCARD SRTValue3D | translated (Vector3 translation) const |
Translates the SRT object. | |
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. | |
static KZ_NO_DISCARD SRTValue3D | createScale (Vector3 scale) |
Creates a scale SRT. | |
static KZ_NO_DISCARD SRTValue3D | createTranslation (Vector3 translation) |
Creates a translation SRT. | |
static KZ_NO_DISCARD SRTValue3D | createUniformScale (float scale) |
Creates a uniform scale SRT. | |
Friends | |
KZ_NO_DISCARD friend bool | operator!= (const SRTValue3D &left, const SRTValue3D &right) |
Inequality operator. | |
KZ_NO_DISCARD friend bool | operator== (const SRTValue3D &left, const SRTValue3D &right) |
Equality operator. | |
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 |
Returns the scale along the x-axis.
Sets the scale along the x-axis.
value | The x component of the scale. |
|
inline |
Returns the scale along the y-axis.
Sets the scale along the y-axis.
value | The y component of the scale. |
|
inline |
Returns the scale along the z-axis.
Sets the scale along the z-axis.
value | The z component of the scale. |
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. |
Sets the rotation.
eulerAnglesInRadians | Rotation angle as Euler angle in radians. |
|
inline |
Returns the translation.
Sets the translation.
value | The translation. |
Adds the provided translation to the current translation.
translation | The translation term. |
|
inline |
Returns the translation along the x-axis.
Sets the translation along the x-axis.
value | The x component of the translation. |
|
inline |
Returns the translation along the y-axis.
Sets the translation along the y-axis.
value | The y component of the translation. |
|
inline |
Returns the translation along the z-axis.
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. |