2013-12-16 09:45:12 +01:00
|
|
|
|
|
|
|
#include "C_StaticObj.h"
|
|
|
|
#include "DllInterfaces/GFXAPI.h"
|
|
|
|
using namespace DanBias::Client;
|
|
|
|
|
|
|
|
struct C_StaticObj::myData
|
|
|
|
{
|
|
|
|
myData(){}
|
|
|
|
Oyster::Graphics::Model::Model *model;
|
2013-12-19 11:58:42 +01:00
|
|
|
int ID;
|
2013-12-16 09:45:12 +01:00
|
|
|
// light
|
|
|
|
// sound
|
|
|
|
// effect
|
|
|
|
}privData;
|
|
|
|
C_StaticObj::C_StaticObj(void)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
C_StaticObj::~C_StaticObj(void)
|
|
|
|
{
|
|
|
|
|
|
|
|
}
|
|
|
|
void C_StaticObj::Init(ModelInitData modelInit)
|
|
|
|
{
|
|
|
|
// load models
|
|
|
|
privData = new myData();
|
|
|
|
privData->model = Oyster::Graphics::API::CreateModel(modelInit.modelPath);
|
|
|
|
privData->model->WorldMatrix = modelInit.world;
|
|
|
|
privData->model->Visible = modelInit.visible;
|
2014-01-10 10:47:54 +01:00
|
|
|
privData->ID = modelInit.id;
|
2013-12-16 09:45:12 +01:00
|
|
|
|
|
|
|
}
|
2013-12-16 11:08:10 +01:00
|
|
|
void C_StaticObj::setPos(Oyster::Math::Float4x4 world)
|
2013-12-16 09:45:12 +01:00
|
|
|
{
|
2013-12-16 11:08:10 +01:00
|
|
|
privData->model->WorldMatrix = world;
|
2013-12-16 09:45:12 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
void C_StaticObj::Render()
|
|
|
|
{
|
2014-02-10 16:08:03 +01:00
|
|
|
Oyster::Graphics::API::RenderModel(privData->model);
|
2013-12-16 09:45:12 +01:00
|
|
|
}
|
|
|
|
void C_StaticObj::Release()
|
|
|
|
{
|
|
|
|
Oyster::Graphics::API::DeleteModel(privData->model);
|
|
|
|
delete privData;
|
2013-12-19 11:58:42 +01:00
|
|
|
}
|
|
|
|
int C_StaticObj::GetId()
|
|
|
|
{
|
|
|
|
return privData->ID;
|
2013-12-16 09:45:12 +01:00
|
|
|
}
|