2013-11-26 09:19:59 +01:00
|
|
|
#include "CollisionManager.h"
|
|
|
|
|
2013-12-03 11:47:04 +01:00
|
|
|
using namespace Oyster;
|
2013-11-26 09:19:59 +01:00
|
|
|
|
2013-11-28 09:26:29 +01:00
|
|
|
namespace GameLogic
|
2013-11-26 09:19:59 +01:00
|
|
|
{
|
2013-11-28 09:26:29 +01:00
|
|
|
|
|
|
|
namespace CollisionManager
|
2013-11-26 11:30:49 +01:00
|
|
|
{
|
2013-11-28 11:23:11 +01:00
|
|
|
|
2013-12-03 11:47:04 +01:00
|
|
|
Physics::ICustomBody::SubscriptMessage PlayerCollision(const Oyster::Physics::ICustomBody *rigidBodyPlayer, const Oyster::Physics::ICustomBody *obj)
|
2013-11-28 11:23:11 +01:00
|
|
|
{
|
2013-12-03 11:47:04 +01:00
|
|
|
Player *player = ((Player*)GameLogic::RefManager::getInstance()->GetMap(*rigidBodyPlayer));
|
|
|
|
Object *realObj = GameLogic::RefManager::getInstance()->GetMap(*obj);
|
2013-11-28 11:23:11 +01:00
|
|
|
|
|
|
|
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
|
2013-12-03 11:47:04 +01:00
|
|
|
return Physics::ICustomBody::SubscriptMessage_none;
|
2013-11-28 11:23:11 +01:00
|
|
|
}
|
|
|
|
|
2013-11-28 09:26:29 +01:00
|
|
|
void PlayerVBox(Player &player, DynamicObject &box)
|
|
|
|
{
|
|
|
|
//spela ljud? ta skada? etc etc
|
|
|
|
}
|
2013-11-28 11:23:11 +01:00
|
|
|
|
2013-12-03 11:47:04 +01:00
|
|
|
Physics::ICustomBody::SubscriptMessage BoxCollision(const Oyster::Physics::ICustomBody *rigidBodyBox, const Oyster::Physics::ICustomBody *obj)
|
2013-11-28 11:23:11 +01:00
|
|
|
{
|
2013-12-03 11:47:04 +01:00
|
|
|
DynamicObject *box = ((DynamicObject*)GameLogic::RefManager::getInstance()->GetMap(*rigidBodyBox));
|
|
|
|
Object *realObj = GameLogic::RefManager::getInstance()->GetMap(*obj);
|
2013-11-28 11:23:11 +01:00
|
|
|
|
|
|
|
switch (realObj->GetType())
|
|
|
|
{
|
|
|
|
case Object::OBJECT_TYPE_BOX:
|
|
|
|
|
|
|
|
break;
|
|
|
|
case Object::OBJECT_TYPE_PLAYER:
|
|
|
|
PlayerVBox(*(Player*)realObj,*box);
|
|
|
|
break;
|
|
|
|
}
|
2013-12-03 11:47:04 +01:00
|
|
|
|
|
|
|
return Physics::ICustomBody::SubscriptMessage_none;
|
2013-11-28 11:23:11 +01:00
|
|
|
}
|
2013-11-28 09:26:29 +01:00
|
|
|
}
|
2013-11-26 11:30:49 +01:00
|
|
|
}
|