Danbias/Code/Game/GameLogic/Object.cpp

56 lines
958 B
C++
Raw Normal View History

2013-11-19 18:35:35 +01:00
#include "Object.h"
2013-11-21 12:05:39 +01:00
#include "OysterMath.h"
#include "CollisionManager.h"
2013-11-21 12:05:39 +01:00
2013-11-19 18:35:35 +01:00
using namespace GameLogic;
2013-11-21 12:05:39 +01:00
using namespace Oyster::Math;
using namespace Oyster::Physics;
2013-11-19 18:35:35 +01:00
Object::Object()
{
2013-11-29 09:23:00 +01:00
API::SimpleBodyDescription sbDesc;
//sbDesc.centerPosition =
//poi
2013-11-29 09:23:00 +01:00
ICustomBody* temp = rigidBody = API::Instance().CreateRigidBody(sbDesc).Release();
rigidBody->gameObjectRef = this;
2013-11-21 12:05:39 +01:00
this->type = OBJECT_TYPE_UNKNOWN;
2013-11-19 18:35:35 +01:00
}
2013-11-19 18:35:35 +01:00
Object::Object(void* collisionFunc, OBJECT_TYPE type)
2013-11-19 18:35:35 +01:00
{
API::SimpleBodyDescription sbDesc;
//sbDesc.centerPosition =
//poi
ICustomBody* temp = rigidBody = API::Instance().CreateRigidBody(sbDesc).Release();
rigidBody->SetSubscription((Oyster::Physics::ICustomBody::EventAction_Collision)(collisionFunc));
rigidBody->gameObjectRef = this;
2013-11-28 08:33:29 +01:00
this->type = type;
2013-11-21 12:05:39 +01:00
}
2013-11-28 08:33:29 +01:00
Object::~Object(void)
{
2013-11-19 18:35:35 +01:00
}
2013-11-26 11:30:49 +01:00
OBJECT_TYPE Object::GetType()
2013-11-26 11:30:49 +01:00
{
return this->type;
}
Oyster::Physics::ICustomBody* Object::GetRigidBody()
{
return this->rigidBody;
}