11#include <unordered_map>
16namespace tinygltf {
class Model;
struct Image; }
64 std::unordered_map<std::string, std::shared_ptr<AnimTrack>>
animTracks;
77 static std::unique_ptr<GlbContainerResource>
parse(
const std::string& path,
78 const std::shared_ptr<GraphicsDevice>& device);
82 const std::uint8_t* data, std::size_t length,
83 const std::shared_ptr<GraphicsDevice>& device,
84 const std::string& debugName =
"memory");
101 tinygltf::Model& model,
102 const std::shared_ptr<GraphicsDevice>& device,
103 const std::string& debugName =
"memory");
133 tinygltf::Model& model,
135 const std::shared_ptr<GraphicsDevice>& device,
136 const std::string& debugName =
"memory");
145 static bool loadImageData(tinygltf::Image* image,
int imageIndex,
146 std::string* err, std::string* warn,
int reqWidth,
int reqHeight,
147 const unsigned char* bytes,
int size,
void* userData);
static std::unique_ptr< GlbContainerResource > createFromModel(tinygltf::Model &model, const std::shared_ptr< GraphicsDevice > &device, const std::string &debugName="memory")
static std::unique_ptr< GlbContainerResource > parse(const std::string &path, const std::shared_ptr< GraphicsDevice > &device)
Parse a GLB file from disk.
static std::unique_ptr< GlbContainerResource > createFromPrepared(tinygltf::Model &model, PreparedGlbData &&prepared, const std::shared_ptr< GraphicsDevice > &device, const std::string &debugName="memory")
static std::unique_ptr< GlbContainerResource > parseFromMemory(const std::uint8_t *data, std::size_t length, const std::shared_ptr< GraphicsDevice > &device, const std::string &debugName="memory")
Parse a GLB from an in-memory byte buffer (e.g. extracted from b3dm).
static bool loadImageData(tinygltf::Image *image, int imageIndex, std::string *err, std::string *warn, int reqWidth, int reqHeight, const unsigned char *bytes, int size, void *userData)
static PreparedGlbData prepareFromModel(tinygltf::Model &model)
Pre-converted RGBA8 image, one per tinygltf::Model::images entry.
bool valid
True if conversion succeeded.
std::vector< uint8_t > rgbaPixels
RGBA8 interleaved pixels.
Pre-built vertex/index byte buffers for one mesh primitive.
std::vector< uint8_t > vertexBytes
PackedVertex data.
std::vector< uint8_t > indexBytes
uint32_t index data.
int mode
glTF primitive mode.
std::vector< std::vector< PrimitiveData > > meshPrimitives
Per-mesh primitives: meshPrimitives[meshIndex][primIndex].
size_t dracoDecodeSuccessCount
std::vector< ImageData > images
Pre-converted images indexed by tinygltf image index.
std::unordered_map< std::string, std::shared_ptr< AnimTrack > > animTracks
Fully parsed animation tracks (keyed by animation name).
size_t dracoDecodeFailureCount
size_t dracoPrimitiveCount
3D vector for positions, directions, and normals with multi-backend SIMD acceleration.