2013-12-10 11:26:18 +01:00
|
|
|
#ifndef DANBIAS_CLIENT_COBJECT_H
|
|
|
|
#define DANBIAS_CLIENT_COBJECT_H
|
2013-12-09 12:01:36 +01:00
|
|
|
#include "DllInterfaces/GFXAPI.h"
|
2013-12-09 11:05:47 +01:00
|
|
|
namespace DanBias
|
|
|
|
{
|
|
|
|
namespace Client
|
|
|
|
{
|
2014-02-18 15:07:40 +01:00
|
|
|
// RB DEBUG
|
2014-02-18 13:31:36 +01:00
|
|
|
enum RB_Type
|
|
|
|
{
|
|
|
|
RB_Type_Cube,
|
2014-02-18 15:07:40 +01:00
|
|
|
RB_Type_Sphere,
|
|
|
|
RB_Type_None,
|
2014-02-18 13:31:36 +01:00
|
|
|
};
|
2014-02-18 15:07:40 +01:00
|
|
|
struct RBInitData
|
2013-12-09 12:01:36 +01:00
|
|
|
{
|
2014-02-10 14:00:14 +01:00
|
|
|
Oyster::Math::Float3 position;
|
|
|
|
Oyster::Math::Quaternion rotation;
|
|
|
|
Oyster::Math::Float3 scale;
|
2014-02-18 15:07:40 +01:00
|
|
|
RB_Type type;
|
2013-12-09 12:01:36 +01:00
|
|
|
};
|
2014-02-18 15:07:40 +01:00
|
|
|
// !RB DEBUG
|
|
|
|
|
|
|
|
struct ModelInitData
|
2014-02-18 13:31:36 +01:00
|
|
|
{
|
2014-02-18 15:07:40 +01:00
|
|
|
int id;
|
|
|
|
std::wstring modelPath;
|
2014-02-18 13:31:36 +01:00
|
|
|
Oyster::Math::Float3 position;
|
|
|
|
Oyster::Math::Quaternion rotation;
|
|
|
|
Oyster::Math::Float3 scale;
|
2014-02-18 15:07:40 +01:00
|
|
|
bool visible;
|
2014-02-18 13:31:36 +01:00
|
|
|
};
|
2013-12-09 12:01:36 +01:00
|
|
|
|
2014-02-17 11:27:43 +01:00
|
|
|
class C_Object
|
|
|
|
{
|
|
|
|
private:
|
|
|
|
Oyster::Math::Float4x4 world;
|
|
|
|
Oyster::Math::Float3 position;
|
|
|
|
Oyster::Math::Quaternion rotation;
|
|
|
|
Oyster::Math::Float3 scale;
|
2014-02-18 13:31:36 +01:00
|
|
|
|
|
|
|
// RB DEBUG
|
2014-02-20 11:34:29 +01:00
|
|
|
Oyster::Math::Float4x4 RBworld;
|
2014-02-18 13:31:36 +01:00
|
|
|
Oyster::Math::Float3 RBposition;
|
|
|
|
Oyster::Math::Quaternion RBrotation;
|
|
|
|
Oyster::Math::Float3 RBscale;
|
|
|
|
RB_Type type;
|
2014-02-18 15:07:40 +01:00
|
|
|
// !RB DEBUG
|
|
|
|
|
2014-02-17 11:27:43 +01:00
|
|
|
int id;
|
2014-02-18 13:31:36 +01:00
|
|
|
|
2014-02-17 11:27:43 +01:00
|
|
|
protected:
|
|
|
|
Oyster::Graphics::Model::Model *model;
|
|
|
|
public:
|
|
|
|
C_Object();
|
|
|
|
virtual ~C_Object();
|
|
|
|
virtual bool Init(ModelInitData modelInit);
|
2014-02-18 13:31:36 +01:00
|
|
|
void updateWorld();
|
|
|
|
//void setWorld(Oyster::Math::Float4x4 world);
|
2014-02-17 11:27:43 +01:00
|
|
|
Oyster::Math::Float4x4 getWorld() const;
|
|
|
|
void setPos(Oyster::Math::Float3 newPos);
|
|
|
|
Oyster::Math::Float3 getPos() const;
|
|
|
|
void addPos(Oyster::Math::Float3 deltaPos);
|
|
|
|
void setRot(Oyster::Math::Quaternion newRot);
|
|
|
|
Oyster::Math::Quaternion getRotation() const;
|
|
|
|
void setScale(Oyster::Math::Float3 newScale);
|
|
|
|
void addScale(Oyster::Math::Float3 deltaScale);
|
|
|
|
Oyster::Math::Float3 getScale() const;
|
|
|
|
|
2014-02-20 12:07:53 +01:00
|
|
|
Oyster::Math::Float3 GetTint();
|
|
|
|
Oyster::Math::Float3 GetGlowTint();
|
|
|
|
|
|
|
|
void SetTint(Oyster::Math::Float3);
|
|
|
|
void SetGlowTint(Oyster::Math::Float3);
|
2014-02-25 16:08:45 +01:00
|
|
|
void SetVisible(bool visible);
|
2014-02-20 12:07:53 +01:00
|
|
|
|
2014-02-18 13:31:36 +01:00
|
|
|
// RB DEBUG
|
2014-02-20 11:34:29 +01:00
|
|
|
void updateRBWorld();
|
2014-02-18 13:31:36 +01:00
|
|
|
bool InitRB(RBInitData modelInit);
|
|
|
|
Oyster::Math::Float4x4 getRBWorld() const;
|
|
|
|
void setRBPos(Oyster::Math::Float3 newPos);
|
|
|
|
Oyster::Math::Float3 getRBPos() const;
|
|
|
|
void setRBRot(Oyster::Math::Quaternion newRot);
|
|
|
|
Oyster::Math::Quaternion getRBRotation() const;
|
|
|
|
void setRBScale(Oyster::Math::Float3 newScale);
|
|
|
|
Oyster::Math::Float3 getRBScale() const;
|
|
|
|
RB_Type getBRtype()const;
|
2014-02-18 15:07:40 +01:00
|
|
|
// !RB DEBUG
|
|
|
|
|
2014-02-17 11:27:43 +01:00
|
|
|
virtual void Render();
|
|
|
|
virtual void Release();
|
|
|
|
virtual int GetId() const;
|
|
|
|
};
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
#include "Utilities.h"
|
|
|
|
|
|
|
|
namespace Utility { namespace DynamicMemory
|
|
|
|
{
|
|
|
|
template<>
|
|
|
|
inline void SafeDeleteInstance( ::DanBias::Client::C_Object *dynamicInstance )
|
|
|
|
{
|
|
|
|
if( dynamicInstance )
|
|
|
|
{
|
|
|
|
dynamicInstance->Release();
|
|
|
|
delete dynamicInstance;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} }
|
2013-12-09 11:05:47 +01:00
|
|
|
|
2013-12-10 11:26:18 +01:00
|
|
|
#endif
|