aboutsummaryrefslogtreecommitdiffstats
path: root/include/gltf.hpp
diff options
context:
space:
mode:
authorladevieq <ladevie.quentin@gmail.com>2022-06-15 23:02:29 +0200
committerladevieq <ladevie.quentin@gmail.com>2022-06-15 23:17:36 +0200
commit5692f616c6201b39184e4353b6a4cb850a84a450 (patch)
treee03976fb7c855b7719d9b68bd129b89a8519b712 /include/gltf.hpp
parent5a4595ec5990abc660acb48ca2fe1f282bbe213b (diff)
Fix formatting and linting
Diffstat (limited to 'include/gltf.hpp')
-rw-r--r--include/gltf.hpp32
1 files changed, 16 insertions, 16 deletions
diff --git a/include/gltf.hpp b/include/gltf.hpp
index 7df5e7a..0364ca8 100644
--- a/include/gltf.hpp
+++ b/include/gltf.hpp
@@ -10,46 +10,46 @@
using json = nlohmann::json;
#include "material.hpp"
-#include "vec3.hpp"
#include "vk-renderer.hpp"
struct mesh_part {
- std::vector<uint16_t> indices;
- std::vector<float> positions;
- std::vector<float> normals;
- std::vector<float> uvs;
- material mat;
- uint32_t triangles_count = 0;
- uint32_t vertices_count = 0;
+ std::vector<uint16_t> indices;
+ std::vector<float> positions;
+ std::vector<float> normals;
+ std::vector<float> uvs;
+ material mat;
+ uint32_t triangles_count = 0;
+ uint32_t vertices_count = 0;
};
struct mesh {
std::vector<mesh_part> parts;
- uint32_t triangles_count = 0;
- uint32_t vertices_count = 0;
+ uint32_t triangles_count = 0;
+ uint32_t vertices_count = 0;
};
struct node {
- std::vector<node> children;
+ std::vector<node> children;
std::optional<mesh> mesh;
};
class gltf {
-public:
+ public:
static node load(std::filesystem::path &path, std::string &filename, vkrenderer &renderer);
-private:
-
+ 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, std::vector<material> &materials);
+ static std::vector<mesh> load_meshes(
+ json &gltf_json, std::vector<std::vector<uint8_t>> &buffers_content, std::vector<material> &materials);
static std::vector<texture> load_textures(json &gltf_json, std::filesystem::path &path, vkrenderer &renderer);
static std::vector<material> load_materials(json &gltf_json, std::vector<texture> &textures);
- static mesh_part load_primitive(json &gltf_json, json &primitive, 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, std::vector<material> &materials);
};
#endif