|
The Game Engine
1
|
This defines Collision caching as well as the ability to sort into buckets. More...
#include <Collision.h>
Collaboration diagram for Collision:Public Member Functions | |
| Collision () | |
| ~Collision () | |
| bool | collided (WorldObject *a, WorldObject *b) |
| Lets us know if a collision had precviously occurred (order independent). More... | |
| bool | collided (pair< WorldObject *, WorldObject * > key) |
| Lets us know if a collision had precviously occurred (order independent). More... | |
| void | markCollision (WorldObject *a, CollisionObject *ac, WorldObject *b, CollisionObject *bc) |
| Mark Collision as occurred. More... | |
| vector< tuple< WorldObject *, CollisionObject *, WorldObject *, CollisionObject * > > * | getCollisions (WorldObject *a, WorldObject *b) |
| returns list of collisions More... | |
| void | clear () |
| Clears all collision data from last run. More... | |
Static Public Member Functions | |
| static Collision * | collider () |
| gives us our Collision helper singleton More... | |
Public Attributes | |
| vector< vector< WorldObject * > > | CollisionLists |
| Sets of collision lists to check detection. More... | |
| vector< map< Point2D, vector < WorldObject * > > > | Buckets |
| Buckets into which items fall for collision (determined each loop) More... | |
| map< pair< WorldObject *, WorldObject * >, vector < tuple< WorldObject *, CollisionObject *, WorldObject *, CollisionObject * > > * > | Collisions |
| Map that provides a cache of all collidied objects for a given object (clears each loop) Note:initial key is pair of two objects checking collision, values are world object and associated collision object. More... | |
| unsigned int | CellWidth |
| The width of partition cells. More... | |
| unsigned int | CellHeight |
| The height of partition cells. More... | |
Static Public Attributes | |
| static Collision * | m_instance = NULL |
| instance of Collision helper More... | |
This defines Collision caching as well as the ability to sort into buckets.
This class is tasked with the following:
Definition at line 25 of file Collision.h.
|
inline |
|
inline |
|
inline |
Clears all collision data from last run.
Definition at line 94 of file Collision.h.
Here is the caller graph for this function:
|
inline |
Lets us know if a collision had precviously occurred (order independent).
| a | first object |
| b | second object |
Definition at line 55 of file Collision.h.
Here is the caller graph for this function:
|
inline |
Lets us know if a collision had precviously occurred (order independent).
| key | the combined pair of two worldobject*s |
Definition at line 62 of file Collision.h.
|
inlinestatic |
gives us our Collision helper singleton
Definition at line 43 of file Collision.h.
Here is the call graph for this function:
Here is the caller graph for this function:
|
inline |
returns list of collisions
| a | first object |
| b | second object |
Definition at line 83 of file Collision.h.
Here is the call graph for this function:
Here is the caller graph for this function:
|
inline |
Mark Collision as occurred.
Definition at line 67 of file Collision.h.
| vector< map< Point2D, vector< WorldObject* > > > Collision::Buckets |
Buckets into which items fall for collision (determined each loop)
Definition at line 34 of file Collision.h.
| unsigned int Collision::CellHeight |
The height of partition cells.
Definition at line 37 of file Collision.h.
| unsigned int Collision::CellWidth |
The width of partition cells.
Definition at line 36 of file Collision.h.
| vector< vector< WorldObject* > > Collision::CollisionLists |
Sets of collision lists to check detection.
Definition at line 33 of file Collision.h.
| map< pair< WorldObject*, WorldObject* >, vector< tuple< WorldObject*, CollisionObject*, WorldObject*, CollisionObject* > >* > Collision::Collisions |
Map that provides a cache of all collidied objects for a given object (clears each loop) Note:initial key is pair of two objects checking collision, values are world object and associated collision object.
Definition at line 35 of file Collision.h.
|
static |
instance of Collision helper
Definition at line 38 of file Collision.h.