Merge pull request #155 from ffreling/accessor-normalized

Serialize accessor 'normalized' attribute.
This commit is contained in:
Syoyo Fujita 2019-03-22 01:32:34 +09:00 committed by GitHub
commit b3c1471317
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -569,7 +569,7 @@ struct Accessor {
// are not supported
std::string name;
size_t byteOffset;
bool normalized; // optinal.
bool normalized; // optional.
int componentType; // (required) One of TINYGLTF_COMPONENT_TYPE_***
size_t count; // required
int type; // (required) One of TINYGLTF_TYPE_*** ..
@ -4615,6 +4615,7 @@ static void SerializeGltfAccessor(Accessor &accessor, json &o) {
SerializeNumberProperty<size_t>("count", accessor.count, o);
SerializeNumberArrayProperty<double>("min", accessor.minValues, o);
SerializeNumberArrayProperty<double>("max", accessor.maxValues, o);
SerializeValue("normalized", Value(accessor.normalized), o);
std::string type;
switch (accessor.type) {
case TINYGLTF_TYPE_SCALAR: