2013-01-19 20:02:34 +00:00
|
|
|
#ifndef NEW_MODEL_MANAGER_H_INCLUDED
|
|
|
|
#define NEW_MODEL_MANAGER_H_INCLUDED
|
|
|
|
|
|
|
|
#include "include/Utils/Utils.h"
|
|
|
|
#include "include/Render/RenderMisc.h"
|
|
|
|
#include "include/Render/RenderParams.h"
|
|
|
|
|
|
|
|
namespace SE
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
class TFlexModelManager;
|
|
|
|
|
|
|
|
class TFlexModelResource : public TSerializeInterface
|
|
|
|
{
|
|
|
|
protected:
|
|
|
|
TDataTriangleList DataTriangleList;
|
|
|
|
|
|
|
|
std::map<std::string, std::string> SamplerMap;
|
|
|
|
|
|
|
|
int TriangleCount;
|
|
|
|
public:
|
|
|
|
|
|
|
|
TFlexModelResource()
|
|
|
|
: TriangleCount(0)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
virtual void Serialize(boost::property_tree::ptree& propertyTree);
|
|
|
|
|
|
|
|
friend class TFlexModelManager;
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
class TFlexModel
|
|
|
|
{
|
|
|
|
protected:
|
|
|
|
TRenderPair RenderPair;
|
|
|
|
|
|
|
|
std::stack<TDataTriangleList> DataTriangleListStack;
|
|
|
|
|
|
|
|
bool Loaded;
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
|
|
|
void PushModelDataTriangleList();
|
|
|
|
void PopModelDataTriangleList();
|
|
|
|
|
|
|
|
void MoveModel(const vec3& v);
|
|
|
|
void RotateModel(const mat3& r);
|
|
|
|
void ScaleModel(float s);
|
|
|
|
void ScaleModel(const vec3& s);
|
|
|
|
|
|
|
|
void RefreshBuffer();
|
|
|
|
|
|
|
|
void Draw();
|
|
|
|
|
2013-01-23 20:58:15 +00:00
|
|
|
TDataTriangleList& GetDataTriangleList();
|
|
|
|
|
2013-01-19 20:02:34 +00:00
|
|
|
friend class TFlexModelManager;
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
class TFlexModelManager
|
|
|
|
{
|
|
|
|
protected:
|
|
|
|
|
|
|
|
std::map<std::string, TFlexModelResource> FlexModelResourceMap;
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
|
|
|
void LoadModelFromXml(std::string xmlFileName);
|
|
|
|
|
|
|
|
TFlexModel InstanciateModel(const std::string& modelName);
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
} //namespace SE
|
|
|
|
|
|
|
|
#endif
|