![]() |
Rendering Engine 0.2.0
Modular Graphics Rendering Engine | v0.2.0
|
Represents a 3D transformable scene component with position, rotation, and scale. More...
#include <scene_component.hpp>
Public Member Functions | |
| SceneComponent () | |
| Constructs a SceneComponent with default transform (origin, identity rotation, unit scale). | |
| virtual | ~SceneComponent ()=default |
| Destructor. | |
| void | UpdateWorldMatrix () |
| Updates the world transformation matrix from the current position, rotation, and scale. | |
| const glm::mat4 & | GetWorldMatrix () const |
| Returns the world transformation matrix (model matrix). | |
| void | SetPosition (const glm::vec3 &position) |
| Sets the position of the component in world space. | |
| void | SetRotation (const glm::quat &rotation) |
| Sets the rotation using a quaternion. | |
| void | SetRotation (const glm::vec3 &rotation) |
| Sets the rotation using Euler angles (in degrees). | |
| void | SetScale (const glm::vec3 &scale) |
| Sets the scale for each dimension. | |
| const glm::vec3 & | GetPosition () const |
| Gets the current position. | |
| const glm::quat & | GetRotationQuat () const |
| Gets the current rotation as a quaternion. | |
| const glm::vec3 & | GetRotation () const |
| Gets the current rotation as Euler angles (in radians). | |
| const glm::vec3 & | GetScale () const |
| Gets the current scale. | |
| glm::vec3 | GetForward () const |
| Returns the forward (local X+) direction vector in world space. | |
| glm::vec3 | GetRight () const |
| Returns the right (local Y+) direction vector in world space. | |
| glm::vec3 | GetUp () const |
| Returns the up (local Z+) direction vector in world space. | |
| SceneComponent (const SceneComponent &rhs)=delete | |
| SceneComponent & | operator= (const SceneComponent &rhs)=delete |
Protected Attributes | |
| glm::vec3 | mPosition |
| glm::quat | mRotation |
| glm::vec3 | mEulerRotation |
| glm::vec3 | mScale |
| glm::mat4 | mWorldMatrix |
Represents a 3D transformable scene component with position, rotation, and scale.
SceneComponent holds the core kinematic properties required for positioning and orienting objects in a 3D scene. It provides methods to set and get position, rotation (as both quaternion and Euler angles, in radians), and scale. The world transformation matrix is updated automatically when any of these properties change. Axis direction vectors (forward, right, up) are derived from the current rotation.
Definition at line 41 of file scene_component.hpp.
| rendering_engine::SceneComponent::SceneComponent | ( | ) |
Constructs a SceneComponent with default transform (origin, identity rotation, unit scale).
Definition at line 6 of file scene_component.cpp.
|
virtualdefault |
Destructor.
|
delete |
| glm::vec3 rendering_engine::SceneComponent::GetForward | ( | ) | const |
Returns the forward (local X+) direction vector in world space.
Definition at line 59 of file scene_component.cpp.
|
inline |
Gets the current position.
Definition at line 99 of file scene_component.hpp.
| glm::vec3 rendering_engine::SceneComponent::GetRight | ( | ) | const |
Returns the right (local Y+) direction vector in world space.
Definition at line 64 of file scene_component.cpp.
|
inline |
Gets the current rotation as Euler angles (in radians).
Definition at line 114 of file scene_component.hpp.
|
inline |
Gets the current rotation as a quaternion.
Definition at line 105 of file scene_component.hpp.
|
inline |
Gets the current scale.
Definition at line 120 of file scene_component.hpp.
| glm::vec3 rendering_engine::SceneComponent::GetUp | ( | ) | const |
Returns the up (local Z+) direction vector in world space.
Definition at line 69 of file scene_component.cpp.
| const glm::mat4 & rendering_engine::SceneComponent::GetWorldMatrix | ( | ) | const |
Returns the world transformation matrix (model matrix).
Definition at line 21 of file scene_component.cpp.
|
delete |
| void rendering_engine::SceneComponent::SetPosition | ( | const glm::vec3 & | position | ) |
Sets the position of the component in world space.
| position | The new position as a glm::vec3. |
Definition at line 26 of file scene_component.cpp.
| void rendering_engine::SceneComponent::SetRotation | ( | const glm::quat & | rotation | ) |
Sets the rotation using a quaternion.
| rotation | The rotation as a glm::quat. |
Definition at line 32 of file scene_component.cpp.
| void rendering_engine::SceneComponent::SetRotation | ( | const glm::vec3 & | rotation | ) |
Sets the rotation using Euler angles (in degrees).
| rotation | Euler angles in degrees: (pitch, yaw, roll).
|
Definition at line 44 of file scene_component.cpp.
| void rendering_engine::SceneComponent::SetScale | ( | const glm::vec3 & | scale | ) |
Sets the scale for each dimension.
| scale | The new scale as a glm::vec3. |
Definition at line 53 of file scene_component.cpp.
| void rendering_engine::SceneComponent::UpdateWorldMatrix | ( | ) |
Updates the world transformation matrix from the current position, rotation, and scale.
Normally called automatically after setters; call manually if you modify transform members directly.
Definition at line 16 of file scene_component.cpp.
|
protected |
Definition at line 149 of file scene_component.hpp.
|
protected |
Definition at line 147 of file scene_component.hpp.
|
protected |
Definition at line 148 of file scene_component.hpp.
|
protected |
Definition at line 150 of file scene_component.hpp.
|
protected |
Definition at line 152 of file scene_component.hpp.