From cc6fb8c33637566a7b116d46440e6063f016deea Mon Sep 17 00:00:00 2001 From: vimene Date: Tue, 31 Dec 2024 03:40:14 +0100 Subject: various improvements - added quaternions and rewrote all rotations to use them - added transforms to put all object transforms in a single place - added Wavefront .obj file parser - removed frame buffer's abstract class - improved vectors, matrices, triangles, vertices and vertices data by putting all code in header file - added vector's operations - changed from NULL to nullptr - miscellaneous improvements --- src/o3d/deriv_vertex.h | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'src/o3d/deriv_vertex.h') diff --git a/src/o3d/deriv_vertex.h b/src/o3d/deriv_vertex.h index 7524f9b..c435a7e 100644 --- a/src/o3d/deriv_vertex.h +++ b/src/o3d/deriv_vertex.h @@ -5,13 +5,15 @@ namespace engine::o3d { -class DerivedVertex { - public: - engine::math::Vector4 vertex; - float b0, b1; +using engine::math::Vector4; - DerivedVertex(engine::math::Vector4 vertex, float b0, float b1); - DerivedVertex div_by_w() const; +struct DerivedVertex { + Vector4 vertex; + float b0, b1; + + constexpr DerivedVertex div_by_w() const & { + return {vertex.div_by_w(), b0, b1}; + } }; } -- cgit v1.2.3