RenderableComponent Class
Component that holds a shared pointer to a Renderable resource. More...
Declaration
Base class
| class | CloneableComponent<Derived> |
|
CRTP base class for components that support cloning. More... | |
Public Constructors Index
| RenderableComponent (std::shared_ptr< helios::rendering::Renderable > renderable) | |
|
Constructs a RenderableComponent. More... | |
| RenderableComponent (const RenderableComponent &other) | |
|
Copy Constructor. More... | |
Public Member Functions Index
| void | onAttach (helios::engine::ecs::GameObject *gameObject) noexcept override |
|
Called when the component is attached to a GameObject. More... | |
| std::shared_ptr< helios::rendering::Renderable > | renderable () const noexcept |
|
Retrieves the stored Renderable. More... | |
Private Member Attributes Index
| std::shared_ptr< helios::rendering::Renderable > | renderable_ |
|
Shared pointer to the renderable resource. More... | |
| helios::math::aabbf | aabb_ {} |
|
The initial AABB of the model associated with the renderable. More... | |
Description
Component that holds a shared pointer to a Renderable resource.
This component links a GameObject to a visual representation (Renderable). When attached, it automatically extracts the AABB from the renderable's mesh and populates a ModelAabbComponent on the same GameObject.
Definition at line 30 of file RenderableComponent.ixx.
Public Constructors
RenderableComponent()
| inline explicit |
Constructs a RenderableComponent.
- Parameters
-
renderable Shared pointer to the Renderable. Must not be nullptr.
Definition at line 49 of file RenderableComponent.ixx.
Reference renderable.
Referenced by RenderableComponent.
RenderableComponent()
| inline explicit |
Copy Constructor.
Definition at line 62 of file RenderableComponent.ixx.
Reference RenderableComponent.
Public Member Functions
onAttach()
| inline noexcept virtual |
Called when the component is attached to a GameObject.
Automatically adds or retrieves a ModelAabbComponent on the GameObject and initializes it with the captured AABB from the Renderable.
- Parameters
-
gameObject Pointer to the parent GameObject.
Definition at line 75 of file RenderableComponent.ixx.
References helios::engine::ecs::Component::gameObject and helios::engine::modules::rendering::model::components::ModelAabbComponent::setAabb.
renderable()
| inline nodiscard noexcept |
Retrieves the stored Renderable.
- Returns
Shared pointer to the Renderable.
Definition at line 88 of file RenderableComponent.ixx.
Referenced by RenderableComponent.
Private Member Attributes
aabb_
|
The initial AABB of the model associated with the renderable.
Definition at line 40 of file RenderableComponent.ixx.
renderable_
|
Shared pointer to the renderable resource.
Definition at line 35 of file RenderableComponent.ixx.
The documentation for this class was generated from the following file:
Generated via doxygen2docusaurus 2.0.0 by Doxygen 1.15.0.