Kanzi  3.9.9
Kanzi Engine C++ API
kanzi::SRTValue3D Class Reference

A structure that describes the scale, rotation and translation transformation in 3D space. More...

#include <kanzi/core/math/srt_value_3d.hpp>

Inheritance diagram for kanzi::SRTValue3D:
[legend]

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< SRTValue3Dcreate (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...
 

Detailed Description

A structure that describes the scale, rotation and translation transformation in 3D space.

Rotation is stored as quaternion, with the angle in radians.

Constructor & Destructor Documentation

kanzi::SRTValue3D::SRTValue3D ( )
inlineexplicit

Default constructor.

kanzi::SRTValue3D::SRTValue3D ( Vector3  scale,
Vector3  eulerAnglesInRadians,
Vector3  translation 
)
inlineexplicit

Constructor with the supplied scale, rotation angle, and translation.

Parameters
scaleThe scale.
eulerAnglesInRadiansThe rotation in Euler angles (radians).
translationThe translation.
kanzi::SRTValue3D::SRTValue3D ( Vector3  scale,
Quaternion  rotation,
Vector3  translation 
)
inlineexplicit

Constructor with the supplied scale, rotation as a quaternion, and translation.

Parameters
scaleThe scale.
rotationThe rotation.
translationThe translation.

Member Function Documentation

KZ_NO_DISCARD Vector3 kanzi::SRTValue3D::getScale ( ) const
inline

Returns the scale.

Returns
The scale.
void kanzi::SRTValue3D::setScale ( Vector3  value)
inline

Sets the scale.

Parameters
valueThe scale.
KZ_NO_DISCARD float kanzi::SRTValue3D::getScaleX ( ) const
inline

Returns the scale along the x-axis.

Returns
The x component of the scale.
void kanzi::SRTValue3D::setScaleX ( float  value)
inline

Sets the scale along the x-axis.

Parameters
valueThe x component of the scale.
KZ_NO_DISCARD float kanzi::SRTValue3D::getScaleY ( ) const
inline

Returns the scale along the y-axis.

Returns
The y component of the scale.
void kanzi::SRTValue3D::setScaleY ( float  value)
inline

Sets the scale along the y-axis.

Parameters
valueThe y component of the scale.
KZ_NO_DISCARD float kanzi::SRTValue3D::getScaleZ ( ) const
inline

Returns the scale along the z-axis.

Returns
The z component of the scale.
void kanzi::SRTValue3D::setScaleZ ( float  value)
inline

Sets the scale along the z-axis.

Parameters
valueThe z component of the scale.
void kanzi::SRTValue3D::scale ( Vector3  factor)
inline

Multiplies the current scale with the provided scaling factor.

Parameters
factorThe scaling factor.
KZ_NO_DISCARD Quaternion kanzi::SRTValue3D::getRotation ( ) const
inline

Returns the rotation as a quaternion.

Returns
The rotation.
void kanzi::SRTValue3D::setRotation ( Quaternion  value)
inline

Sets the rotation.

Parameters
valueRotation as a quaternion.
void kanzi::SRTValue3D::setRotation ( Vector3  eulerAnglesInRadians)
inline

Sets the rotation.

Parameters
eulerAnglesInRadiansRotation angle as Euler angle in radians.
KZ_NO_DISCARD Vector3 kanzi::SRTValue3D::getTranslation ( ) const
inline

Returns the translation.

Returns
The translation.
void kanzi::SRTValue3D::setTranslation ( Vector3  value)
inline

Sets the translation.

Parameters
valueThe translation.
void kanzi::SRTValue3D::translate ( Vector3  translation)
inline

Adds the provided translation to the current translation.

Parameters
translationThe translation term.
KZ_NO_DISCARD float kanzi::SRTValue3D::getTranslationX ( ) const
inline

Returns the translation along the x-axis.

Returns
The x component of the translation.
void kanzi::SRTValue3D::setTranslationX ( float  value)
inline

Sets the translation along the x-axis.

Parameters
valueThe x component of the translation.
KZ_NO_DISCARD float kanzi::SRTValue3D::getTranslationY ( ) const
inline

Returns the translation along the y-axis.

Returns
The y component of the translation.
void kanzi::SRTValue3D::setTranslationY ( float  value)
inline

Sets the translation along the y-axis.

Parameters
valueThe y component of the translation.
KZ_NO_DISCARD float kanzi::SRTValue3D::getTranslationZ ( ) const
inline

Returns the translation along the z-axis.

Returns
The z component of the translation.
void kanzi::SRTValue3D::setTranslationZ ( float  value)
inline

Sets the translation along the z-axis.

Parameters
valueThe z component of the translation.
void kanzi::SRTValue3D::rotate ( Quaternion  rotation)

Applies a rotation to the current rotation.

Parameters
rotationRotation quaternion.
KZ_NO_DISCARD Matrix4x4 kanzi::SRTValue3D::toMatrix ( ) const

Converts the SRT representation to Matrix4x4 transform.

Returns
A matrix representation of the SRT object.
static KZ_NO_DISCARD optional<SRTValue3D> kanzi::SRTValue3D::create ( const Matrix4x4 matrix)
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.

Parameters
matrixThe transformation 4x4 matrix.
Returns
If the matrix is decomposable, returns an SRTValue3D object, otherwise nullopt.
static KZ_NO_DISCARD SRTValue3D kanzi::SRTValue3D::createScale ( Vector3  scale)
inlinestatic

Creates a scale SRT.

Parameters
scaleThe scale.
Returns
An SRT object with scale.
static KZ_NO_DISCARD SRTValue3D kanzi::SRTValue3D::createUniformScale ( float  scale)
inlinestatic

Creates a uniform scale SRT.

Parameters
scaleThe scale.
Returns
An SRT object with scale.
static KZ_NO_DISCARD SRTValue3D kanzi::SRTValue3D::createTranslation ( Vector3  translation)
inlinestatic

Creates a translation SRT.

Parameters
translationThe translation.
Returns
An SRT object with translation.
KZ_NO_DISCARD SRTValue3D kanzi::SRTValue3D::translated ( Vector3  translation) const
inline

Translates the SRT object.

Parameters
translationThe translation term.
Returns
A new SRT object with the translation applied.
KZ_NO_DISCARD SRTValue3D kanzi::SRTValue3D::scaled ( Vector3  scale) const
inline

Scales the SRT object.

Parameters
scaleThe scaling factor.
Returns
A new SRT object with the scale applied.
KZ_NO_DISCARD SRTValue3D kanzi::SRTValue3D::rotated ( Quaternion  rotation) const
inline

Rotates the SRT object.

Parameters
rotationThe rotation.
Returns
A new SRT object with the rotation applied.

Friends And Related Function Documentation

KZ_NO_DISCARD friend bool operator== ( const SRTValue3D left,
const SRTValue3D right 
)
friend

Equality operator.

Parameters
leftThe left operand.
rightThe right operand.
Returns
If the left and right operand are equal, true, otherwise false.
KZ_NO_DISCARD friend bool operator!= ( const SRTValue3D left,
const SRTValue3D right 
)
friend

Inequality operator.

Parameters
leftThe left operand.
rightThe right operand.
Returns
If the left and right operand are not equal, true, otherwise false.

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