add VEC3 model loader

This commit is contained in:
MihailRis
2024-10-24 18:34:40 +03:00
parent b3d942b76c
commit 91f45ad4d7
3 changed files with 263 additions and 0 deletions
+36
View File
@@ -0,0 +1,36 @@
#pragma once
#include <memory>
#include <string>
#include <vector>
#include <glm/glm.hpp>
#include <unordered_map>
#include "typedefs.hpp"
#include "util/Buffer.hpp"
#include "graphics/core/Model.hpp"
/// See /doc/specs/vec3_model_spec.md
namespace vec3 {
struct Material {
int flags;
std::string name;
};
struct Model {
std::string name;
model::Model model;
glm::vec3 origin;
Model& operator=(Model&&) = default;
~Model();
};
struct File {
std::unordered_map<std::string, Model> models;
std::vector<Material> materials;
};
File load(const std::string_view file, const util::Buffer<ubyte>& src);
}