00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011 #ifndef COLLISIONMANAGER_H
00012 #define COLLISIONMANAGER_H
00013
00014 #include "GameConstants.h"
00015 #include <cmath>
00016 #include "PhysicsObject.h"
00017 #include "RectangleCollider.h"
00018
00024 class CollisionManager
00025 {
00026 public:
00031 static CollisionManager* Instance();
00032
00036 static void DestroyInstance();
00037
00045 bool CheckCollision(PhysicsObject *discPhysics,
00046 PhysicsObject *colliderPhysics,
00047 double deltaTime);
00048
00056 bool CheckCollision(PhysicsObject *discPhysics,
00057 RectangleCollider *colliderPhysics,
00058 double deltaTime);
00059
00070 bool CheckCollision(float x1,
00071 float y1,
00072 float x2,
00073 float y2,
00074 float radius1,
00075 float radius2);
00076
00087 bool CheckButtonCollision(float x1,
00088 float y1,
00089 float x2,
00090 float y2,
00091 int width,
00092 int height);
00093
00100 void SolveCollision(PhysicsObject *discPhysics,
00101 PhysicsObject *colliderPhysics);
00102
00109 void SolveCollision(PhysicsObject *discPhysics,
00110 RectangleCollider *colliderPhysics,
00111 bool hasCleared);
00112 protected:
00116 CollisionManager();
00117
00121 ~CollisionManager();
00122
00124 static CollisionManager *m_instance;
00125
00127 float m_colliderImpulse;
00128 };
00129
00130 #endif