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 | |
CollisionManager & | operator= (const CollisionManager &)=delete |
CollidableGroup * | GetColGroup (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. | |
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.
CollidableGroup * CollisionManager::GetColGroup | ( | PWTypeID | id | ) |
Gets the collidable group for the specified type ID.
id | The type ID. |
|
inline |
Gets the type ID for the specified collidable type.
C | The collidable type. |
|
inline |
Sets the collision pair test for the specified collidable types.
C1 | The first collidable type. |
C2 | The second collidable type. |
|
inline |
Sets the collision self test for the specified collidable type.
C | The collidable type. |
|
private |
Sets the group for the specified type ID.
ind | The type ID. |