21 #ifndef CCOLLISION_DETECTOR_H
22 #define CCOLLISION_DETECTOR_H
28 #include "../CD_LIB/CDGrid.h"
30 namespace OpenSkyNet {
36 bool _doCalculate,
_isInGrid, _doSweepTests, _doAllowPostUpdateCollisions;
42 _doCalculate(false), _isInGrid(false), _doSweepTests(false), _doAllowPostUpdateCollisions(false),
43 _secsLeftToCalc(0.f), _numCollisions(0) {}
54 inline bool doCollide(
Object* collidee_,
Object* collider_);
58 virtual bool removeObject(
Object* obj_);
61 _grid(32,32,32,0), _maxCollisionsPerVolume(3) {
69 virtual bool update(
float dt_);
71 virtual bool setPriority(
Object* obj_, OBJECT_PRIORITY prio_);
75 virtual bool enableSweepTests(
Object* obj_);
76 virtual bool disableSweepTests(
Object* obj_);
78 virtual bool allowPostUpdateCollisions(
Object* obj_);
79 virtual bool disallowPostUpdateCollisions(
Object* obj_);
83 virtual void setCDGrid(
const Math::Point<>* corners_, std::set<CD::Volume*>& obstacles_);
96 #endif //CCOLLISION_DETECTOR_H
const CD::Grid * getGrid() const
Definition: CCollisionDetector.h:85
Definition: CDVolume.h:36
std::map< const Math::Point< int > *, BinOccupiersList > BinOccupiersMap
Definition: CDGrid.h:143
Grid * g_initialGrid
Definition: CDGrid.cpp:18
CD::Grid::BinOccupiersMap _nonCollidingOccupiers
Definition: CCollisionDetector.h:51
float _secsLeftToCalc
Definition: CCollisionDetector.h:37
Definition: CUpdater.h:49
std::map< CD::Volume *, OccupiedBinsList > OccupiedBinsMap
Definition: CDGrid.h:144
Definition: CCollisionDetector.h:35
ColInfo(Updater::OBJECT_PRIORITY prio_=Updater::OBJ_DISABLED, bool isOneShot_=false)
Definition: CCollisionDetector.h:41
Utils::uint _maxCollisionsPerVolume
Definition: CCollisionDetector.h:48
void unregisterCollisionListener(CollisionListener *listener_)
Definition: CCollisionDetector.h:88
Definition: CUpdater.h:40
static void shutDown()
Definition: CDGrid.cpp:85
std::set< Object * > _prevColliders
Definition: CCollisionDetector.h:39
virtual ~CollisionDetector()
Definition: CCollisionDetector.h:67
static void init(Utils::uint initGlobalXDivs_, Utils::uint initGlobalYDivs_, Utils::uint initGlobalZDivs_, Utils::uint maxGlobalSubdivs_)
Definition: CDGrid.cpp:70
unsigned int uint
Definition: UTypes.h:39
Definition: CCollisionDetector.h:33
OBJECT_PRIORITY
Definition: CUpdater.h:49
#define CORE_DLL
Definition: CCoreDLL.h:57
Utils::uint _numCollisions
Definition: CCollisionDetector.h:38
CD::Grid _grid
Definition: CCollisionDetector.h:46
CD::Grid::OccupiedBinsMap _nonCollidingOccupiedBins
Definition: CCollisionDetector.h:52
Definition: ICollisionListener.h:34
std::list< CollisionListener * > _registeredListeners
Definition: CCollisionDetector.h:47
bool _isInGrid
Definition: CCollisionDetector.h:36
Definition: CUpdater.h:54
void registerCollisionListener(CollisionListener *listener_)
Definition: CCollisionDetector.h:87
CollisionDetector()
Definition: CCollisionDetector.h:60