SUNENGINE 0.0.2
A simple and bright C++ game engine.
 
Loading...
Searching...
No Matches
CollidableGroup.h
1#ifndef CollidableGroup_H
2#define CollidableGroup_H
3
4#include <list>
5
6class Collidable;
8
16class CollidableGroup
17{
18public:
22 using CollidableCollection = std::list<Collidable*>;
23
27 using CollidableCollectionRef = CollidableCollection::iterator;
28
29 CollidableGroup();
30 CollidableGroup(const CollidableGroup&) = delete;
31 CollidableGroup& operator=(const CollidableGroup&) = delete;
32 ~CollidableGroup();
33
38 void Register(Collidable* c);
39
44 void Deregister(Collidable* c);
45
51
57
61 void UpdateGroupAABB();
62
63private:
68
73
78};
79
80#endif
CollidableCollection ColCollection
The collection of collidable objects.
Definition CollidableGroup.h:67
Collidable * firstCollidable
Pointer to the first collidable object in the collection.
Definition CollidableGroup.h:77
void UpdateGroupAABB()
Updates the group AABB based on the collidable objects.
Definition CollidableGroup.cpp:43
CollisionVolumeAABB & GetGroupAABB()
Gets the group AABB.
Definition CollidableGroup.cpp:34
std::list< Collidable * > CollidableCollection
Type alias for the collection of collidable objects.
Definition CollidableGroup.h:22
const CollidableCollection & GetColliderCollection()
Gets the collection of collidable objects.
Definition CollidableGroup.cpp:29
void Deregister(Collidable *c)
Deregisters a collidable object.
Definition CollidableGroup.cpp:24
void Register(Collidable *c)
Registers a collidable object.
Definition CollidableGroup.cpp:19
CollidableCollection::iterator CollidableCollectionRef
Type alias for the collection iterator.
Definition CollidableGroup.h:27
CollisionVolumeAABB * groupAABB
The AABB that encloses the group of collidable objects.
Definition CollidableGroup.h:72
Base class for objects that can participate in collision detection.
Definition Collidable.h:26
Represents an axis-aligned bounding box (AABB) collision volume.
Definition CollisionVolumeAABB.h:23