Negative indices were not treated properly when retrieving vertices from the vertex cache. For example two vertices with -1 would get the same vertex from the cache, but this is incorrect since a negative index can be a different absolute index depending on where in the file it is parsed. The fix is to convert negative indices to absolute indices from the start.
The reason the negative-indices test didn't catch this was because it didn't interleave any v and f sections. The updated test data now interleaves the sections.
Fixes https://github.com/AnalyticalGraphicsInc/obj2gltf/issues/184
Negative indices were not treated properly when retrieving vertices from the vertex cache. For example two vertices with
-1
would get the same vertex from the cache, but this is incorrect since a negative index can be a different absolute index depending on where in the file it is parsed. The fix is to convert negative indices to absolute indices from the start.The reason the negative-indices test didn't catch this was because it didn't interleave any
v
andf
sections. The updated test data now interleaves the sections.