Danbias/Code/GameLogic/CollisionManager.cpp

50 lines
1.1 KiB
C++
Raw Normal View History

#include "CollisionManager.h"
namespace GameLogic
{
namespace CollisionManager
2013-11-26 11:30:49 +01:00
{
void PlayerCollision(Oyster::Physics::ICustomBody &rigidBodyPlayer,Oyster::Physics::ICustomBody &obj)
{
Player *player = ((Player*)GameLogic::RefManager::getInstance()->GetMap(rigidBodyPlayer));
Object *realObj = GameLogic::RefManager::getInstance()->GetMap(obj);
switch (realObj->GetType())
{
case Object::OBJECT_TYPE_BOX:
PlayerVBox(*player,(*(DynamicObject*) realObj));
break;
case Object::OBJECT_TYPE_PLAYER:
break;
}
//spela ljud? ta skada? etc etc
}
void PlayerVBox(Player &player, DynamicObject &box)
{
//spela ljud? ta skada? etc etc
}
void BoxCollision(Oyster::Physics::ICustomBody &rigidBodyBox, Oyster::Physics::ICustomBody &obj)
{
DynamicObject *box = ((DynamicObject*)GameLogic::RefManager::getInstance()->GetMap(rigidBodyBox));
Object *realObj = GameLogic::RefManager::getInstance()->GetMap(obj);
switch (realObj->GetType())
{
case Object::OBJECT_TYPE_BOX:
break;
case Object::OBJECT_TYPE_PLAYER:
PlayerVBox(*(Player*)realObj,*box);
break;
}
}
}
2013-11-26 11:30:49 +01:00
}