SceneNodeComponent Class
Component that links a GameObject to a SceneNode in the scene graph. More...
Declaration
Public Constructors Index
| SceneNodeComponent (helios::scene::SceneNode *sceneNode) | |
|
Constructs a SceneNodeComponent linked to a SceneNode. More... | |
| SceneNodeComponent (const SceneNodeComponent &other)=default | |
|
Copy constructor. More... | |
| SceneNodeComponent (SceneNodeComponent &&) noexcept=default | |
|
Move constructor. More... | |
Public Operators Index
| SceneNodeComponent & | operator= (const SceneNodeComponent &)=default |
|
Copy assignment operator. More... | |
| SceneNodeComponent & | operator= (SceneNodeComponent &&) 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... | |
| void | onActivate () noexcept |
|
Called when the owning GameObject is activated. More... | |
| void | onDeactivate () noexcept |
|
Called when the owning GameObject is deactivated. More... | |
| void | onClone (const SceneNodeComponent &other) |
|
Called after copy construction during entity cloning. More... | |
| helios::scene::SceneNode * | sceneNode () const noexcept |
|
Returns the underlying SceneNode. More... | |
Protected Member Attributes Index
| helios::scene::SceneNode * | sceneNode_ |
|
Non-owning pointer to the associated SceneNode. More... | |
| bool | isEnabled_ = true |
|
Whether this component is enabled. More... | |
Description
Component that links a GameObject to a SceneNode in the scene graph.
This component bridges the game logic layer (GameObject) with the rendering layer (SceneNode). It captures the initial AABB from the SceneNode's mesh (if available) and exposes the underlying SceneNode for other components to use.
The SceneNode must remain valid for the lifetime of this component.
Definition at line 35 of file SceneNodeComponent.ixx.
Public Constructors
SceneNodeComponent()
| inline explicit |
Constructs a SceneNodeComponent linked to a SceneNode.
- Parameters
-
sceneNode Pointer to the SceneNode to control. Must not be nullptr.
Definition at line 99 of file SceneNodeComponent.ixx.
References sceneNode and sceneNode_.
Referenced by onClone, operator=, operator=, SceneNodeComponent and SceneNodeComponent.
SceneNodeComponent()
| default |
Copy constructor.
Copies the SceneNode pointer. The actual SceneNode cloning is handled by onClone() during entity cloning.
Definition at line 111 of file SceneNodeComponent.ixx.
Reference SceneNodeComponent.
SceneNodeComponent()
| noexcept default |
Move constructor.
Definition at line 121 of file SceneNodeComponent.ixx.
Reference SceneNodeComponent.
Public Operators
operator=()
| default |
Copy assignment operator.
Definition at line 116 of file SceneNodeComponent.ixx.
Reference SceneNodeComponent.
operator=()
| noexcept default |
Move assignment operator.
Definition at line 126 of file SceneNodeComponent.ixx.
Reference SceneNodeComponent.
Public Member Functions
disable()
| inline noexcept |
Disables this component.
Definition at line 70 of file SceneNodeComponent.ixx.
Reference isEnabled_.
enable()
| inline noexcept |
isEnabled()
| inline nodiscard noexcept |
Checks whether this component is enabled.
- Returns
True if enabled, false otherwise.
Definition at line 56 of file SceneNodeComponent.ixx.
Reference isEnabled_.
onActivate()
| inline noexcept |
Called when the owning GameObject is activated.
Activates the SceneNode, making it visible in the scene graph.
Definition at line 79 of file SceneNodeComponent.ixx.
Reference sceneNode_.
onClone()
| inline |
Called after copy construction during entity cloning.
Creates a new SceneNode for this entity by cloning the source's renderable and adding it to the same parent node. This ensures each cloned entity has its own SceneNode in the scene graph.
- Parameters
-
other The source component to clone from.
Definition at line 137 of file SceneNodeComponent.ixx.
References onClone, sceneNode, sceneNode_ and SceneNodeComponent.
Referenced by onClone.
onDeactivate()
| inline noexcept |
Called when the owning GameObject is deactivated.
Deactivates the SceneNode, hiding it from the scene graph.
Definition at line 88 of file SceneNodeComponent.ixx.
Reference sceneNode_.
sceneNode()
| inline nodiscard noexcept |
Returns the underlying SceneNode.
- Returns
Non-owning pointer to the associated SceneNode.
Definition at line 155 of file SceneNodeComponent.ixx.
Reference sceneNode_.
Referenced by onClone and SceneNodeComponent.
Protected Member Attributes
isEnabled_
| protected |
Whether this component is enabled.
Definition at line 47 of file SceneNodeComponent.ixx.
sceneNode_
| protected |
Non-owning pointer to the associated SceneNode.
Definition at line 42 of file SceneNodeComponent.ixx.
Referenced by onActivate, onClone, onDeactivate, sceneNode and SceneNodeComponent.
The documentation for this class was generated from the following file:
Generated via doxygen2docusaurus 2.0.0 by Doxygen 1.15.0.