Ver Fonte

more progress on extensions

Vicente Penades há 6 anos atrás
pai
commit
c989a8c5bb

+ 6 - 0
src/SharpGLTF/Schema2/gltf.AccessorSparse.cs

@@ -23,6 +23,12 @@ namespace SharpGLTF.Schema2
     {
     {
         internal AccessorSparse() { }
         internal AccessorSparse() { }
 
 
+        /// <inheritdoc />
+        protected override IEnumerable<glTFProperty> GetLogicalChildren()
+        {
+            return base.GetLogicalChildren().Concat(_indices, _values);
+        }
+
         internal AccessorSparse(BufferView indices, int indicesOffset, IndexType indicesEncoding, BufferView values, int valuesOffset, int count)
         internal AccessorSparse(BufferView indices, int indicesOffset, IndexType indicesEncoding, BufferView values, int valuesOffset, int count)
         {
         {
             Guard.NotNull(indices, nameof(indices));
             Guard.NotNull(indices, nameof(indices));

+ 5 - 0
src/SharpGLTF/Schema2/gltf.Accessors.cs

@@ -331,6 +331,11 @@ namespace SharpGLTF.Schema2
 
 
         #region API
         #region API
 
 
+        protected override IEnumerable<glTFProperty> GetLogicalChildren()
+        {
+            return base.GetLogicalChildren().Concat(_sparse);
+        }
+
         public void UpdateBounds()
         public void UpdateBounds()
         {
         {
             var dimensions = this._type.DimCount();
             var dimensions = this._type.DimCount();

+ 1 - 0
src/SharpGLTF/Schema2/gltf.Animations.cs

@@ -36,6 +36,7 @@ namespace SharpGLTF.Schema2
 
 
         #region API
         #region API
 
 
+        /// <inheritdoc />
         protected override IEnumerable<glTFProperty> GetLogicalChildren()
         protected override IEnumerable<glTFProperty> GetLogicalChildren()
         {
         {
             return base.GetLogicalChildren().Concat(_samplers).Concat(_channels);
             return base.GetLogicalChildren().Concat(_samplers).Concat(_channels);

+ 10 - 0
src/SharpGLTF/Schema2/gltf.Camera.cs

@@ -27,6 +27,16 @@ namespace SharpGLTF.Schema2
         }
         }
 
 
         #endregion
         #endregion
+
+        #region API
+
+        /// <inheritdoc />
+        protected override IEnumerable<glTFProperty> GetLogicalChildren()
+        {
+            return base.GetLogicalChildren().Concat(_orthographic, _perspective);
+        }
+
+        #endregion
     }
     }
 
 
     public partial class ModelRoot
     public partial class ModelRoot

+ 1 - 0
src/SharpGLTF/Schema2/gltf.Materials.cs

@@ -63,6 +63,7 @@ namespace SharpGLTF.Schema2
 
 
         #region API
         #region API
 
 
+        /// <inheritdoc />
         protected override IEnumerable<glTFProperty> GetLogicalChildren()
         protected override IEnumerable<glTFProperty> GetLogicalChildren()
         {
         {
             return base.GetLogicalChildren().Concat(_normalTexture, _emissiveTexture, _occlusionTexture, _pbrMetallicRoughness);
             return base.GetLogicalChildren().Concat(_normalTexture, _emissiveTexture, _occlusionTexture, _pbrMetallicRoughness);

+ 2 - 0
src/SharpGLTF/Schema2/gltf.MaterialsFactory.cs

@@ -137,6 +137,7 @@ namespace SharpGLTF.Schema2
 
 
     internal sealed partial class MaterialPBRMetallicRoughness
     internal sealed partial class MaterialPBRMetallicRoughness
     {
     {
+        /// <inheritdoc />
         protected override IEnumerable<glTFProperty> GetLogicalChildren()
         protected override IEnumerable<glTFProperty> GetLogicalChildren()
         {
         {
             return base.GetLogicalChildren().Concat(_baseColorTexture, _metallicRoughnessTexture);
             return base.GetLogicalChildren().Concat(_baseColorTexture, _metallicRoughnessTexture);
@@ -189,6 +190,7 @@ namespace SharpGLTF.Schema2
     {
     {
         internal MaterialPBRSpecularGlossiness(Material material) { }
         internal MaterialPBRSpecularGlossiness(Material material) { }
 
 
+        /// <inheritdoc />
         protected override IEnumerable<glTFProperty> GetLogicalChildren()
         protected override IEnumerable<glTFProperty> GetLogicalChildren()
         {
         {
             return base.GetLogicalChildren().Concat(_diffuseTexture, _specularGlossinessTexture);
             return base.GetLogicalChildren().Concat(_diffuseTexture, _specularGlossinessTexture);

+ 1 - 0
src/SharpGLTF/Schema2/gltf.Mesh.cs

@@ -40,6 +40,7 @@ namespace SharpGLTF.Schema2
 
 
         #region API
         #region API
 
 
+        /// <inheritdoc />
         protected override IEnumerable<glTFProperty> GetLogicalChildren()
         protected override IEnumerable<glTFProperty> GetLogicalChildren()
         {
         {
             return base.GetLogicalChildren().Concat(_primitives);
             return base.GetLogicalChildren().Concat(_primitives);

+ 4 - 0
src/SharpGLTF/Schema2/gltf.Property.cs

@@ -71,6 +71,10 @@ namespace SharpGLTF.Schema2
             _extensions.RemoveAll(item => item.GetType() == typeof(T));
             _extensions.RemoveAll(item => item.GetType() == typeof(T));
         }
         }
 
 
+        /// <summary>
+        /// Gets a collection of <see cref="glTFProperty"/> instances stored by this object.
+        /// </summary>
+        /// <returns>A collection of <see cref="glTFProperty"/> instances.</returns>
         protected virtual IEnumerable<glTFProperty> GetLogicalChildren()
         protected virtual IEnumerable<glTFProperty> GetLogicalChildren()
         {
         {
             return _extensions.OfType<glTFProperty>();
             return _extensions.OfType<glTFProperty>();

+ 1 - 0
src/SharpGLTF/Schema2/gltf.Root.cs

@@ -90,6 +90,7 @@ namespace SharpGLTF.Schema2
         public IReadOnlyList<Scene>         LogicalScenes       => _scenes;
         public IReadOnlyList<Scene>         LogicalScenes       => _scenes;
         public IReadOnlyList<Animation>     LogicalAnimations   => _animations;
         public IReadOnlyList<Animation>     LogicalAnimations   => _animations;
 
 
+        /// <inheritdoc />
         protected override IEnumerable<glTFProperty> GetLogicalChildren()
         protected override IEnumerable<glTFProperty> GetLogicalChildren()
         {
         {
             var containers = base.GetLogicalChildren();
             var containers = base.GetLogicalChildren();

+ 1 - 0
src/SharpGLTF/Schema2/khr.lights.cs

@@ -15,6 +15,7 @@ namespace SharpGLTF.Schema2
             _lights = new ChildrenCollection<PunctualLight, ModelRoot>(root);
             _lights = new ChildrenCollection<PunctualLight, ModelRoot>(root);
         }
         }
 
 
+        /// <inheritdoc />
         protected override IEnumerable<glTFProperty> GetLogicalChildren()
         protected override IEnumerable<glTFProperty> GetLogicalChildren()
         {
         {
             return base.GetLogicalChildren().Concat(_lights);
             return base.GetLogicalChildren().Concat(_lights);