VoxelEngine
 
Loading...
Searching...
No Matches
Geometry.h
1#pragma once
2
3#include <string>
4#include <vector>
5
6#include "Face.h"
7#include "physics/AABB.h"
8//#include "BlockTextures.h"
9
10
11namespace engine {
12
13 class Geometry {
14 public:
17 Geometry(std::vector<Face> faces);
18
20 Geometry(std::vector<Face> faces, const AABB& aabb);
21
22 unsigned int getID() const { return m_id; }
23 const std::vector<Face>& faces() const { return m_faces; }
24 const AABB& aabb() const { return m_aabb; }
25
26 void rotate(glm::vec3 axis, float angle);
27
29 static Geometry Cube();
30 static Geometry Cylinder();
31 static Geometry Box(glm::vec3 start, glm::vec3 end);
32
33 private:
34 static inline unsigned int s_idCounter = 0;
35 Geometry();
36
37 unsigned int m_id;
38 std::vector<Face> m_faces;
39 AABB m_aabb;
40 };
41} // namespace engine
Definition Geometry.h:13
static Geometry Cube()
Returns the geometry for basic cube. (1x1x1)
Definition Geometry.cpp:32
Definition AABB.h:11