cesium-native
cesium-native copied to clipboard
Use Gltf extensions instead of extras for more custom behavior when processing mesh
Currently we use extras to embed some metadata for mesh and material processing, for example, Skirt metadata, water mask, etc. The problem with extras is that it uses json value for type erasure and requires safety check (e.g. ensure property name is there and property type is double, etc) to ensure that it conforms to the custom properties. It will be a lot harder if extras has some nested json into it. Extensions on the other hand use std::any for type erasure and use std::any_cast for type safety, so it requires less check and maybe a little bit faster. Nested object is also handled more elegantly. Beside embedding a custom metadata using type is a lot more self-documented than using json.
CC #195