From 6b765a85cf81bf4b7162e4c9280dd4054581c611 Mon Sep 17 00:00:00 2001 From: vimene Date: Mon, 11 Dec 2023 12:42:46 +0100 Subject: improved mesh definition - In the context of mesh definition, splited indices into vertex index, normal index and vertex data index to be able to specify different normals and vertex data for different faces using the same vertex --- src/o3d/mesh.h | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) (limited to 'src/o3d/mesh.h') diff --git a/src/o3d/mesh.h b/src/o3d/mesh.h index 34d1e09..4aad0e4 100644 --- a/src/o3d/mesh.h +++ b/src/o3d/mesh.h @@ -4,7 +4,9 @@ #include #include #include -#include "o3d/vertex.h" +#include +#include "math/vector.h" +#include "o3d/vertex_data.h" namespace engine::o3d { @@ -13,10 +15,15 @@ class Mesh { // static Mesh cube(); // this function should not be in this file static Mesh plane(); // this function should not be in this file - std::vector pts; - std::vector> faces; + std::vector vertices; + std::vector normals; + std::vector vertices_data; + std::vector, 3>> indices; - Mesh(std::vector pts, std::vector> faces); + Mesh(std::vector vertices, + std::vector normals, + std::vector vertices_data, + std::vector, 3>> indices); }; } -- cgit v1.2.3