mirror of
https://github.com/AxioDL/PrimeWorldEditor.git
synced 2025-12-18 17:35:43 +00:00
Initial commit of current work on Prime World Editor
This commit is contained in:
39
Resource/model/CStaticModel.h
Normal file
39
Resource/model/CStaticModel.h
Normal file
@@ -0,0 +1,39 @@
|
||||
#ifndef CSTATICMODEL_H
|
||||
#define CSTATICMODEL_H
|
||||
|
||||
#include "CBasicModel.h"
|
||||
#include <Core/ERenderOptions.h>
|
||||
#include <OpenGL/CIndexBuffer.h>
|
||||
|
||||
// A CStaticModel is meant for meshes that don't move. It's built specifically with terrain in mind.
|
||||
// It only links to one material, and what it does best is combining submeshes from different models
|
||||
// into shared VBOs and IBOs. This allows for a significantly reduced number of draw calls.
|
||||
|
||||
class CStaticModel : public CBasicModel
|
||||
{
|
||||
CMaterial *mpMaterial;
|
||||
std::vector<CIndexBuffer> mIBOs;
|
||||
std::vector<std::vector<u32>> mSubmeshEndOffsets;
|
||||
bool mTransparent;
|
||||
|
||||
public:
|
||||
CStaticModel();
|
||||
CStaticModel(CMaterial *pMat);
|
||||
~CStaticModel();
|
||||
void AddSurface(SSurface *pSurface);
|
||||
|
||||
void BufferGL();
|
||||
void ClearGLBuffer();
|
||||
void Draw(ERenderOptions Options);
|
||||
void DrawSurface(ERenderOptions Options, u32 Surface);
|
||||
|
||||
CMaterial* GetMaterial();
|
||||
void SetMaterial(CMaterial *pMat);
|
||||
bool IsTransparent();
|
||||
bool IsOccluder();
|
||||
|
||||
private:
|
||||
CIndexBuffer* InternalGetIBO(EGXPrimitiveType Primitive);
|
||||
};
|
||||
|
||||
#endif // CSTATICMODEL_H
|
||||
Reference in New Issue
Block a user