diff options
| author | ladevieq <ladevie.quentin@gmail.com> | 2021-07-25 16:52:28 +0200 |
|---|---|---|
| committer | ladevieq <ladevie.quentin@gmail.com> | 2021-07-25 16:52:28 +0200 |
| commit | 3bfd2d67e1c2d7e2d77c431f54dd68356c94d787 (patch) | |
| tree | c3fbd47d8d273c08c64c363342fff35c04f780d0 /include/triangle.hpp | |
| parent | 3dd870b001bef62aaa501257352d968d1346c7f2 (diff) | |
Slowly rendering sponza
Diffstat (limited to 'include/triangle.hpp')
| -rw-r--r-- | include/triangle.hpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/include/triangle.hpp b/include/triangle.hpp index 12c0b69..57b42ca 100644 --- a/include/triangle.hpp +++ b/include/triangle.hpp @@ -15,6 +15,10 @@ struct triangle { : v1(v1), v2(v2), v3(v3), bounding_box(v1.position, v2.position, v3.position)
{}
+ vec3 center() {
+ return (v2.position + v1.position + v3.position) / 3.f;
+ }
+
vertex v1;
vertex v2;
vertex v3;
|
