Transform component responsible for storing spatial data of a GameObject. Defines position, rotation, and scale in 3D space. Every GameObject should have exactly one Transform.
More...
#include <Transform.hpp>
|
| | Component ()=default |
| | Protected constructor to prevent direct instantiation of the base class.
|
Transform component responsible for storing spatial data of a GameObject. Defines position, rotation, and scale in 3D space. Every GameObject should have exactly one Transform.
◆ Transform() [1/2]
| Engine::Transform::Transform |
( |
| ) |
|
|
default |
◆ Transform() [2/2]
Creates a transform with specified position, rotation, and scale.
- Parameters
-
| pos | Initial position |
| rot | Initial rotation |
| scl | Initial scale |
◆ GetPosition()
| const Maths::Vec3f & Engine::Transform::GetPosition |
( |
| ) |
const |
|
inline |
Returns the current position of the object.
- Returns
- Reference to position vector
◆ GetTypeName()
| std::string Engine::Transform::GetTypeName |
( |
| ) |
const |
|
inlineoverridevirtual |
◆ SetPosition()
| void Engine::Transform::SetPosition |
( |
const Maths::Vec3f & | p | ) |
|
|
inline |
Sets the world position of the object.
- Parameters
-
◆ Translate()
| void Engine::Transform::Translate |
( |
const Maths::Vec3f & | delta | ) |
|
|
inline |
Moves the object by a given offset.
- Parameters
-
◆ Update()
| void Engine::Transform::Update |
( |
float | dt | ) |
|
|
inlineoverridevirtual |
Called every frame to update the transform. Currently unused but kept for future logic.
- Parameters
-
| dt | Delta time between frames |
Reimplemented from Engine::Component.
◆ position
Position of the object in world space.
◆ rotation
Rotation of the object (usually Euler angles).
◆ scale
Scale of the object. Default value is (1,1,1).
The documentation for this class was generated from the following file: