aboutsummaryrefslogtreecommitdiff
path: root/src/o3d/tri.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/o3d/tri.h')
-rw-r--r--src/o3d/tri.h15
1 files changed, 7 insertions, 8 deletions
diff --git a/src/o3d/tri.h b/src/o3d/tri.h
index 7fa37fe..4b50f91 100644
--- a/src/o3d/tri.h
+++ b/src/o3d/tri.h
@@ -3,19 +3,18 @@
#include <vector>
#include "o3d/vertex.h"
-#include "o3d/tri.h"
#include "o3d/tri_deriv.h"
namespace engine::o3d {
-class Triangle {
- public:
- Vertex vertex1;
- Vertex vertex2;
- Vertex vertex3;
+struct Triangle {
+ Vertex vertex1;
+ Vertex vertex2;
+ Vertex vertex3;
- Triangle(Vertex vertex1, Vertex vertex2, Vertex vertex3);
- TriangleDerived to_derived() const;
+ constexpr TriangleDerived to_derived() const & {
+ return {{vertex1.vertex, 1.f, 0.f}, {vertex2.vertex, 0.f, 1.f}, {vertex3.vertex, 0.f, 0.f}};
+ }
};
}