![]() |
MAGE
v0.171.0
Matthias Advanced Game Engine
|
#include <sprite_transform.hpp>
Public Member Functions | |
SpriteTransform2D (F32x2 translation={ 0.0f, 0.0f }, F32 depth=0.0f, F32 rotation=0.0f, F32x2 rotation_origin={ 0.0f, 0.0f }, F32x2 scale={ 1.0f, 1.0f }) noexcept | |
SpriteTransform2D (FXMVECTOR translation, F32 depth, F32 rotation, FXMVECTOR rotation_origin, FXMVECTOR scale) noexcept | |
SpriteTransform2D (const SpriteTransform2D &transform) noexcept=default | |
SpriteTransform2D (SpriteTransform2D &&transform) noexcept=default | |
~SpriteTransform2D ()=default | |
SpriteTransform2D & | operator= (const SpriteTransform2D &transform) noexcept=default |
SpriteTransform2D & | operator= (SpriteTransform2D &&transform) noexcept=default |
void | SetTranslationX (F32 x) noexcept |
void | SetTranslationY (F32 y) noexcept |
void | SetTranslation (F32 x, F32 y) noexcept |
void | SetTranslation (F32x2 translation) noexcept |
void XM_CALLCONV | SetTranslation (FXMVECTOR translation) noexcept |
void | AddTranslationX (F32 x) noexcept |
void | AddTranslationY (F32 y) noexcept |
void | AddTranslation (F32 x, F32 y) noexcept |
void | AddTranslation (const F32x2 &translation) noexcept |
void XM_CALLCONV | AddTranslation (FXMVECTOR translation) noexcept |
F32 | GetTranslationX () const noexcept |
F32 | GetTranslationY () const noexcept |
const F32x2 | GetTranslationView () const noexcept |
const XMVECTOR XM_CALLCONV | GetTranslation () const noexcept |
void | SetDepth (F32 depth) noexcept |
void | AddDepth (F32 depth) noexcept |
F32 | GetDepth () const noexcept |
void | SetRotation (F32 rotation) noexcept |
void | AddRotation (F32 rotation) noexcept |
void | AddRotation (F32 rotation, F32 min_angle, F32 max_angle) noexcept |
F32 | GetRotation () const noexcept |
void | SetRotationOriginX (F32 x) noexcept |
void | SetRotationOriginY (F32 y) noexcept |
void | SetRotationOrigin (F32 x, F32 y) noexcept |
void | SetRotationOrigin (F32x2 rotation_origin) noexcept |
void XM_CALLCONV | SetRotationOrigin (FXMVECTOR rotation_origin) noexcept |
void | AddRotationOriginX (F32 x) noexcept |
void | AddRotationOriginY (F32 y) noexcept |
void | AddRotationOrigin (F32 x, F32 y) noexcept |
void | AddRotationOrigin (const F32x2 &offset) noexcept |
void XM_CALLCONV | AddRotationOrigin (FXMVECTOR offset) noexcept |
F32 | GetRotationOriginX () const noexcept |
F32 | GetRotationOriginY () const noexcept |
const F32x2 | GetRotationOriginView () const noexcept |
const XMVECTOR XM_CALLCONV | GetRotationOrigin () const noexcept |
void | SetScaleX (F32 x) noexcept |
void | SetScaleY (F32 y) noexcept |
void | SetScale (F32 s) noexcept |
void | SetScale (F32 x, F32 y) noexcept |
void | SetScale (F32x2 scale) noexcept |
void XM_CALLCONV | SetScale (FXMVECTOR scale) noexcept |
void | AddScaleX (F32 x) noexcept |
void | AddScaleY (F32 y) noexcept |
void | AddScale (F32 s) noexcept |
void | AddScale (F32 x, F32 y) noexcept |
void | AddScale (const F32x2 &scale) noexcept |
void XM_CALLCONV | AddScale (FXMVECTOR scale) noexcept |
F32 | GetScaleX () const noexcept |
F32 | GetScaleY () const noexcept |
const F32x2 | GetScaleView () const noexcept |
const XMVECTOR XM_CALLCONV | GetScale () const noexcept |
const XMMATRIX XM_CALLCONV | GetTransformMatrix () const noexcept |
Private Attributes | |
F32x2 | m_translation |
F32 | m_depth |
F32 | m_rotation |
F32x2 | m_rotation_origin |
F32x2 | m_scale |
A class of 2D sprite transforms supporting non-uniform scaling, rotation and translation (incl. depth).
|
explicitnoexcept |
Constructs a sprite transform from the given translation, depth, rotation, rotation origin and scale component.
[in] | translation | The translation component. |
[in] | depth | The depth component. |
[in] | rotation | The rotation component. |
[in] | rotation_origin | The rotation component. |
[in] | scale | The scale component. |
|
explicitnoexcept |
Constructs a sprite transform from the given translation, depth, rotation, rotation origin and scale component.
[in] | translation | The translation component. |
[in] | depth | The depth component. |
[in] | rotation | The rotation component. |
[in] | rotation_origin | The rotation component. |
[in] | scale | The scale component. |
|
defaultnoexcept |
Constructs a sprite transform from the given sprite transform.
[in] | transform | A reference to the sprite transform to copy. |
|
defaultnoexcept |
Constructs a sprite transform by moving the given sprite transform.
[in] | transform | A reference to the sprite transform to move. |
|
default |
Destructs this sprite transform.
|
noexcept |
Adds the given depth component to the depth component of this sprite transform.
[in] | depth | The depth component to add. |
|
noexcept |
Adds the given rotation component to the rotation component of this sprite transform.
[in] | rotation | The rotation component to add. |
Adds the given rotation component to the rotation component of this sprite transform and clamps the resulting rotation component of this sprite transform between the given values.
[in] | rotation | The rotation component to add. |
[in] | min_angle | The minimum angle (in radians). |
[in] | max_angle | The maximum angle (in radians). |
Adds the given offsets to the rotation origin of this sprite transform.
[in] | x | The x-value of the offset to add. |
[in] | y | The y-value of the offset to add. |
|
noexcept |
Adds the given offset to the rotation origin of this sprite transform.
[in] | offset | The offset to add. |
|
noexcept |
Adds the given offset to the rotation origin of this sprite transform.
[in] | offset | The offset to add. |
|
noexcept |
Adds the given x-value to the rotation origin of this sprite transform.
[in] | x | The x-value of the offset to add. |
|
noexcept |
Adds the given y-value to the rotation origin of this sprite transform.
[in] | y | The y-value of the offset to add. |
|
noexcept |
Adds the given scale component to the scale component of this sprite transform.
[in] | s | The scale component to add. |
Adds the given scale component to the scale component of this sprite transform.
[in] | x | The x-value of the scale component to add. |
[in] | y | The y-value of the scale component to add. |
|
noexcept |
Adds the given scale component to the scale component of this sprite transform.
[in] | scale | A reference to the scale component to add. |
|
noexcept |
Adds the given scale component to the scale component of this sprite transform.
[in] | scale | The scale component to add. |
|
noexcept |
Adds the given x-value to the scale component of this sprite transform.
[in] | x | The x-value of the scale component to add. |
|
noexcept |
Adds the given y-value to the scale component of this sprite transform.
[in] | y | The y-value of the scale component to add. |
Adds the given translation component to the translation component of this sprite transform.
[in] | x | The x-value of the translation component to add. |
[in] | y | The y-value of the translation component to add. |
|
noexcept |
Adds the given translation component to the translation component of this sprite transform.
[in] | translation | A reference to the translation component to add. |
|
noexcept |
Adds the given translation component to the translation component of this sprite transform.
[in] | translation | The translation component to add. |
|
noexcept |
Adds the given x-value to the translation component of this sprite transform.
[in] | x | The x-value of the translation component to add. |
|
noexcept |
Adds the given y-value to the translation component of this sprite transform.
[in] | y | The y-value of the translation component to add. |
|
noexcept |
Returns the depth component of this sprite transform.
|
noexcept |
Returns the rotation component of this sprite transform.
|
noexcept |
Returns the rotation origin of this sprite transform.
|
noexcept |
Returns the rotation origin of this sprite transform.
|
noexcept |
Returns the x-value of the rotation origin of this sprite transform.
|
noexcept |
Returns the y-value of the rotation origin of this sprite transform.
|
noexcept |
Returns the scale component of this sprite transform.
|
noexcept |
Returns the scale component of this sprite transform.
|
noexcept |
Returns the x-value of the scale component of this sprite transform.
|
noexcept |
Returns the y-value of the scale component of this sprite transform.
|
noexcept |
Returns the transformation matrix of this sprite transform.
|
noexcept |
Returns the translation component of this sprite transform.
|
noexcept |
Returns the translation component of this sprite transform.
|
noexcept |
Returns the x-value of the translation component of this sprite transform.
|
noexcept |
Returns the y-value of the translation component of this sprite transform.
|
defaultnoexcept |
Copies the given sprite transform to this sprite transform.
[in] | transform | The sprite transform to move. |
|
defaultnoexcept |
Moves the given sprite transform to this sprite transform.
[in] | transform | The sprite transform to copy. |
|
noexcept |
Sets the depth component of this sprite transform to the given depth component.
[in] | depth | The depth component. |
|
noexcept |
Sets the rotation component of this sprite transform to the given r otation component.
[in] | rotation | The rotation component. |
Sets the rotation origin of this sprite transform to the given rotation origin.
[in] | x | The x-value of the rotation origin. |
[in] | y | The y-value of the rotation origin. |
|
noexcept |
Sets the rotation origin of this sprite transform to the given rotation origin.
[in] | rotation_origin | The rotation origin. |
|
noexcept |
Sets the rotation origin of this sprite transform to the given rotation origin.
[in] | rotation_origin | The rotation origin. |
|
noexcept |
Sets the x-value of the rotation origin of this sprite transform to the given value.
[in] | x | The x-value of the rotation origin. |
|
noexcept |
Sets the y-value of the rotation origin of this sprite transform to the given value.
[in] | y | The y-value of the rotation origin. |
|
noexcept |
Sets the scale component of this sprite transform to the given scale component.
[in] | s | The scale component. |
Sets the scale component of this sprite transform to the given scale component.
[in] | x | The x-value of the scale component. |
[in] | y | The y-value of the scale component. |
|
noexcept |
Sets the scale component of this sprite transform to the given scale component.
[in] | scale | The scale component. |
|
noexcept |
Sets the scale component of this sprite transform to the given scale component.
[in] | scale | The scale component. |
|
noexcept |
Sets the x-value of the scale component of this sprite transform to the given value.
[in] | x | The x-value of the scale component. |
|
noexcept |
Sets the y-value of the scale component of this sprite transform to the given value.
[in] | y | The y-value of the scale component. |
Sets the translation component of this sprite transform to the given translation component.
[in] | x | The x-value of the translation component. |
[in] | y | The y-value of the translation component. |
|
noexcept |
Sets the translation component of this sprite transform to the given translation component.
[in] | translation | The translation component. |
|
noexcept |
Sets the translation component of this sprite transform to the given translation component.
[in] | translation | The translation component. |
|
noexcept |
Sets the x-value of the translation component of this sprite transform to the given value.
[in] | x | The x-value of the translation component. |
|
noexcept |
Sets the y-value of the translation component of this sprite transform to the given value.
[in] | y | The y-value of the translation component. |
|
private |
The depth component of this sprite transform.
|
private |
The rotation component (in radians) of this sprite transform.
|
private |
The rotation origin (in texels) of this sprite transform.
|
private |
The scale component of this sprite transform.
|
private |
The translation component (in pixels) of this sprite transform.