SUNENGINE 0.0.2
A simple and bright C++ game engine.
 
Loading...
Searching...
No Matches
CollisionManager Class Reference

Manages the registration and processing of collisions for GameObjects. More...

#include <CollisionManager.h>

Public Types

using PWTypeID = int
 Type alias for the type ID.
 

Public Member Functions

 CollisionManager (const CollisionManager &)=delete
 
CollisionManageroperator= (const CollisionManager &)=delete
 
CollidableGroupGetColGroup (PWTypeID id)
 Gets the collidable group for the specified type ID.
 
void ProcessElements ()
 Processes all registered collisions.
 
template<typename C>
PWTypeID GetTypeID ()
 Gets the type ID for the specified collidable type.
 
void UpdateGroupAABBs ()
 
bool TestGroupCollision (CollidableGroup *g1, CollidableGroup *g2)
 
void DebugRender ()
 
template<typename C>
void SetCollisionSelf ()
 Sets the collision self test for the specified collidable type.
 
template<typename C1, typename C2>
void SetCollisionPair ()
 Sets the collision pair test for the specified collidable types.
 
template<typename Type>
void SetCollisionTerrain ()
 

Static Public Attributes

static const PWTypeID PWID_UNDEFINED = -1
 The undefined type ID.
 

Private Types

using CollidableGroupCollection = std::vector<CollidableGroup*>
 Type alias for the collidable group collection.
 
using CollisionTestCommands = std::list<CollisionTestCommandBase*>
 Type alias for the collision test commands.
 

Private Member Functions

void SetGroupForTypeID (CollisionManager::PWTypeID ind)
 Sets the group for the specified type ID.
 

Private Attributes

const int MAX_COLLISION_GROUP = 64
 The maximum number of collision groups.
 
CollidableGroupCollection ColGroupCollection
 The collidable group collection.
 
CollisionTestCommands colTestCommands
 The collision test commands.
 

Static Private Attributes

static PWTypeID TypeIDNextNumber = 0
 The next type ID number.
 

Detailed Description

Manages the registration and processing of collisions for GameObjects.

The CollisionManager class is responsible for managing the registration and processing of collisions for GameObjects. It provides methods to register, deregister, and process collisions.

Member Function Documentation

◆ GetColGroup()

CollidableGroup * CollisionManager::GetColGroup ( PWTypeID id)

Gets the collidable group for the specified type ID.

Parameters
idThe type ID.
Returns
Pointer to the collidable group.
Here is the caller graph for this function:

◆ GetTypeID()

template<typename C>
PWTypeID CollisionManager::GetTypeID ( )
inline

Gets the type ID for the specified collidable type.

Template Parameters
CThe collidable type.
Returns
The type ID.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ SetCollisionPair()

template<typename C1, typename C2>
void CollisionManager::SetCollisionPair ( )
inline

Sets the collision pair test for the specified collidable types.

Template Parameters
C1The first collidable type.
C2The second collidable type.
Here is the call graph for this function:

◆ SetCollisionSelf()

template<typename C>
void CollisionManager::SetCollisionSelf ( )
inline

Sets the collision self test for the specified collidable type.

Template Parameters
CThe collidable type.
Here is the call graph for this function:

◆ SetGroupForTypeID()

void CollisionManager::SetGroupForTypeID ( CollisionManager::PWTypeID ind)
private

Sets the group for the specified type ID.

Parameters
indThe type ID.
Here is the caller graph for this function:

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