BoxColliderComponent represents an axis-aligned bounding box (AABB) collider. It handles collision detection using box geometry and provides debug rendering.
More...
#include <BoxColliderComponent.h>
|
| BoxColliderComponent (Actor *pOwner, Box pBox={}) |
| Constructor for BoxColliderComponent.
|
|
void | DebugRender (IRenderer *pRenderer) override |
| Renders a wireframe box in the world for debugging purposes.
|
|
bool | Collision (const ColliderComponent *pComponent) override |
| Checks for collision between this box collider and another collider. Only supports collision with other BoxColliderComponent instances.
|
|
Box | GetWorldBox () const |
| Gets the world-space representation of this box collider. Takes into account the owning actor's transform (position and scale).
|
|
| 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.
|
|
| 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.
|
|
|
Box | mBox |
| Local-space axis-aligned box defining the collider shape.
|
|
Color | mColor { 255,0,0,255 } |
| Debug rendering color for the collider (default: red).
|
|
|
Actor * | mOwner = nullptr |
| The actor that owns this component.
|
|
BoxColliderComponent represents an axis-aligned bounding box (AABB) collider. It handles collision detection using box geometry and provides debug rendering.
◆ BoxColliderComponent()
BoxColliderComponent::BoxColliderComponent |
( |
Actor * | pOwner, |
|
|
Box | pBox = {} ) |
Constructor for BoxColliderComponent.
- Parameters
-
pOwner | The actor that owns this collider component. |
pBox | The local-space box geometry for the collider (default: empty box). |
◆ Collision()
Checks for collision between this box collider and another collider. Only supports collision with other BoxColliderComponent instances.
- Parameters
-
pComponent | Pointer to the other collider component. |
- Returns
- True if a collision is detected, false otherwise.
Implements ColliderComponent.
◆ DebugRender()
void BoxColliderComponent::DebugRender |
( |
IRenderer * | pRenderer | ) |
|
|
overridevirtual |
Renders a wireframe box in the world for debugging purposes.
- Parameters
-
pRenderer | The renderer used to draw the debug geometry. |
Implements DebugRenderInterface.
◆ GetWorldBox()
Box BoxColliderComponent::GetWorldBox |
( |
| ) |
const |
Gets the world-space representation of this box collider. Takes into account the owning actor's transform (position and scale).
- Returns
- The world-space bounding box.
◆ mBox
Box BoxColliderComponent::mBox |
Local-space axis-aligned box defining the collider shape.
The documentation for this class was generated from the following files: