Clutter Engine 0.0.1
Loading...
Searching...
No Matches
Transform2D Struct Reference

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.
 

Detailed Description

Represents a 2D transformation including location, scale, and rotation.

Constructor & Destructor Documentation

◆ Transform2D()

Transform2D::Transform2D ( Vector2 pLocation,
Vector2 pScale,
float pRotation )
inline

Constructs a Transform2D with specified location, scale, and rotation.

Parameters
pLocationThe position in 2D space.
pScaleThe scale in 2D space.
pRotationThe rotation in radians.

Member Function Documentation

◆ Right()

Vector2 Transform2D::Right ( ) const
inline

Gets the right direction vector based on the current rotation.

Returns
The right direction as a Vector2.

◆ To3D()

Transform Transform2D::To3D ( )
inline

Converts this 2D transform to a 3D transform.

Returns
The corresponding 3D Transform.

◆ Up()

Vector2 Transform2D::Up ( ) const
inline

Gets the up direction vector based on the current rotation.

Returns
The up direction as a Vector2.

Friends And Related Symbol Documentation

◆ operator+

Transform2D operator+ ( Transform2D left,
Transform2D right )
friend

Adds two Transform2D objects component-wise.

Parameters
leftThe first Transform2D.
rightThe second Transform2D.
Returns
The result of the addition.

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