#ifndef __GLTF_HPP_ #define __GLTF_HPP_ #include #include #include #include using json = nlohmann::json; #include struct mesh_part { std::vector indices; std::vector positions; // std::vector normals; }; struct mesh { std::vector parts; }; struct node { std::vector children; std::optional mesh; }; class gltf { public: static node load(std::filesystem::path &path, std::string &filename); private: static void load_node(json &gltf_json, uint32_t index, node &parent, std::vector &meshes); static std::vector load_meshes(json &gltf_json, std::vector> &buffers_content); static mesh_part load_primitive(json &gltf_json, json &primitive, std::vector> &buffers_content); }; #endif