vpenades / SharpGLTF

glTF reader and writer for .NET Standard
MIT License
454 stars 72 forks source link

Several changes for 3D Tiles api #213

Closed bertt closed 5 months ago

bertt commented 6 months ago

. IMeshFeatureIDInfo, FeatureIdBuilder moved to new file

. Renamed method SetValues1D -> SetValues (because most frequently used)

. Changed FeatureIDBuilder constructor to

FeatureIDBuilder(int featureCount, OneOf<int, Texture>? attributeOrTexture = null, PropertyTable propertyTable = null, IReadOnlyList<int> channels = null, string label = null, int? nullFeatureId = null)

. Changed method AddMeshFeatureIds(this MeshPrimitive primitive, params (IMeshFeatureIDInfo fid, Texture tex, IReadOnlyList channels)[] featureIds)

to AddMeshFeatureIds(this MeshPrimitive primitive, params IMeshFeatureIDInfo[] fids)

. Improve support for array types (determine automatically if the array is fixed length or not)

. added type checking of metadata values to the schema

. fixed enums (must use short type)

. Tested all Cesium tests https://github.com/CesiumGS/3d-tiles-validator/tree/main/specs/data/gltfExtensions

. Added README.md with sample code

NOT supported now:

. external schema (using a json file) support;

. reading/writing/validating properties min, max, offset and scale.