2013-11-19 18:35:35 +01:00
|
|
|
#include "Object.h"
|
2013-11-21 12:05:39 +01:00
|
|
|
#include "OysterMath.h"
|
2013-11-28 08:33:29 +01:00
|
|
|
#include "DllInterfaces\GFXAPI.h"
|
2013-11-28 09:26:29 +01:00
|
|
|
#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;
|
2013-11-27 16:17:47 +01:00
|
|
|
using namespace Oyster::Graphics::Model;
|
2013-11-21 12:05:39 +01:00
|
|
|
|
|
|
|
using namespace Utility::DynamicMemory;
|
2013-11-28 11:23:11 +01:00
|
|
|
using namespace Oyster::Physics;
|
2013-11-19 18:35:35 +01:00
|
|
|
|
2013-12-03 11:47:04 +01:00
|
|
|
Object::Object(std::wstring objFile)
|
2013-11-19 18:35:35 +01:00
|
|
|
{
|
2013-11-21 12:05:39 +01:00
|
|
|
|
2013-12-03 11:47:04 +01:00
|
|
|
//model = new Model();
|
|
|
|
model = Oyster::Graphics::API::CreateModel(objFile);
|
2013-12-04 11:32:43 +01:00
|
|
|
|
2013-11-29 09:23:00 +01:00
|
|
|
API::SimpleBodyDescription sbDesc;
|
|
|
|
//sbDesc.centerPosition =
|
|
|
|
|
2013-12-03 11:47:04 +01:00
|
|
|
//poi
|
2013-11-29 09:23:00 +01:00
|
|
|
ICustomBody* temp = rigidBody = API::Instance().CreateRigidBody(sbDesc).Release();
|
2013-11-28 11:23:11 +01:00
|
|
|
|
|
|
|
GameLogic::RefManager::getInstance()->AddMapping(*rigidBody, *this);
|
2013-11-21 12:05:39 +01:00
|
|
|
|
2013-11-19 18:35:35 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
Object::~Object(void)
|
|
|
|
{
|
2013-11-28 08:37:56 +01:00
|
|
|
|
2013-11-28 09:26:29 +01:00
|
|
|
Oyster::Graphics::API::DeleteModel(model);
|
2013-11-28 08:33:29 +01:00
|
|
|
|
2013-11-21 12:05:39 +01:00
|
|
|
}
|
2013-11-28 08:33:29 +01:00
|
|
|
|
2013-11-28 11:23:11 +01:00
|
|
|
void Object::Render()
|
|
|
|
{
|
2013-11-27 16:17:47 +01:00
|
|
|
this->rigidBody->GetOrientation(model->WorldMatrix);
|
2013-11-28 11:23:11 +01:00
|
|
|
Oyster::Graphics::API::RenderScene(model, 1);
|
2013-11-19 18:35:35 +01:00
|
|
|
}
|
2013-11-26 11:30:49 +01:00
|
|
|
|
|
|
|
Object::OBJECT_TYPE Object::GetType()
|
|
|
|
{
|
|
|
|
return this->type;
|
|
|
|
}
|