aboutsummaryrefslogtreecommitdiff
path: root/src/o3d/tri_deriv.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/o3d/tri_deriv.h')
-rw-r--r--src/o3d/tri_deriv.h19
1 files changed, 10 insertions, 9 deletions
diff --git a/src/o3d/tri_deriv.h b/src/o3d/tri_deriv.h
index 201539b..16a21f8 100644
--- a/src/o3d/tri_deriv.h
+++ b/src/o3d/tri_deriv.h
@@ -7,16 +7,17 @@
namespace engine::o3d {
-class TriangleDerived {
- public:
- DerivedVertex derived_vertex1;
- DerivedVertex derived_vertex2;
- DerivedVertex derived_vertex3;
+struct TriangleDerived {
+ DerivedVertex derived_vertex1;
+ DerivedVertex derived_vertex2;
+ DerivedVertex derived_vertex3;
- TriangleDerived(DerivedVertex derived_vertex1, DerivedVertex derived_vertex2, DerivedVertex derived_vertex3);
- std::vector<TriangleDerived> perspective_crop_xy_out(float x1, float x2, float y1, float y2) const;
- std::vector<TriangleDerived> crop_z_out(float z1, float z2) const;
- TriangleDerived div_by_w() const;
+ std::vector<TriangleDerived> perspective_crop_xy_out(float x1, float x2, float y1, float y2) const;
+ std::vector<TriangleDerived> crop_z_out(float z1, float z2) const;
+
+ constexpr TriangleDerived div_by_w() const & {
+ return {derived_vertex1.div_by_w(), derived_vertex2.div_by_w(), derived_vertex3.div_by_w()};
+ }
};
}