From 1ccb4ff5802561fad3942df7f1e5e0f896018bb9 Mon Sep 17 00:00:00 2001 From: "Arthur Brainville (Ybalrid)" Date: Wed, 6 Mar 2019 11:30:00 +0100 Subject: [PATCH] added sparse structure to accessors --- tiny_gltf.h | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/tiny_gltf.h b/tiny_gltf.h index ed9e497..90b73c9 100644 --- a/tiny_gltf.h +++ b/tiny_gltf.h @@ -575,7 +575,19 @@ struct Accessor { std::vector minValues; // optional std::vector maxValues; // optional - // TODO(syoyo): "sparse" + struct { + int count; + bool isSparse; + struct { + int byteOffset; + int bufferView; + int component_type; // a TINYGLTF_COMPONENT_TYPE_ value + } indices; + struct { + int bufferView; + int byteOffset; + } values; + } sparse; /// /// Utility function to compute byteStride for a given bufferView object. @@ -614,7 +626,7 @@ struct Accessor { return 0; } - Accessor() { bufferView = -1; } + Accessor() { bufferView = -1; sparse.isSparse = false } bool operator==(const tinygltf::Accessor &) const; };