added collisionManager
also some changes around the place
This commit is contained in:
parent
220f1da8b6
commit
2859588d20
|
@ -0,0 +1,12 @@
|
||||||
|
#include "CollisionManager.h"
|
||||||
|
|
||||||
|
using namespace GameLogic;
|
||||||
|
|
||||||
|
CollisionManager::CollisionManager(void)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
CollisionManager::~CollisionManager(void)
|
||||||
|
{
|
||||||
|
}
|
|
@ -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
|
|
@ -8,13 +8,6 @@ namespace GameLogic
|
||||||
{
|
{
|
||||||
class Game
|
class Game
|
||||||
{
|
{
|
||||||
private:
|
|
||||||
|
|
||||||
|
|
||||||
private:
|
|
||||||
Level* level;
|
|
||||||
Player* player;
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
Game();
|
Game();
|
||||||
~Game();
|
~Game();
|
||||||
|
@ -23,6 +16,13 @@ namespace GameLogic
|
||||||
void StartGame();
|
void StartGame();
|
||||||
void Update();
|
void Update();
|
||||||
void Render();
|
void Render();
|
||||||
|
|
||||||
|
|
||||||
|
private:
|
||||||
|
Level* level;
|
||||||
|
Player* player;
|
||||||
|
|
||||||
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
|
@ -17,7 +17,7 @@ namespace GameLogic
|
||||||
Object(void);
|
Object(void);
|
||||||
virtual ~Object(void);
|
virtual ~Object(void);
|
||||||
|
|
||||||
Utility::DynamicMemory::UniquePointer<Oyster::Graphics::Render::Model> model;
|
|
||||||
void Render();
|
void Render();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
@ -25,9 +25,9 @@ namespace GameLogic
|
||||||
protected:
|
protected:
|
||||||
//either a model pointer or an ID to an arraypos filled with models that are to be rendered
|
//either a model pointer or an ID to an arraypos filled with models that are to be rendered
|
||||||
//rigidBody
|
//rigidBody
|
||||||
unsigned int ref;
|
|
||||||
::Utility::DynamicMemory::UniquePointer<Oyster::Physics::ICustomBody> rigidBody;
|
|
||||||
|
|
||||||
|
Utility::DynamicMemory::UniquePointer<Oyster::Physics::ICustomBody> rigidBody;
|
||||||
|
Utility::DynamicMemory::UniquePointer<Oyster::Graphics::Render::Model> model;
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -46,7 +46,9 @@ Player::Player(void)
|
||||||
{
|
{
|
||||||
life = 10;
|
life = 10;
|
||||||
|
|
||||||
UniquePointer<ICustomBody> rigidBody = API::Instance().CreateSimpleRigidBody();
|
rigidBody = API::Instance().CreateSimpleRigidBody();
|
||||||
|
|
||||||
|
|
||||||
//ref = API::Instance().AddObject(rigidBody);
|
//ref = API::Instance().AddObject(rigidBody);
|
||||||
////ref = API::Instance().AddObject(API::Instance().CreateSimpleRigidBody());
|
////ref = API::Instance().AddObject(API::Instance().CreateSimpleRigidBody());
|
||||||
//const ICustomBody* rB;
|
//const ICustomBody* rB;
|
||||||
|
|
|
@ -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));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -16,8 +16,8 @@ namespace GameLogic
|
||||||
RefManager(void);
|
RefManager(void);
|
||||||
~RefManager(void);
|
~RefManager(void);
|
||||||
|
|
||||||
Object* GetMap(Oyster::Physics::ICustomBody *body);
|
Object* GetMap(Oyster::Physics::ICustomBody &body);
|
||||||
void AddMapping(Oyster::Physics::ICustomBody *body, Object *obj);
|
void AddMapping(Oyster::Physics::ICustomBody &body, Object &obj);
|
||||||
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
Loading…
Reference in New Issue