1111#define GEOMETRY_H
1212
1313#include < engine/common.h>
14- #include < engine/graphics/buffer.h>
14+ #include < engine/graphics/accel.h>
15+ #include < engine/graphics/vao.h>
1516
1617VULKAN_ENGINE_NAMESPACE_BEGIN
1718
18- namespace Core
19- {
19+ namespace Core {
2020
2121class Geometry ;
2222
23- struct GeometricData
24- {
25- std::vector<uint32_t > vertexIndex;
23+ struct GeometricData {
24+ std::vector<uint32_t > vertexIndex;
2625 std::vector<Graphics::Utils::Vertex> vertexData;
2726
2827 // Stats
@@ -35,7 +34,6 @@ struct GeometricData
3534 void compute_statistics ();
3635};
3736
38-
3937/*
4038Class that defines the mesh geometry. Can be setup by filling it with a canonical vertex type array.
4139*/
@@ -44,55 +42,49 @@ class Geometry
4442
4543 private:
4644 Graphics::VertexArrays m_VAO{};
47- GeometricData m_geometryData{};
45+ Graphics::BLAS m_BLAS{};
46+ GeometricData m_geometryData{};
4847
4948 size_t m_materialID{0 };
5049
51- friend Graphics::VertexArrays *const get_render_data (Geometry *g);
50+ friend Graphics::VertexArrays* const get_VAO (Geometry* g);
51+ friend Graphics::BLAS* const get_BLAS (Geometry* g);
5252
5353 public:
54- Geometry ()
55- {
54+ Geometry () {
5655 }
5756
58- inline size_t get_material_ID () const
59- {
57+ inline size_t get_material_ID () const {
6058 return m_materialID;
6159 }
62- inline void set_material_ID (size_t id)
63- {
60+ inline void set_material_ID (size_t id) {
6461 m_materialID = id;
6562 }
6663
67- inline bool data_loaded () const
68- {
64+ inline bool data_loaded () const {
6965 return m_geometryData.loaded ;
7066 }
71- inline bool indexed () const
72- {
67+ inline bool indexed () const {
7368 return !m_geometryData.vertexIndex .empty ();
7469 }
7570
76- inline const GeometricData *get_geometric_data () const
77- {
71+ inline const GeometricData* get_geometric_data () const {
7872 return &m_geometryData;
7973 }
80- ~Geometry ()
81- {
74+ ~Geometry () {
8275 }
8376
84- void fill (std::vector<Graphics::Utils::Vertex> vertexInfo);
85- void fill (std::vector<Graphics::Utils::Vertex> vertexInfo, std::vector<uint32_t > vertexIndex);
86- void fill (Vec3 * pos, Vec3 * normal, Vec2 * uv, Vec3 * tangent, uint32_t vertNumber);
87- static Geometry * create_quad ();
88- static Geometry * create_cube ();
77+ void fill (std::vector<Graphics::Utils::Vertex> vertexInfo);
78+ void fill (std::vector<Graphics::Utils::Vertex> vertexInfo, std::vector<uint32_t > vertexIndex);
79+ void fill (Vec3* pos, Vec3* normal, Vec2* uv, Vec3* tangent, uint32_t vertNumber);
80+ static Geometry* create_quad ();
81+ static Geometry* create_cube ();
8982};
9083
91- Graphics::VertexArrays * const get_render_data (Geometry * g);
84+ Graphics::VertexArrays* const get_VAO (Geometry* g);
9285
9386} // namespace Core
9487
9588VULKAN_ENGINE_NAMESPACE_END;
9689
97-
9890#endif // VK_GEOMETRY_H
0 commit comments