couch/core/Mesh.h

38 lines
731 B
C
Raw Normal View History

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-18 18:25:47 -06:00
// Thirdpart includes
#include <assimp/Importer.hpp>
#include <assimp/scene.h>
#include <assimp/postprocess.h>
2021-01-13 16:47:16 -06:00
2021-01-13 10:42:57 -06:00
#include "types.h"
2021-01-18 18:25:47 -06:00
#include "Util.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"
#include "Material.h"
2021-01-13 10:42:57 -06:00
class Mesh : public Spatial {
2021-01-13 10:42:57 -06:00
public:
VertexList vertices;
IndexList indices;
Material *material;
2021-01-13 10:42:57 -06:00
Mesh();
~Mesh();
2021-01-13 10:42:57 -06:00
Mesh(VertexList vertices, IndexList indices);
2021-01-18 18:25:47 -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-19 16:36:10 -06:00
static Mesh *aiMesh2Mesh(aiMesh *mesh);
2021-01-13 10:42:57 -06:00
};
2021-01-13 16:47:16 -06:00
typedef std::list<Mesh*> MeshList;
2021-01-13 10:42:57 -06:00
#endif /* MESH_H */