Clutter Engine 0.0.1
|
Represents a 2D transformation including location, scale, and rotation. More...
#include <Transform2D.h>
Public Member Functions | |
Transform2D () | |
Default constructor. Initializes to identity transform. | |
Transform2D (Vector2 pLocation, Vector2 pScale, float pRotation) | |
Constructs a Transform2D with specified location, scale, and rotation. | |
Vector2 | Right () const |
Gets the right direction vector based on the current rotation. | |
Vector2 | Up () const |
Gets the up direction vector based on the current rotation. | |
Transform | To3D () |
Converts this 2D transform to a 3D transform. | |
Public Attributes | |
Vector2 | location = { 0, 0 } |
The position of the transform in 2D space. | |
Vector2 | scale = { 1, 1 } |
The scale of the transform in 2D space. | |
float | rotation = 0 |
The rotation of the transform in radians. | |
Friends | |
Transform2D | operator+ (Transform2D left, Transform2D right) |
Adds two Transform2D objects component-wise. | |
Represents a 2D transformation including location, scale, and rotation.
Constructs a Transform2D with specified location, scale, and rotation.
pLocation | The position in 2D space. |
pScale | The scale in 2D space. |
pRotation | The rotation in radians. |
|
inline |
Gets the right direction vector based on the current rotation.
|
inline |
Converts this 2D transform to a 3D transform.
|
inline |
Gets the up direction vector based on the current rotation.
|
friend |
Adds two Transform2D objects component-wise.
left | The first Transform2D. |
right | The second Transform2D. |