aboutsummaryrefslogtreecommitdiffstats
path: root/include/triangle.hpp
diff options
context:
space:
mode:
authorladevieq <ladevie.quentin@gmail.com>2021-07-25 11:58:01 +0200
committerladevieq <ladevie.quentin@gmail.com>2021-07-25 11:58:01 +0200
commit3dd870b001bef62aaa501257352d968d1346c7f2 (patch)
treee82abc32ace01af978071b32db40e5c07c991529 /include/triangle.hpp
parent6bdf3ab65a7c1e98595ad167479b94a82184a444 (diff)
Use a different buffer for scene info, geometry, bvh and load gltf
Diffstat (limited to 'include/triangle.hpp')
-rw-r--r--include/triangle.hpp25
1 files changed, 25 insertions, 0 deletions
diff --git a/include/triangle.hpp b/include/triangle.hpp
new file mode 100644
index 0000000..12c0b69
--- /dev/null
+++ b/include/triangle.hpp
@@ -0,0 +1,25 @@
+#ifndef __TRIANGLE_HPP_
+#define __TRIANGLE_HPP_
+
+#include "aabb.hpp"
+#include "material.hpp"
+
+struct vertex {
+ vec3 position;
+ vec3 normal;
+};
+
+struct triangle {
+ triangle() = default;
+ triangle(vertex v1, vertex v2, vertex v3)
+ : v1(v1), v2(v2), v3(v3), bounding_box(v1.position, v2.position, v3.position)
+ {}
+
+ vertex v1;
+ vertex v2;
+ vertex v3;
+
+ aabb bounding_box;
+};
+
+#endif // !__TRIANGLE_HPP_