Clutter Engine 0.0.1
Loading...
Searching...
No Matches
clt::OBBCollider Class Reference

Oriented Bounding Box (OBB) collider component for collision detection. More...

#include <OBBCollider.h>

Inheritance diagram for clt::OBBCollider:
clt::ColliderComponent clt::Component

Public Member Functions

 OBBCollider (Vector3 pBoxExtend)
 Constructs an OBBCollider with the given box extents.
 
 OBBCollider (float pBoxExtend=10.0f)
 Constructs an OBBCollider with uniform box extents.
 
 ~OBBCollider ()=default
 Destructor.
 
void SetBoxExtend (Vector3 pBoxExtend)
 Sets the box extents.
 
void SetBoxExtend (float pBoxExtend)
 Sets the box extents uniformly.
 
Vector3 GetBoxExtend () const
 Gets the current box extents.
 
bool CheckCollision (ColliderComponent *pOther, hitResult &outResult) const override
 Checks collision with another collider component.
 
- Public Member Functions inherited from clt::ColliderComponent
 ColliderComponent ()
 Default constructor. Initializes friction, bounciness, and collider type.
 
 ~ColliderComponent ()
 Destructor.
 
void Subscribe (class ICollisionListener *listener) const
 Subscribes a collision listener to this collider.
 
const ColliderType GetType () const
 Gets the type of this collider.
 
bool IsTrigger () const
 Checks if this collider is a trigger.
 
- Public Member Functions inherited from clt::Component
 Component (int pUpdateOrder=0)
 Constructor for Component.
 
virtual ~Component ()=default
 Virtual destructor for Component.
 
virtual void Start ()
 Called when the component is started.
 
virtual void Update ()
 Called every frame to update the component.
 
virtual void Destroy ()
 Called to destroy the component.
 
void SetActive (bool pActive)
 Enables or disables the component.
 
void OnDestroy ()
 Called when the component is destroyed.
 
bool IsActive () const
 Checks if the component is enabled.
 
int GetUpdateOrder () const
 Gets the update order of the component.
 
void SetRelativeLocation (const Vector3 &loc)
 Sets the relative location of the component.
 
void SetRelativeLocation (const Vector2 &loc)
 Sets the relative location of the component.
 
void SetWorldLocation (const Vector3 &loc)
 Sets the world location of the component.
 
void SetRelativeScale (const Vector3 &scale)
 Sets the relative scale of the component.
 
void SetRelativeScale (const Vector2 &scale)
 Sets the relative scale of the component.
 
void SetRelativeRotation (Quaternion rot)
 Sets the relative rotation of the component.
 
void SetRelativeRotation (Vector3 rot)
 Sets the relative rotation of the component.
 
void SetWorldRotation (const Quaternion &rot)
 Sets the world rotation of the component.
 
void SetWorldRotation (const Vector3 &rot)
 Sets the world rotation of the component.
 
void AddRelativeRotation (Vector3 rot)
 Adds a rotation to the current relative rotation.
 
void SetRelativeRotation (float rot)
 Sets the relative rotation of the component.
 
void SetRelativeTransform (Transform &transform)
 Sets the relative transform of the component.
 
Vector3 GetRelativeLocation () const
 Gets the relative location of the component.
 
Vector3 GetRelativeScale () const
 Gets the relative scale of the component.
 
Quaternion GetRelativeRotation () const
 Gets the relative rotation of the component.
 
Vector3 GetRelativeRotationEuler () const
 Gets the relative rotation of the component as Euler angles.
 
Transform GetRelativeTransform () const
 Gets the relative transform of the component.
 
Vector3 GetWorldLocation () const
 Gets the world location of the component.
 
Vector3 GetWorldScale () const
 Gets the world scale of the component.
 
Quaternion GetWorldRotation () const
 Gets the world rotation of the component.
 
virtual Transform GetWorldTransform () const
 Gets the world transform of the component.
 
ActorGetOwner () const
 Gets the owner actor of this component.
 

Additional Inherited Members

- Public Attributes inherited from clt::ColliderComponent
float mFriction
 The friction coefficient of the collider.
 
float mBounciness
 The bounciness (restitution) of the collider.
 
- Public Attributes inherited from clt::Component
friend Actor
 
- Protected Member Functions inherited from clt::ColliderComponent
virtual void SetOwner (Actor *pOwner) override
 Sets the owner actor of this collider component.
 
- Protected Member Functions inherited from clt::Component
bool LineTrace (Vector3 start, Vector3 direction, float maxDistance, raycastHit &hit, bool debugPersistant=false)
 Performs a line trace (raycast) using the owning actor.
 
- Protected Attributes inherited from clt::ColliderComponent
bool mTrigger = false
 Indicates if the collider is a trigger.
 
ColliderType mType
 The type of the collider.
 
- Protected Attributes inherited from clt::Component
bool mIsActive = true
 Indicates if the component is active.
 
int mUpdateOrder = 0
 The order in which the component is updated.
 
ActormOwner
 The actor that owns this component.
 
Transform mRelativeTransform
 The relative transform of the component to its owner.
 

Detailed Description

Oriented Bounding Box (OBB) collider component for collision detection.

Constructor & Destructor Documentation

◆ OBBCollider() [1/2]

OBBCollider::OBBCollider ( Vector3 pBoxExtend)

Constructs an OBBCollider with the given box extents.

Parameters
pBoxExtendThe half-extents of the box.

◆ OBBCollider() [2/2]

OBBCollider::OBBCollider ( float pBoxExtend = 10.0f)

Constructs an OBBCollider with uniform box extents.

Parameters
pBoxExtendThe half-extent value for all axes (default 10.0f).

Member Function Documentation

◆ CheckCollision()

bool OBBCollider::CheckCollision ( ColliderComponent * pOther,
hitResult & outResult ) const
overridevirtual

Checks collision with another collider component.

Parameters
pOtherPointer to the other collider component.
outResultOutput parameter for collision result details.
Returns
True if collision detected, false otherwise.

Implements clt::ColliderComponent.

◆ GetBoxExtend()

Vector3 clt::OBBCollider::GetBoxExtend ( ) const
inline

Gets the current box extents.

Returns
The half-extents as a Vector3.

◆ SetBoxExtend() [1/2]

void clt::OBBCollider::SetBoxExtend ( float pBoxExtend)
inline

Sets the box extents uniformly.

Parameters
pBoxExtendThe new half-extent value for all axes.

◆ SetBoxExtend() [2/2]

void clt::OBBCollider::SetBoxExtend ( Vector3 pBoxExtend)
inline

Sets the box extents.

Parameters
pBoxExtendThe new half-extents as a Vector3.

The documentation for this class was generated from the following files: