diff --git a/Code/GameLogic/CollisionManager.cpp b/Code/GameLogic/CollisionManager.cpp new file mode 100644 index 00000000..35b497d1 --- /dev/null +++ b/Code/GameLogic/CollisionManager.cpp @@ -0,0 +1,12 @@ +#include "CollisionManager.h" + +using namespace GameLogic; + +CollisionManager::CollisionManager(void) +{ +} + + +CollisionManager::~CollisionManager(void) +{ +} diff --git a/Code/GameLogic/CollisionManager.h b/Code/GameLogic/CollisionManager.h new file mode 100644 index 00000000..f4418b3d --- /dev/null +++ b/Code/GameLogic/CollisionManager.h @@ -0,0 +1,30 @@ +#ifndef COLLISIONMANAGER_H +#define COLLISIONMANAGER_H + +#include "Object.h" +#include "PhysicsAPI.h" +#include "RefManager.h" +#include "DynamicObject.h" +#include "Player.h" + +namespace GameLogic +{ + + class CollisionManager + { + + public: + CollisionManager(void); + ~CollisionManager(void); + + void ColisionEvent(Oyster::Physics::ICustomBody &obj1, Oyster::Physics::ICustomBody &obj2); + void PlayerVBox(Player &player, DynamicObject &box); + + private: + + + }; + +} + +#endif \ No newline at end of file diff --git a/Code/GameLogic/Game.h b/Code/GameLogic/Game.h index 0b452b30..2d808388 100644 --- a/Code/GameLogic/Game.h +++ b/Code/GameLogic/Game.h @@ -8,21 +8,21 @@ namespace GameLogic { class Game { - private: + public: + Game(); + ~Game(); + + void Init(); + void StartGame(); + void Update(); + void Render(); private: Level* level; Player* player; - public: - Game(); - ~Game(); - void Init(); - void StartGame(); - void Update(); - void Render(); }; } #endif \ No newline at end of file diff --git a/Code/GameLogic/Object.h b/Code/GameLogic/Object.h index a3c9fa2e..193be4db 100644 --- a/Code/GameLogic/Object.h +++ b/Code/GameLogic/Object.h @@ -17,7 +17,7 @@ namespace GameLogic Object(void); virtual ~Object(void); - Utility::DynamicMemory::UniquePointer model; + void Render(); private: @@ -25,9 +25,9 @@ namespace GameLogic protected: //either a model pointer or an ID to an arraypos filled with models that are to be rendered //rigidBody - unsigned int ref; - ::Utility::DynamicMemory::UniquePointer rigidBody; + Utility::DynamicMemory::UniquePointer rigidBody; + Utility::DynamicMemory::UniquePointer model; }; } diff --git a/Code/GameLogic/Player.cpp b/Code/GameLogic/Player.cpp index 67cbf52e..bc83ba25 100644 --- a/Code/GameLogic/Player.cpp +++ b/Code/GameLogic/Player.cpp @@ -46,7 +46,9 @@ Player::Player(void) { life = 10; - UniquePointer rigidBody = API::Instance().CreateSimpleRigidBody(); + rigidBody = API::Instance().CreateSimpleRigidBody(); + + //ref = API::Instance().AddObject(rigidBody); ////ref = API::Instance().AddObject(API::Instance().CreateSimpleRigidBody()); //const ICustomBody* rB; diff --git a/Code/GameLogic/RefManager.cpp b/Code/GameLogic/RefManager.cpp index 852cb6b1..022ec6bb 100644 --- a/Code/GameLogic/RefManager.cpp +++ b/Code/GameLogic/RefManager.cpp @@ -13,14 +13,14 @@ RefManager::~RefManager(void) { } -Object* RefManager::GetMap(Oyster::Physics::ICustomBody *body) +Object* RefManager::GetMap(Oyster::Physics::ICustomBody &body) { - return mapper[body]; + return mapper[&body]; } -void RefManager::AddMapping(Oyster::Physics::ICustomBody *body, Object *obj) +void RefManager::AddMapping(Oyster::Physics::ICustomBody &body, Object &obj) { - mapper.insert(mapData(body,obj)); + mapper.insert(mapData(&body,&obj)); } diff --git a/Code/GameLogic/RefManager.h b/Code/GameLogic/RefManager.h index 1d49af78..2e1e9498 100644 --- a/Code/GameLogic/RefManager.h +++ b/Code/GameLogic/RefManager.h @@ -16,8 +16,8 @@ namespace GameLogic RefManager(void); ~RefManager(void); - Object* GetMap(Oyster::Physics::ICustomBody *body); - void AddMapping(Oyster::Physics::ICustomBody *body, Object *obj); + Object* GetMap(Oyster::Physics::ICustomBody &body); + void AddMapping(Oyster::Physics::ICustomBody &body, Object &obj); private: