9 mRotation{ 1.0f, 0.0f, 0.0f, 0.0f },
10 mEulerRotation{ 0.0f },
11 mScale{ 1.0f, 1.0f, 1.0f },
26 glm::translate(glm::mat4(1.0f),
mPosition) *
28 glm::scale(glm::mat4(1.0f),
mScale);
76 const glm::vec3 radians = glm::radians(rotation);
109 return glm::vec3(world[3]);
116 glm::mat3 rotationMatrix(world);
117 return glm::quat_cast(rotationMatrix);
124 glm::length(glm::vec3(world[0])),
125 glm::length(glm::vec3(world[1])),
126 glm::length(glm::vec3(world[2]))
Represents a 3D transformable scene component with position, rotation, and scale.
glm::vec3 GetRight() const
Returns the right (local Y+) direction vector in world space.
void AttachTo(SceneComponent *parent)
Attaches this scene component to a parent scene component.
void UpdateLocalMatrix()
Updates the world transformation matrix from the current position, rotation, and scale.
const glm::mat4 & GetWorldMatrix()
Returns the world transformation matrix (model matrix).
void SetRotation(const glm::quat &rotation)
Sets the rotation using a quaternion.
glm::vec3 GetWorldPosition() const
Returns the world-space position of this component.
SceneComponent()
Constructs a SceneComponent with default transform (origin, identity rotation, unit scale).
void SetPosition(const glm::vec3 &position)
Sets the position of the component in world space.
glm::vec3 GetForward() const
Returns the forward (local X+) direction vector in world space.
glm::quat GetWorldRotation() const
Returns the world-space rotation of this component.
void SetScale(const glm::vec3 &scale)
Sets the scale for each dimension.
glm::vec3 GetWorldScale() const
Returns the world-space scale of this component.
glm::vec3 GetUp() const
Returns the up (local Z+) direction vector in world space.
static const glm::vec3 UpVector
static const glm::vec3 RightVector
static const glm::vec3 ForwardVector