35 lines
541 B
C++
35 lines
541 B
C++
#ifndef TANKS_MODEL_HPP
|
|
#define TANKS_MODEL_HPP
|
|
|
|
#include <filesystem>
|
|
#include <glm/glm.hpp>
|
|
#include <string>
|
|
#include <variant>
|
|
#include <vector>
|
|
|
|
namespace trb::game {
|
|
|
|
struct vertex {
|
|
glm::vec3 position;
|
|
glm::vec3 normal;
|
|
glm::vec2 uv;
|
|
};
|
|
|
|
struct mesh_node {
|
|
std::vector<vertex> vertices;
|
|
std::vector<std::uint32_t> indices;
|
|
};
|
|
|
|
using node = std::variant<mesh_node>;
|
|
|
|
struct scene {
|
|
std::vector<node> nodes;
|
|
std::string name;
|
|
};
|
|
|
|
[[nodiscard]] scene load_glb(std::filesystem::path path);
|
|
|
|
} // namespace trb::game
|
|
|
|
#endif
|