diff options
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;
|
