Fixes
This commit is contained in:
48
src/render/model.h
Normal file
48
src/render/model.h
Normal file
@@ -0,0 +1,48 @@
|
||||
#ifndef MODEL_H
|
||||
#define MODEL_H
|
||||
|
||||
#include <vector>
|
||||
|
||||
#include "boundingbox.h"
|
||||
#include "render_shared.h"
|
||||
|
||||
#include <glm/glm.hpp>
|
||||
#include <glm/gtc/type_ptr.hpp>
|
||||
|
||||
class GPUBuffer;
|
||||
class Texture2D;
|
||||
|
||||
struct ModelData_t
|
||||
{
|
||||
GPUBuffer* vb;
|
||||
GPUBuffer* ib;
|
||||
uint32_t vbcount;
|
||||
uint32_t ibcount;
|
||||
};
|
||||
|
||||
void ReleaseModelData(ModelData_t& data);
|
||||
|
||||
class Render;
|
||||
|
||||
class Model
|
||||
{
|
||||
friend class Render;
|
||||
public:
|
||||
Model();
|
||||
~Model();
|
||||
|
||||
void LoadObj(const char* filename);
|
||||
void LoadMtl(const char* filename);
|
||||
|
||||
void Draw(const glm::mat4& model, bool isTransparent = false);
|
||||
|
||||
const BoundingBox& GetBoundingBox() { return m_boundingBox; }
|
||||
|
||||
private:
|
||||
std::vector<StaticMeshVertex> m_Vertices;
|
||||
ModelData_t m_data;
|
||||
BoundingBox m_boundingBox;
|
||||
Texture2D* m_AlbedoTexture;
|
||||
};
|
||||
|
||||
#endif // !MODEL_H
|
||||
Reference in New Issue
Block a user