12345678910111213141516171819202122232425262728293031323334353637 |
- #ifndef MESH_H
- #define MESH_H
- #include "math/Vector.h"
- #include "rendering/VertexBuffer.h"
- #include "utils/TypedBuffer.h"
- class Mesh final {
- VertexBuffer vertexBuffer;
- int vertices;
- public:
- struct Vertex final {
- Vector3 position;
- Vector2 texture;
- };
- class Triangle final {
- Vertex a;
- Vector3 normalA;
- Vertex b;
- Vector3 normalB;
- Vertex c;
- Vector3 normalC;
- public:
- Triangle(const Vertex& a, const Vertex& b, const Vertex& c);
- };
- Mesh();
- bool init();
- void build(const TypedBuffer<Triangle>& buffer);
- void draw();
- };
- #endif
|