Structure describing scale, rotation and translation transformation in 2D space. More...
#include <kanzi/core/math/srt_value_2d.hpp>
Public Member Functions | |
SRTValue2D () | |
Default constructor. More... | |
SRTValue2D (Vector2 scale, float rotationInRadians, Vector2 translation) | |
Constructor with supplied scale, rotation and translation. More... | |
Vector2 | getScale () const |
Returns the scale. More... | |
void | setScale (Vector2 value) |
void | scale (Vector2 factor) |
Applies scale factor. More... | |
void | uniformScale (float factor) |
Applies uniform scale factor. More... | |
float | getScaleX () const |
Returns scale along X. More... | |
void | setScaleX (float value) |
Sets scale along X. More... | |
float | getScaleY () const |
Returns scale along Y. More... | |
void | setScaleY (float value) |
Sets scale along Y. More... | |
float | getRotation () const |
Returns rotation. More... | |
void | setRotation (float rotationInRadians) |
Sets rotation. More... | |
void | rotate (float rotationInRadians) |
Applies rotation. More... | |
Vector2 | getTranslation () const |
Returns translation. More... | |
void | setTranslation (Vector2 value) |
Sets translation. More... | |
void | translate (Vector2 translation) |
Applies translation. More... | |
float | getTranslationX () const |
Returns translation along X. More... | |
void | setTranslationX (float value) |
Sets translation along X. More... | |
float | getTranslationY () const |
Returns translation along Y. More... | |
void | setTranslationY (float value) |
Sets translation along Y. More... | |
Matrix3x3 | toMatrix () const |
Converts the SRT representation to Matrix3x3 transform. More... | |
Static Public Member Functions | |
static SRTValue2D | createScale (Vector2 scale) |
Creates a scale SRT. More... | |
static SRTValue2D | createRotation (float rotationInRadians) |
Creates a rotation SRT. More... | |
static SRTValue2D | createTranslation (Vector2 translation) |
Creates a translation SRT. More... | |
static optional< SRTValue2D > | create (const Matrix3x3 &matrix) |
Attempts to create an SRT from a Matrix3x3. More... | |
Friends | |
bool | operator== (const SRTValue2D &left, const SRTValue2D &right) |
Operator ==. More... | |
bool | operator!= (const SRTValue2D &left, const SRTValue2D &right) |
Operator !=. More... | |
Structure describing scale, rotation and translation transformation in 2D space.
Rotation is stored as angle in radians.
|
inlineexplicit |
Default constructor.
|
inlineexplicit |
Constructor with supplied scale, rotation and translation.
|
inline |
Returns the scale.
|
inline |
|
inline |
Applies scale factor.
Multiplies current scale with provided factor.
|
inline |
Applies uniform scale factor.
Multiplies current scale with provided factor.
|
inline |
Returns scale along X.
|
inline |
Sets scale along X.
|
inline |
Returns scale along Y.
|
inline |
Sets scale along Y.
|
inline |
Returns rotation.
Rotation is angle in radians.
|
inline |
Sets rotation.
Rotation is angle in radians.
|
inline |
Applies rotation.
Provided angle is added. Rotation is angle in radians.
|
inline |
Returns translation.
|
inline |
Sets translation.
|
inline |
Applies translation.
Adds provided translation to existing translation.
|
inline |
Returns translation along X.
|
inline |
Sets translation along X.
|
inline |
Returns translation along Y.
|
inline |
Sets translation along Y.
Matrix3x3 kanzi::SRTValue2D::toMatrix | ( | ) | const |
Converts the SRT representation to Matrix3x3 transform.
|
inlinestatic |
Creates a scale SRT.
|
inlinestatic |
Creates a rotation SRT.
Rotation is angle in radians.
|
inlinestatic |
Creates a translation SRT.
|
static |
|
friend |
Operator ==.
|
friend |
Operator !=.