2013-11-26 09:19:59 +01:00
|
|
|
#include "CollisionManager.h"
|
2013-12-12 09:36:14 +01:00
|
|
|
#include "PhysicsAPI.h"
|
|
|
|
#include "Object.h"
|
|
|
|
#include "DynamicObject.h"
|
|
|
|
#include "Player.h"
|
2013-11-26 09:19:59 +01:00
|
|
|
|
2013-12-03 11:47:04 +01:00
|
|
|
using namespace Oyster;
|
2013-11-26 09:19:59 +01:00
|
|
|
|
2013-12-19 10:21:03 +01:00
|
|
|
using namespace GameLogic;
|
2013-11-28 09:26:29 +01:00
|
|
|
|
2013-12-19 10:21:03 +01:00
|
|
|
void PlayerVBox(Player &player, DynamicObject &box);
|
2013-11-28 11:23:11 +01:00
|
|
|
|
2013-12-12 12:16:13 +01:00
|
|
|
|
2013-12-19 10:21:03 +01:00
|
|
|
Physics::ICustomBody::SubscriptMessage CollisionManager::PlayerCollision(const Oyster::Physics::ICustomBody *rigidBodyPlayer, const Oyster::Physics::ICustomBody *obj)
|
|
|
|
{
|
2013-12-21 17:37:30 +01:00
|
|
|
//Player *player = ((Player*)(rigidBodyPlayer->gameObjectRef));
|
|
|
|
//Object *realObj = (Object*)obj->gameObjectRef;
|
|
|
|
|
|
|
|
//switch (realObj->GetType())
|
|
|
|
//{
|
|
|
|
//case OBJECT_TYPE::OBJECT_TYPE_BOX:
|
|
|
|
// PlayerVBox(*player,(*(DynamicObject*) realObj));
|
|
|
|
// break;
|
|
|
|
//case OBJECT_TYPE::OBJECT_TYPE_PLAYER:
|
|
|
|
//
|
|
|
|
// break;
|
|
|
|
//}
|
2013-12-19 10:21:03 +01:00
|
|
|
|
|
|
|
return Physics::ICustomBody::SubscriptMessage_none;
|
|
|
|
}
|
2013-11-28 11:23:11 +01:00
|
|
|
|
2013-12-19 10:21:03 +01:00
|
|
|
void PlayerVBox(Player &player, DynamicObject &box)
|
|
|
|
{
|
|
|
|
player.DamageLife(20);
|
|
|
|
}
|
2013-11-28 11:23:11 +01:00
|
|
|
|
2013-12-19 10:21:03 +01:00
|
|
|
Physics::ICustomBody::SubscriptMessage CollisionManager::BoxCollision(const Oyster::Physics::ICustomBody *rigidBodyBox, const Oyster::Physics::ICustomBody *obj)
|
|
|
|
{
|
|
|
|
if(rigidBodyBox == 0)
|
2013-11-28 11:23:11 +01:00
|
|
|
{
|
2013-12-19 10:21:03 +01:00
|
|
|
return Physics::ICustomBody::SubscriptMessage::SubscriptMessage_none;
|
|
|
|
}
|
2013-12-21 17:37:30 +01:00
|
|
|
//DynamicObject *box = (DynamicObject*)rigidBodyBox->gameObjectRef;
|
|
|
|
//Object *realObj = (Object*)obj->gameObjectRef;
|
|
|
|
|
|
|
|
//switch (realObj->GetType())
|
|
|
|
//{
|
|
|
|
//case OBJECT_TYPE::OBJECT_TYPE_BOX:
|
|
|
|
//
|
|
|
|
// break;
|
|
|
|
//case OBJECT_TYPE::OBJECT_TYPE_PLAYER:
|
|
|
|
// //PlayerVBox(*(Player*)realObj,*box);
|
|
|
|
// break;
|
|
|
|
//}
|
2013-12-19 10:21:03 +01:00
|
|
|
|
|
|
|
return Physics::ICustomBody::SubscriptMessage_none;
|
2013-11-28 09:26:29 +01:00
|
|
|
}
|