RenderableComponent Class
Component that holds a shared pointer to a Renderable resource. More...
Declaration
Public Constructors Index
| RenderableComponent (std::shared_ptr< helios::rendering::Renderable > renderable) | |
|
Constructs a RenderableComponent. More... | |
| RenderableComponent (const RenderableComponent &other) | |
|
Copy constructor. More... | |
| RenderableComponent (RenderableComponent &&) noexcept=default | |
|
Move constructor. More... | |
Public Operators Index
| RenderableComponent & | operator= (const RenderableComponent &)=default |
|
Copy assignment operator. More... | |
| RenderableComponent & | operator= (RenderableComponent &&) noexcept=default |
|
Move assignment operator. More... | |
Public Member Functions Index
| bool | isEnabled () const noexcept |
|
Checks whether this component is enabled. More... | |
| void | enable () noexcept |
|
Enables this component. More... | |
| void | disable () noexcept |
|
Disables this component. More... | |
| std::shared_ptr< helios::rendering::Renderable > | shareRenderable () const noexcept |
|
Retrieves a shared pointer to the stored Renderable. More... | |
| const helios::rendering::Renderable & | renderable () const noexcept |
|
Retrieves a const ref to 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... | |
| bool | isEnabled_ = true |
|
Whether this component is enabled. 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 77 of file RenderableComponent.ixx.
Reference renderable.
Referenced by operator=, operator=, RenderableComponent and RenderableComponent.
RenderableComponent()
| inline |
Copy constructor.
Copies the shared pointer to the Renderable. Both components will reference the same Renderable resource (shared ownership).
- Parameters
-
other The component to copy from.
Definition at line 93 of file RenderableComponent.ixx.
Reference RenderableComponent.
RenderableComponent()
| noexcept default |
Move constructor.
Definition at line 104 of file RenderableComponent.ixx.
Reference RenderableComponent.
Public Operators
operator=()
| default |
Copy assignment operator.
Definition at line 99 of file RenderableComponent.ixx.
Reference RenderableComponent.
operator=()
| noexcept default |
Move assignment operator.
Definition at line 109 of file RenderableComponent.ixx.
Reference RenderableComponent.
Public Member Functions
disable()
| inline noexcept |
Disables this component.
Definition at line 68 of file RenderableComponent.ixx.
enable()
| inline noexcept |
Enables this component.
Definition at line 61 of file RenderableComponent.ixx.
isEnabled()
| inline nodiscard noexcept |
Checks whether this component is enabled.
- Returns
True if enabled, false otherwise.
Definition at line 54 of file RenderableComponent.ixx.
renderable()
| inline nodiscard noexcept |
Retrieves a const ref to the stored Renderable.
- Returns
Const ref to the Renderable (never null after construction).
Definition at line 127 of file RenderableComponent.ixx.
Referenced by RenderableComponent.
shareRenderable()
| inline nodiscard noexcept |
Retrieves a shared pointer to the stored Renderable.
- Returns
Shared pointer to the Renderable.
Definition at line 118 of file RenderableComponent.ixx.
Reference shareRenderable.
Referenced by helios::engine::builder::gameObject::builders::configs::SceneNodeConfig::parent, helios::engine::builder::gameObject::builders::configs::SceneNodeConfig::parent and shareRenderable.
Private Member Attributes
aabb_
|
The initial AABB of the model associated with the renderable.
Definition at line 40 of file RenderableComponent.ixx.
isEnabled_
|
Whether this component is enabled.
Definition at line 45 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.