Claire's Game Engine
Full C++ Engine using OpenGL
Loading...
Searching...
No Matches
PhysicManager Class Reference

The PhysicManager is a singleton responsible for managing and detecting collisions between ColliderComponent instances. It allows adding/removing components and performs collision detection between them. More...

#include <PhysicManager.h>

Public Member Functions

 PhysicManager (const PhysicManager &)=delete
 
PhysicManageroperator= (const PhysicManager &)=delete
 
void AddComponent (ColliderComponent *pComponent)
 Adds a ColliderComponent to the manager for collision detection.
 
void RemoveComponent (ColliderComponent *pComponent)
 Removes a ColliderComponent from the manager.
 
ColliderComponentCollision (ColliderComponent *pComponent)
 Performs collision detection with all other components and returns the first component that collides with the given one.
 
Vector3 GetCollisionNormal (ColliderComponent *A, ColliderComponent *B)
 Calculates the normal vector at the collision point between two components.
 

Static Public Member Functions

static PhysicManagerInstance ()
 Returns the singleton instance of the PhysicManager.
 

Detailed Description

The PhysicManager is a singleton responsible for managing and detecting collisions between ColliderComponent instances. It allows adding/removing components and performs collision detection between them.

Constructor & Destructor Documentation

◆ PhysicManager()

PhysicManager::PhysicManager ( const PhysicManager & )
delete

Member Function Documentation

◆ AddComponent()

void PhysicManager::AddComponent ( ColliderComponent * pComponent)

Adds a ColliderComponent to the manager for collision detection.

Parameters
pComponentThe ColliderComponent to be added.

◆ Collision()

ColliderComponent * PhysicManager::Collision ( ColliderComponent * pComponent)

Performs collision detection with all other components and returns the first component that collides with the given one.

Parameters
pComponentThe ColliderComponent to check collisions for.
Returns
A pointer to the first colliding ColliderComponent or nullptr if none.

◆ GetCollisionNormal()

Vector3 PhysicManager::GetCollisionNormal ( ColliderComponent * A,
ColliderComponent * B )

Calculates the normal vector at the collision point between two components.

Parameters
AThe first ColliderComponent.
BThe second ColliderComponent.
Returns
The collision normal vector.

◆ Instance()

PhysicManager & PhysicManager::Instance ( )
static

Returns the singleton instance of the PhysicManager.

Returns
Reference to the static PhysicManager instance.

◆ operator=()

PhysicManager & PhysicManager::operator= ( const PhysicManager & )
delete

◆ RemoveComponent()

void PhysicManager::RemoveComponent ( ColliderComponent * pComponent)

Removes a ColliderComponent from the manager.

Parameters
pComponentThe ColliderComponent to be removed.

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