mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-07 20:11:50 +00:00
add VEC3 model loader
This commit is contained in:
parent
b3d942b76c
commit
91f45ad4d7
3 changed files with 263 additions and 0 deletions
36
src/coders/vec3.hpp
Normal file
36
src/coders/vec3.hpp
Normal 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);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue