aboutsummaryrefslogtreecommitdiffstats
path: root/include/gltf.hpp
diff options
context:
space:
mode:
authorladevieq <ladevie.quentin@gmail.com>2021-09-01 00:18:04 +0200
committerladevieq <ladevie.quentin@gmail.com>2021-09-01 00:18:04 +0200
commitbf512216323f3df55627421bb0187ed364d58340 (patch)
tree2ae215cdf1bacf925efb7a52975d49351274cf30 /include/gltf.hpp
parentd071fc5c947689eca7726803a420013c519acdd9 (diff)
White furnace test on gltf scenes & load normals
Diffstat (limited to 'include/gltf.hpp')
-rw-r--r--include/gltf.hpp16
1 files changed, 10 insertions, 6 deletions
diff --git a/include/gltf.hpp b/include/gltf.hpp
index 7008e8a..6633811 100644
--- a/include/gltf.hpp
+++ b/include/gltf.hpp
@@ -9,12 +9,14 @@
using json = nlohmann::json;
-#include <vec3.hpp>
+#include "material.hpp"
+#include "vec3.hpp"
struct mesh_part {
- std::vector<uint16_t> indices;
- std::vector<vec3> positions;
- // std::vector<vec3> normals;
+ std::vector<uint16_t> indices;
+ std::vector<vec3> positions;
+ std::vector<vec3> normals;
+ material mat;
};
struct mesh {
@@ -34,9 +36,11 @@ private:
static void load_node(json &gltf_json, uint32_t index, node &parent, std::vector<mesh> &meshes);
- static std::vector<mesh> load_meshes(json &gltf_json, std::vector<std::vector<uint8_t>> &buffers_content);
+ static std::vector<mesh> load_meshes(json &gltf_json, std::vector<std::vector<uint8_t>> &buffers_content, std::vector<material> &materials);
- static mesh_part load_primitive(json &gltf_json, json &primitive, std::vector<std::vector<uint8_t>> &buffers_content);
+ static std::vector<material> load_materials(json &gltf_json);
+
+ static mesh_part load_primitive(json &gltf_json, json &primitive, std::vector<std::vector<uint8_t>> &buffers_content, std::vector<material> &materials);
};
#endif