3#ifndef GDK_GRAPHICS_EXT_GLTF_H
4#define GDK_GRAPHICS_EXT_GLTF_H
6#include <gdk/graphics/ext/animation/skeleton.h>
7#include <gdk/graphics/ext/animation/skinning.h>
8#include <gdk/graphics/model_data.h>
13#include <unordered_map>
16namespace gdk::graphics {
47 std::vector<animation::vertex_weights>
weights;
99 using gltf_attribute_names = std::unordered_map<std::string, std::string>;
101 [[nodiscard]]
const gltf_attribute_names &default_gltf_attribute_names();
110 [[nodiscard]]
gltf_content read_gltf(
const std::string_view aData,
111 const gltf_attribute_names &aNames = default_gltf_attribute_names());
vertex data stored in system memory.
Definition model_data.h:25
std::vector< gltf_mesh > meshes
meshes carried by the document
Definition gltf.h:84
std::vector< animation::skeleton > skeletons
Definition gltf.h:93
std::vector< gltf_image > images
images carried by the document
Definition gltf.h:87
std::vector< animation::clip > animations
every animation, as it drives the first skin
Definition gltf.h:96
std::vector< gltf_node > nodes
every node, drawing or not
Definition gltf.h:90
an encoded image in the document
Definition gltf.h:72
std::string mime_type
"image/png", "image/jpeg", or empty when the document did not say
Definition gltf.h:76
std::vector< std::byte > bytes
the file as it sits in the document, PNG or JPEG bytes and not channel data
Definition gltf.h:79
one drawable piece of a glTF document: a primitive, as one node draws it
Definition gltf.h:21
std::string material_name
the name of the glTF material this primitive draws with, empty if it has none
Definition gltf.h:34
std::string parent_name
the name of the parent node, empty if this is the root node
Definition gltf.h:31
std::array< float, 16 > local_transform
this node's transform relative to its parent, row major, identity by default
Definition gltf.h:40
int skeleton
index into gltf_content::skeletons, or -1 when the primitive is not skinned
Definition gltf.h:50
int base_color_image
the image this primitive's material paints with, or -1 for none
Definition gltf.h:37
std::string mesh_name
the name of the glTF mesh this came from, empty if it is unnamed
Definition gltf.h:25
std::string node_name
the name of the node that draws this mesh, empty if no node does
Definition gltf.h:28
std::vector< animation::vertex_weights > weights
per-vertex influences, empty if the primitive is not skinned.
Definition gltf.h:47
a node of the document
Definition gltf.h:54
std::string parent_name
empty if root node
Definition gltf.h:58
bool draws
whether it draws, and so whether it also appears in gltf_content::meshes
Definition gltf.h:68
std::array< float, 16 > local_transform
relative to the parent
Definition gltf.h:61