The Transform
class is a component in the Tsar engine used to manage an object's position, rotation, and scale in 3D space.
Class Declaration
class Transform : public Component
This class inherits from the Component
class and adds functionality related to transformation in 3D space. It uses the RTTR library for reflection.
Public Methods
Translation
-
glm::vec3 GetTranslation()
Returns the current translation (position) of the object as a
glm::vec3
. -
void SetTranslation(const glm::vec3& translation)
Sets the object's translation using the provided
glm::vec3
.
Rotation
-
glm::vec3 GetRotation()
Returns the current rotation of the object as a
glm::vec3
. -
void SetRotation(const glm::vec3& rotation)
Sets the object's rotation using the provided
glm::vec3
.
Scale
-
glm::vec3 GetScale()
Returns the current scale of the object as a
glm::vec3
. -
void SetScale(const glm::vec3& scale)
Sets the object's scale using the provided
glm::vec3
.
Properties
The Transform
class exposes three properties that can be accessed via getter and setter functions:
-
glm::vec3 Translation
- Get:
GetTranslation()
- Set:
SetTranslation()
- Get:
-
glm::vec3 Rotation
- Get:
GetRotation()
- Set:
SetRotation()
- Get:
-
glm::vec3 Scale
- Get:
GetScale()
- Set:
SetScale()
- Get:
These properties allow users to manipulate the position, rotation, and scale of the object in a more intuitive manner.