Kanzi Engine API
kanzi::SRTValue3D Class Reference

Structure describing 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

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

Detailed Description

Structure describing 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 supplied scale, rotation angle and translation.

kanzi::SRTValue3D::SRTValue3D ( Vector3  scale,
Quaternion  rotation,
Vector3  translation 
)
inlineexplicit

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

Member Function Documentation

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

Returns the scale.

void kanzi::SRTValue3D::setScale ( Vector3  value)
inline

Sets the scale.

float kanzi::SRTValue3D::getScaleX ( ) const
inline

Returns scale along X.

void kanzi::SRTValue3D::setScaleX ( float  value)
inline

Sets scale along X.

float kanzi::SRTValue3D::getScaleY ( ) const
inline

Returns scale along Y.

void kanzi::SRTValue3D::setScaleY ( float  value)
inline

Sets scale along Y.

float kanzi::SRTValue3D::getScaleZ ( ) const
inline

Returns scale along Y.

void kanzi::SRTValue3D::setScaleZ ( float  value)
inline

Sets scale along Z.

void kanzi::SRTValue3D::scale ( Vector3  factor)
inline

Applies scale factor.

Multiplies current scale with provided factor.

Quaternion kanzi::SRTValue3D::getRotation ( ) const
inline

Returns rotation as a quaternion.

void kanzi::SRTValue3D::setRotation ( Quaternion  value)
inline

Sets rotation.

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

Sets rotation.

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

Returns translation.

void kanzi::SRTValue3D::setTranslation ( Vector3  value)
inline

Sets translation.

float kanzi::SRTValue3D::getTranslationX ( ) const
inline

Returns translation along X.

void kanzi::SRTValue3D::setTranslationX ( float  value)
inline

Sets translation along X.

float kanzi::SRTValue3D::getTranslationY ( ) const
inline

Returns translation along Y.

void kanzi::SRTValue3D::setTranslationY ( float  value)
inline

Sets translation along Y.

float kanzi::SRTValue3D::getTranslationZ ( ) const
inline

Returns translation along Z.

void kanzi::SRTValue3D::setTranslationZ ( float  value)
inline

Sets translation along Z.

void kanzi::SRTValue3D::rotate ( Quaternion  rotation)

Applies rotation.

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

Converts the SRT representation to Matrix4x4 transform.

static optional<SRTValue3D> kanzi::SRTValue3D::create ( const Matrix4x4 matrix)
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.

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

Creates a scale SRT.

static SRTValue3D kanzi::SRTValue3D::createUniformScale ( float  scale)
inlinestatic

Creates a uniform scale SRT.

static SRTValue3D kanzi::SRTValue3D::createTranslation ( Vector3  translation)
inlinestatic

Creates a translation SRT.

Friends And Related Function Documentation

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

Operator ==.

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

Operator !=.


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