The IComponent class is an abstract base class that defines the interface for all components in the ANVIL engine. Components are modular parts that can be attached to entities to give them specific functionality.
More...
#include <IComponent.h>
|
| virtual | ~IComponent () |
| | Virtual destructor for the IComponent class. Ensures proper cleanup of derived class objects when deleted through a base class pointer.
|
| virtual void | OnInit (AEntity *owner)=0 |
| | Called when the component is initialized.
|
| virtual void | OnUpdate (float dt)=0 |
| | Called once per frame to update the component's state.
|
| virtual void | OnRender (AShader *shader)=0 |
| | Called to render the component.
|
|
| AEntity * | m_owner = nullptr |
| | Pointer to the entity that owns this component. This allows the component to access its parent entity and other components attached to it.
|
The IComponent class is an abstract base class that defines the interface for all components in the ANVIL engine. Components are modular parts that can be attached to entities to give them specific functionality.
◆ ~IComponent()
| virtual IComponent::~IComponent |
( |
| ) |
|
|
inlinevirtual |
Virtual destructor for the IComponent class. Ensures proper cleanup of derived class objects when deleted through a base class pointer.
◆ OnInit()
| virtual void IComponent::OnInit |
( |
AEntity * | owner | ) |
|
|
pure virtual |
◆ OnRender()
| virtual void IComponent::OnRender |
( |
AShader * | shader | ) |
|
|
pure virtual |
◆ OnUpdate()
| virtual void IComponent::OnUpdate |
( |
float | dt | ) |
|
|
pure virtual |
Called once per frame to update the component's state.
- Parameters
-
| dt | The time elapsed since the last frame, in seconds. |
Implemented in MeshComponent, and RigidBodyComponent.
◆ m_owner
| AEntity* IComponent::m_owner = nullptr |
Pointer to the entity that owns this component. This allows the component to access its parent entity and other components attached to it.
The documentation for this class was generated from the following file: