Fixed an incorrect indeiciesType in the glTF2 sparse accessor.

pull/4195/head
ruyo 2021-11-21 23:23:22 +09:00
parent aeba7a43a0
commit 60bfde78eb
1 changed files with 3 additions and 2 deletions

View File

@ -863,6 +863,9 @@ inline void Accessor::Read(Value &obj, Asset &r) {
//indices componentType
sparse->indicesType = MemberOrDefault(*indicesValue, "componentType", ComponentType_BYTE);
//sparse->indices->Read(*indicesValue, r);
} else {
// indicesType
sparse->indicesType = MemberOrDefault(*sparseValue, "componentType", ComponentType_UNSIGNED_SHORT);
}
// value
@ -875,8 +878,6 @@ inline void Accessor::Read(Value &obj, Asset &r) {
//sparse->values->Read(*valuesValue, r);
}
// indicesType
sparse->indicesType = MemberOrDefault(*sparseValue, "componentType", ComponentType_UNSIGNED_SHORT);
const unsigned int elementSize = GetElementSize();
const size_t dataSize = count * elementSize;