Base class for collider components used in physics and collision detection. Inherits from Component for lifecycle management and DebugRenderInterface for debug visualization.
More...
#include <ColliderComponent.h>
|
| ColliderComponent (Actor *pOwner) |
| Constructor for ColliderComponent.
|
|
void | OnStart () override |
| Called when the component starts. Registers the component for debug rendering and adds it to the physics system.
|
|
void | OnEnd () override |
| Called when the component ends. Unregisters the component from debug rendering and removes it from the physics system.
|
|
virtual bool | Collision (const ColliderComponent *pComponent)=0 |
| Pure virtual method to check collision with another collider component. Must be implemented by derived classes (e.g., BoxCollider, SphereCollider).
|
|
| Component (Actor *pOwner, int pUpdateOrder=100) |
| Constructor for Component.
|
|
virtual | ~Component () |
|
virtual void | Update () |
| Called every frame to update the component. This can be used to perform actions that need to be updated periodically.
|
|
virtual void | OnUpdateWorldTrandform () |
| Called when the world transform of the actor is updated. This allows the component to react to changes in the actor's world transform.
|
|
void | SetActive (bool isActive) |
| Sets the active status of the component.
|
|
void | SetOwner (Actor *pOwner) |
| Sets the actor that owns this component.
|
|
int | GetUpdateOrder () const |
| Returns the update order of the component. Components with lower update orders are updated first.
|
|
Actor * | GetOwner () const |
| Returns the actor that owns this component.
|
|
virtual void | DebugRender (IRenderer *renderer)=0 |
|
|
Color | mColor { 255,0,0,255 } |
| Debug rendering color for the collider (default: red).
|
|
|
Actor * | mOwner = nullptr |
| The actor that owns this component.
|
|
Base class for collider components used in physics and collision detection. Inherits from Component for lifecycle management and DebugRenderInterface for debug visualization.
◆ ColliderComponent()
ColliderComponent::ColliderComponent |
( |
Actor * | pOwner | ) |
|
Constructor for ColliderComponent.
- Parameters
-
pOwner | The actor that owns this collider component. |
◆ Collision()
Pure virtual method to check collision with another collider component. Must be implemented by derived classes (e.g., BoxCollider, SphereCollider).
- Parameters
-
pComponent | Pointer to another collider component to check collision against. |
- Returns
- True if a collision is detected, false otherwise.
Implemented in BoxColliderComponent, and RectangleColliderComponent.
◆ OnEnd()
void ColliderComponent::OnEnd |
( |
| ) |
|
|
overridevirtual |
Called when the component ends. Unregisters the component from debug rendering and removes it from the physics system.
Reimplemented from Component.
◆ OnStart()
void ColliderComponent::OnStart |
( |
| ) |
|
|
overridevirtual |
Called when the component starts. Registers the component for debug rendering and adds it to the physics system.
Reimplemented from Component.
◆ mColor
Color ColliderComponent::mColor { 255,0,0,255 } |
Debug rendering color for the collider (default: red).
The documentation for this class was generated from the following files: