2021-01-13 10:42:57 -06:00
|
|
|
#ifndef MESH_H
|
|
|
|
#define MESH_H
|
|
|
|
|
2021-01-13 16:47:16 -06:00
|
|
|
#include <list>
|
|
|
|
|
2021-01-13 10:42:57 -06:00
|
|
|
#include "types.h"
|
2021-01-14 11:52:01 -06:00
|
|
|
#include "Spatial.h"
|
2021-01-13 10:42:57 -06:00
|
|
|
#include "Vertex.h"
|
|
|
|
#include "Index.h"
|
2021-01-18 13:31:09 -06:00
|
|
|
#include "Material.h"
|
2021-01-13 10:42:57 -06:00
|
|
|
|
2021-01-18 13:31:09 -06:00
|
|
|
class Mesh : public Spatial {
|
2021-01-13 10:42:57 -06:00
|
|
|
public:
|
|
|
|
VertexList vertices;
|
|
|
|
IndexList indices;
|
2021-01-18 13:31:09 -06:00
|
|
|
Material *material;
|
2021-01-13 10:42:57 -06:00
|
|
|
Mesh();
|
2021-01-17 14:36:38 -06:00
|
|
|
~Mesh();
|
2021-01-13 10:42:57 -06:00
|
|
|
Mesh(VertexList vertices, IndexList indices);
|
2021-01-18 13:31:09 -06:00
|
|
|
static Mesh FromFile(const char *filename);
|
|
|
|
virtual bool IsDrawable() const {return true;}
|
2021-01-14 11:52:01 -06:00
|
|
|
virtual void Draw();
|
2021-01-13 10:42:57 -06:00
|
|
|
virtual void SetupMesh();
|
|
|
|
private:
|
|
|
|
Id VAO, VBO, EBO;
|
|
|
|
};
|
|
|
|
|
2021-01-13 16:47:16 -06:00
|
|
|
typedef std::list<Mesh*> MeshList;
|
|
|
|
|
2021-01-13 10:42:57 -06:00
|
|
|
#endif /* MESH_H */
|