![]() |
Rendering Engine 0.2.9
Modular Graphics Rendering Engine | v0.2.9
|
Base class representing a 3D entity within a Scene. More...
#include <actor.hpp>
Public Member Functions | |
| Actor (Scene &scene) | |
| Constructs an Actor associated with a Scene. More... | |
| virtual | ~Actor () |
| virtual void | Initialize () |
| Initializes the actor after creation. More... | |
| void | SetPosition (const glm::vec3 &position) |
| Sets the actor's position in world space. More... | |
| void | SetRotation (const glm::vec3 &rotation) |
| Sets the actor's rotation in degrees. More... | |
| void | SetScale (const glm::vec3 &scale) |
| Sets the actor's scale along each axis. More... | |
| const glm::vec3 & | GetPosition () const |
| Gets the actor's position. More... | |
| const glm::vec3 & | GetRotation () const |
| Gets the actor's rotation (pitch, yaw, roll in degrees). More... | |
| const glm::vec3 & | GetScale () const |
| Gets the actor's scale. More... | |
| SceneComponent & | GetTransform () |
| Access to the underlying SceneComponent (transform). More... | |
| const SceneComponent & | GetTransform () const |
| virtual void | Update (float deltaTime) |
| Updates actor logic and root transform state. More... | |
| RenderResourceContext | GetRenderContext () const |
| Returns the render resource context associated with this actor. More... | |
| void | Destroy () |
| Requests deferred destruction of this actor. More... | |
| bool | IsPendingDestroy () const |
| Indicates whether this actor is scheduled for destruction. More... | |
| Actor (const Actor &)=delete | |
| Actor & | operator= (const Actor &)=delete |
Protected Member Functions | |
| virtual void | Shutdown () |
| Performs internal cleanup before destruction. More... | |
| template<typename T , typename V > | |
| T * | CreateSubobject (V arg) |
| Creates and attaches a drawable subobject to this actor. More... | |
| template<> | |
| StaticMesh * | CreateSubobject (StaticMeshParams params) |
Protected Attributes | |
| SceneComponent | mRootComponent |
| bool | bUpdateOnTick |
| bool | bPendingDestroy = false |
Friends | |
| class | Scene |
Base class representing a 3D entity within a Scene.
An Actor encapsulates:
Actors are owned and lifetime-managed by the Scene that spawns them. They must not be manually deleted.
Transformations applied to the Actor propagate to all attached drawable subobjects via hierarchical SceneComponent attachment.
| rendering_engine::Actor::Actor | ( | Scene & | scene | ) |
Constructs an Actor associated with a Scene.
The Scene becomes the owner of this Actor. The root SceneComponent is initialized with identity transform.
| scene | Reference to the owning Scene. |
Definition at line 9 of file actor.cpp.
|
delete |
|
protected |
Definition at line 17 of file create_actor_subobject.hpp.
|
protected |
Creates and attaches a drawable subobject to this actor.
This helper function delegates creation to the owning Scene, registers the drawable for lifetime management, and stores it as a ward (child drawable) of the actor.
| T | Drawable type (must derive from Drawable3D). |
| V | Construction parameter type. |
| arg | Argument forwarded to Scene::Spawn(). |
| void rendering_engine::Actor::Destroy | ( | ) |
Requests deferred destruction of this actor.
Marks the actor as pending destroy and schedules safe removal via the owning Scene.
The actor is not deleted immediately. Instead:
Definition at line 79 of file actor.cpp.
| const glm::vec3 & rendering_engine::Actor::GetPosition | ( | ) | const |
Gets the actor's position.
Definition at line 41 of file actor.cpp.
| RenderResourceContext rendering_engine::Actor::GetRenderContext | ( | ) | const |
Returns the render resource context associated with this actor.
This context provides access to renderer-level resources required by attached drawable components.
Definition at line 74 of file actor.cpp.
| const glm::vec3 & rendering_engine::Actor::GetRotation | ( | ) | const |
Gets the actor's rotation (pitch, yaw, roll in degrees).
Definition at line 46 of file actor.cpp.
| const glm::vec3 & rendering_engine::Actor::GetScale | ( | ) | const |
Gets the actor's scale.
Definition at line 51 of file actor.cpp.
| SceneComponent & rendering_engine::Actor::GetTransform | ( | ) |
Access to the underlying SceneComponent (transform).
| const SceneComponent & rendering_engine::Actor::GetTransform | ( | ) | const |
|
virtual |
Initializes the actor after creation.
Called automatically by Scene::SpawnActor(). Derived classes should override this method to:
Definition at line 21 of file actor.cpp.
|
inline |
| void rendering_engine::Actor::SetPosition | ( | const glm::vec3 & | position | ) |
Sets the actor's position in world space.
| position | New position vector (x, y, z). |
Definition at line 25 of file actor.cpp.
| void rendering_engine::Actor::SetRotation | ( | const glm::vec3 & | rotation | ) |
Sets the actor's rotation in degrees.
| rotation | New rotation vector (pitch, yaw, roll), in degrees. |
Definition at line 30 of file actor.cpp.
| void rendering_engine::Actor::SetScale | ( | const glm::vec3 & | scale | ) |
Sets the actor's scale along each axis.
| scale | New scale vector (x, y, z). |
Definition at line 36 of file actor.cpp.
|
protectedvirtual |
Performs internal cleanup before destruction.
Called by Scene during the destruction flush phase. Derived classes may override this to release resources, but must not delete the actor manually.
Definition at line 103 of file actor.cpp.
|
virtual |
Updates actor logic and root transform state.
Called once per frame by Scene::Update().
The base implementation updates the root SceneComponent's world matrix if ticking is enabled.
Derived classes should call Actor::Update(deltaTime) before or after custom logic as appropriate.
| deltaTime | Time elapsed since last frame (seconds). |
|
protected |
|
protected |