Transform Manipulation
Header: Core/include/Core/Components.h
The Transform Component
Every entity that exists in the 3D world has a Transform:
Access it in any behavior:
Moving an Entity
Modify position directly. Always multiply by dt for frame-rate independence:
Tip
Use glm::mix(a, b, t) for smooth interpolation between two values. The third parameter controls speed (multiply by dt to keep it frame-rate independent).
Rotating an Entity
Rotation uses euler angles in degrees: x = pitch, y = yaw, z = roll.
Rotation Axes
Scaling an Entity
Direction from Rotation
Convert euler angles to a forward direction vector:
Useful glm Functions
Warning
Always use dt (delta time) when modifying transforms over time. Without it, movement speed depends on frame rate. speed * dt gives consistent speed regardless of FPS.