CesiumGS / cesium-native

Apache License 2.0
414 stars 210 forks source link

Interpret offsets as array indices, not byte offsets #795

Closed j9liu closed 7 months ago

j9liu commented 7 months ago

Depends on #794, so merge that first.

In EXT_structural_metadata, the arrayOffsets of a PropertyTableProperty represent array indices. However, Cesium Native treats them as byte offsets that are multiples of sizeof(T), which is wrong. This PR corrects this behavior and edits the unit tests for the proper values.

Also, I arbitrarily found and replaced instances of glm::i32mat2x2 -> glm::imat2x2, so the diff looks bigger than it actually needs to be 😅

kring commented 7 months ago

Thanks @j9liu!