2015-07-26 21:39:49 +00:00
|
|
|
#ifndef CMODEL_H
|
|
|
|
#define CMODEL_H
|
|
|
|
|
|
|
|
#include "CBasicModel.h"
|
|
|
|
#include "SSurface.h"
|
|
|
|
#include "../CMaterialSet.h"
|
|
|
|
|
|
|
|
#include <Core/ERenderOptions.h>
|
|
|
|
#include <OpenGL/CIndexBuffer.h>
|
|
|
|
#include <OpenGL/GLCommon.h>
|
|
|
|
|
|
|
|
class CModel : public CBasicModel
|
|
|
|
{
|
|
|
|
friend class CModelLoader;
|
|
|
|
friend class CModelCooker;
|
|
|
|
|
|
|
|
std::vector<CMaterialSet*> mMaterialSets;
|
|
|
|
std::vector<std::vector<CIndexBuffer>> mSubmeshIndexBuffers;
|
|
|
|
bool mHasOwnMaterials;
|
|
|
|
|
|
|
|
public:
|
|
|
|
CModel();
|
2015-08-10 13:47:00 +00:00
|
|
|
CModel(CMaterialSet *pSet, bool ownsMatSet);
|
2015-07-26 21:39:49 +00:00
|
|
|
~CModel();
|
|
|
|
|
|
|
|
void BufferGL();
|
|
|
|
void ClearGLBuffer();
|
|
|
|
void Draw(ERenderOptions Options, u32 MatSet);
|
|
|
|
void DrawSurface(ERenderOptions Options, u32 Surface, u32 MatSet);
|
2015-11-24 15:42:01 +00:00
|
|
|
void DrawWireframe(ERenderOptions Options, const CColor& WireColor = CColor::skWhite);
|
2015-07-26 21:39:49 +00:00
|
|
|
|
|
|
|
u32 GetMatSetCount();
|
|
|
|
u32 GetMatCount();
|
|
|
|
CMaterialSet* GetMatSet(u32 MatSet);
|
|
|
|
CMaterial* GetMaterialByIndex(u32 MatSet, u32 Index);
|
|
|
|
CMaterial* GetMaterialBySurface(u32 MatSet, u32 Surface);
|
|
|
|
bool HasTransparency(u32 MatSet);
|
|
|
|
bool IsSurfaceTransparent(u32 Surface, u32 MatSet);
|
|
|
|
|
|
|
|
private:
|
|
|
|
CIndexBuffer* InternalGetIBO(u32 Surface, EGXPrimitiveType Primitive);
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif // MODEL_H
|