From c5119193ffaedf4ac94fecfb434a3292a4746259 Mon Sep 17 00:00:00 2001 From: ladevieq Date: Sun, 26 Sep 2021 23:57:26 +0200 Subject: Refactor gltf loading and triangles attributes --- include/triangle.hpp | 21 +++++++-------------- 1 file changed, 7 insertions(+), 14 deletions(-) (limited to 'include/triangle.hpp') diff --git a/include/triangle.hpp b/include/triangle.hpp index 5a62aec..4d3550b 100644 --- a/include/triangle.hpp +++ b/include/triangle.hpp @@ -1,28 +1,21 @@ #ifndef __TRIANGLE_HPP_ #define __TRIANGLE_HPP_ -#include "material.hpp" - -struct vertex { - vec3 position; - vec3 normal; - vec3 uv; -}; +#include "vec3.hpp" struct triangle { triangle() = default; - triangle(vertex v1, vertex v2, vertex v3, material mat) - : v1(v1), v2(v2), v3(v3), mat(mat) + triangle(vec3 p1, vec3 p2, vec3 p3) + : p1(p1), p2(p2), p3(p3) {} vec3 center() { - return (v1.position + v2.position + v3.position) / 3.f; + return (p1 + p2 + p3) / 3.f; } - vertex v1; - vertex v2; - vertex v3; - material mat; + vec3 p1; + vec3 p2; + vec3 p3; }; #endif // !__TRIANGLE_HPP_ -- cgit v1.3