瀏覽代碼

Nightly + fire particle helper

David Catuhe 7 年之前
父節點
當前提交
ca56a4d5b9
共有 28 個文件被更改,包括 15925 次插入14165 次删除
  1. 8154 7912
      Playground/babylon.d.txt
  2. 823 0
      assets/particles/systems/fire.json
  3. 二進制
      assets/particles/textures/fire/Fire_SpriteSheet1_8x8.png
  4. 二進制
      assets/particles/textures/fire/Fire_SpriteSheet2_8x8.png
  5. 二進制
      assets/particles/textures/fire/Fire_SpriteSheet3_8x8.png
  6. 二進制
      assets/particles/textures/fire/sparks.png
  7. 2987 2934
      dist/preview release/babylon.d.ts
  8. 1 1
      dist/preview release/babylon.js
  9. 236 58
      dist/preview release/babylon.max.js
  10. 236 58
      dist/preview release/babylon.no-module.max.js
  11. 1 1
      dist/preview release/babylon.worker.js
  12. 236 58
      dist/preview release/es6.js
  13. 96 96
      dist/preview release/loaders/babylon.glTF2FileLoader.d.ts
  14. 945 915
      dist/preview release/loaders/babylon.glTF2FileLoader.js
  15. 1 1
      dist/preview release/loaders/babylon.glTF2FileLoader.min.js
  16. 96 96
      dist/preview release/loaders/babylon.glTFFileLoader.d.ts
  17. 945 915
      dist/preview release/loaders/babylon.glTFFileLoader.js
  18. 1 1
      dist/preview release/loaders/babylon.glTFFileLoader.min.js
  19. 96 96
      dist/preview release/loaders/babylonjs.loaders.d.ts
  20. 945 915
      dist/preview release/loaders/babylonjs.loaders.js
  21. 1 1
      dist/preview release/loaders/babylonjs.loaders.min.js
  22. 96 96
      dist/preview release/loaders/babylonjs.loaders.module.d.ts
  23. 1 1
      dist/preview release/viewer/babylon.viewer.js
  24. 2 2
      dist/preview release/viewer/babylon.viewer.max.js
  25. 6 1
      src/Particles/babylon.IParticleSystem.ts
  26. 15 1
      src/Particles/babylon.gpuParticleSystem.ts
  27. 5 2
      src/Particles/babylon.particleSystem.ts
  28. 0 4
      src/babylon.node.ts

文件差異過大導致無法顯示
+ 8154 - 7912
Playground/babylon.d.txt


+ 823 - 0
assets/particles/systems/fire.json

@@ -0,0 +1,823 @@
+{
+    "systems":
+    [
+        {
+            "name": "fireSystem",
+            "id": "fireSystem",
+            "capacity": 5,
+            "emitter":
+            [
+                0,
+                3.25,
+                0
+            ],
+            "particleEmitterType":
+            {
+                "type": "BoxParticleEmitter",
+                "direction1":
+                [
+                    0,
+                    1,
+                    0
+                ],
+                "direction2":
+                [
+                    0,
+                    1,
+                    0
+                ],
+                "minEmitBox":
+                [
+                    -0.5,
+                    0,
+                    -0.5
+                ],
+                "maxEmitBox":
+                [
+                    0.5,
+                    0,
+                    0.5
+                ]
+            },
+            "textureName": "fire/Fire_SpriteSheet1_8x8.png",
+            "invertY": false,
+            "animations": [],
+            "startDelay": 0,
+            "renderingGroupId": 0,
+            "isBillboardBased": true,
+            "billboardMode": 2,
+            "minAngularSpeed": 0,
+            "maxAngularSpeed": 0,
+            "minSize": 6,
+            "maxSize": 8,
+            "minScaleX": 1,
+            "maxScaleX": 1,
+            "minScaleY": 1,
+            "maxScaleY": 1,
+            "minEmitPower": 0,
+            "maxEmitPower": 0,
+            "minLifeTime": 2,
+            "maxLifeTime": 3,
+            "emitRate": 2,
+            "gravity":
+            [
+                0,
+                0,
+                0
+            ],
+            "noiseStrength":
+            [
+                10,
+                10,
+                10
+            ],
+            "color1":
+            [
+                1,
+                1,
+                1,
+                1
+            ],
+            "color2":
+            [
+                1,
+                1,
+                1,
+                1
+            ],
+            "colorDead":
+            [
+                1,
+                1,
+                1,
+                0
+            ],
+            "updateSpeed": 0.016666666666666666,
+            "targetStopDuration": 0,
+            "blendMode": 4,
+            "preWarmCycles": 100,
+            "preWarmStepOffset": 10,
+            "minInitialRotation": -0.1,
+            "maxInitialRotation": 0.1,
+            "startSpriteCellID": 0,
+            "endSpriteCellID": 63,
+            "spriteCellChangeSpeed": 1,
+            "spriteCellWidth": 128,
+            "spriteCellHeight": 128,
+            "spriteRandomStartCell": true,
+            "isAnimationSheetEnabled": true,
+            "colorGradients":
+            [
+                {
+                    "gradient": 0,
+                    "color1":
+                    [
+                        1,
+                        1,
+                        1,
+                        0
+                    ]
+                },
+                {
+                    "gradient": 0.1,
+                    "color1":
+                    [
+                        1,
+                        1,
+                        1,
+                        0.6
+                    ]
+                },
+                {
+                    "gradient": 0.9,
+                    "color1":
+                    [
+                        1,
+                        1,
+                        1,
+                        0.6
+                    ]
+                },
+                {
+                    "gradient": 1,
+                    "color1":
+                    [
+                        1,
+                        1,
+                        1,
+                        0
+                    ]
+                }
+            ],
+            "rampGradients":
+            [
+                {
+                    "gradient": 0,
+                    "color":
+                    [
+                        1,
+                        1,
+                        1
+                    ]
+                },
+                {
+                    "gradient": 1,
+                    "color":
+                    [
+                        0.7968,
+                        0.3685,
+                        0.1105
+                    ]
+                }
+            ],
+            "useRampGradients": true,
+            "colorRemapGradients":
+            [
+                {
+                    "gradient": 0,
+                    "factor1": 0.2,
+                    "factor2": 1
+                },
+                {
+                    "gradient": 1,
+                    "factor1": 0.2,
+                    "factor2": 1
+                }
+            ],
+            "textureMask":
+            [
+                1,
+                1,
+                1,
+                1
+            ],
+            "customShader": null,
+            "preventAutoStart": false
+        },
+        {
+            "name": "sparksEdge",
+            "id": "sparksEdge",
+            "capacity": 20,
+            "emitter":
+            [
+                0,
+                0,
+                0
+            ],
+            "particleEmitterType":
+            {
+                "type": "ConeParticleEmitter",
+                "radius": 1,
+                "angle": 0.8,
+                "directionRandomizer": 0
+            },
+            "textureName": "fire/sparks.png",
+            "invertY": true,
+            "animations": [],
+            "startDelay": 0,
+            "renderingGroupId": 0,
+            "isBillboardBased": true,
+            "billboardMode": 7,
+            "minAngularSpeed": 0,
+            "maxAngularSpeed": 0,
+            "minSize": 0.2,
+            "maxSize": 0.3,
+            "minScaleX": 1,
+            "maxScaleX": 1,
+            "minScaleY": 1,
+            "maxScaleY": 1,
+            "minEmitPower": 15,
+            "maxEmitPower": 20,
+            "minLifeTime": 1.5,
+            "maxLifeTime": 2.5,
+            "emitRate": 20,
+            "gravity":
+            [
+                0,
+                0,
+                0
+            ],
+            "noiseStrength":
+            [
+                2,
+                1,
+                1
+            ],
+            "color1":
+            [
+                1,
+                1,
+                1,
+                1
+            ],
+            "color2":
+            [
+                1,
+                1,
+                1,
+                1
+            ],
+            "colorDead":
+            [
+                1,
+                1,
+                1,
+                0
+            ],
+            "updateSpeed": 0.016666666666666666,
+            "targetStopDuration": 0,
+            "blendMode": 2,
+            "preWarmCycles": 100,
+            "preWarmStepOffset": 10,
+            "minInitialRotation": 0,
+            "maxInitialRotation": 0,
+            "startSpriteCellID": 0,
+            "endSpriteCellID": 0,
+            "spriteCellChangeSpeed": 1,
+            "spriteCellWidth": 0,
+            "spriteCellHeight": 0,
+            "spriteRandomStartCell": false,
+            "isAnimationSheetEnabled": false,
+            "colorGradients":
+            [
+                {
+                    "gradient": 0,
+                    "color1":
+                    [
+                        0.9245,
+                        0.654,
+                        0.0915,
+                        0
+                    ]
+                },
+                {
+                    "gradient": 0.04,
+                    "color1":
+                    [
+                        0.9062,
+                        0.6132,
+                        0.0942,
+                        0.1
+                    ]
+                },
+                {
+                    "gradient": 0.4,
+                    "color1":
+                    [
+                        0.7968,
+                        0.3685,
+                        0.1105,
+                        1
+                    ]
+                },
+                {
+                    "gradient": 0.7,
+                    "color1":
+                    [
+                        0.6886,
+                        0.1266,
+                        0.1266,
+                        1
+                    ]
+                },
+                {
+                    "gradient": 0.9,
+                    "color1":
+                    [
+                        0.3113,
+                        0.0367,
+                        0.0367,
+                        0.6
+                    ]
+                },
+                {
+                    "gradient": 1,
+                    "color1":
+                    [
+                        0.3113,
+                        0.0367,
+                        0.0367,
+                        0
+                    ]
+                }
+            ],
+            "rampGradients":
+            [
+                {
+                    "gradient": 0,
+                    "color":
+                    [
+                        1,
+                        1,
+                        1
+                    ]
+                },
+                {
+                    "gradient": 1,
+                    "color":
+                    [
+                        0.7968,
+                        0.63685,
+                        0.4105
+                    ]
+                }
+            ],
+            "useRampGradients": true,
+            "colorRemapGradients":
+            [
+                {
+                    "gradient": 0,
+                    "factor1": 0,
+                    "factor2": 0.1
+                },
+                {
+                    "gradient": 0.2,
+                    "factor1": 0.1,
+                    "factor2": 0.8
+                },
+                {
+                    "gradient": 0.3,
+                    "factor1": 0.2,
+                    "factor2": 0.85
+                },
+                {
+                    "gradient": 0.35,
+                    "factor1": 0.4,
+                    "factor2": 0.85
+                },
+                {
+                    "gradient": 0.4,
+                    "factor1": 0.5,
+                    "factor2": 0.9
+                },
+                {
+                    "gradient": 0.5,
+                    "factor1": 0.95,
+                    "factor2": 1
+                },
+                {
+                    "gradient": 1,
+                    "factor1": 0.95,
+                    "factor2": 1
+                }
+            ],
+            "limitVelocityGradients":
+            [
+                {
+                    "gradient": 0,
+                    "factor1": 7
+                },
+                {
+                    "gradient": 1,
+                    "factor1": 1
+                }
+            ],
+            "limitVelocityDamping": 0.5,
+            "noiseTexture":
+            {
+                "customType": "BABYLON.NoiseProceduralTexture",
+                "brightness": 0.5,
+                "octaves": 8,
+                "persistence": 1,
+                "animationSpeedFactor": 3,
+                "size": 256,
+                "generateMipMaps": true
+            },
+            "textureMask":
+            [
+                1,
+                1,
+                1,
+                1
+            ],
+            "customShader": null,
+            "preventAutoStart": false
+        },
+        {
+            "name": "fireSystem2",
+            "id": "fireSystem2",
+            "capacity": 3,
+            "emitter":
+            [
+                0,
+                2.25,
+                0
+            ],
+            "particleEmitterType":
+            {
+                "type": "BoxParticleEmitter",
+                "direction1":
+                [
+                    0,
+                    1,
+                    0
+                ],
+                "direction2":
+                [
+                    0,
+                    1,
+                    0
+                ],
+                "minEmitBox":
+                [
+                    -0.5,
+                    0,
+                    -0.5
+                ],
+                "maxEmitBox":
+                [
+                    0.5,
+                    0,
+                    0.5
+                ]
+            },
+            "textureName": "fire/Fire_SpriteSheet2_8x8.png",
+            "invertY": false,
+            "animations": [],
+            "startDelay": 0,
+            "renderingGroupId": 0,
+            "isBillboardBased": true,
+            "billboardMode": 2,
+            "minAngularSpeed": 0,
+            "maxAngularSpeed": 0,
+            "minSize": 5,
+            "maxSize": 6,
+            "minScaleX": 1,
+            "maxScaleX": 1,
+            "minScaleY": 1,
+            "maxScaleY": 1,
+            "minEmitPower": 0,
+            "maxEmitPower": 0,
+            "minLifeTime": 2,
+            "maxLifeTime": 3,
+            "emitRate": 2,
+            "gravity":
+            [
+                0,
+                0,
+                0
+            ],
+            "noiseStrength":
+            [
+                10,
+                10,
+                10
+            ],
+            "color1":
+            [
+                1,
+                1,
+                1,
+                1
+            ],
+            "color2":
+            [
+                1,
+                1,
+                1,
+                1
+            ],
+            "colorDead":
+            [
+                1,
+                1,
+                1,
+                0
+            ],
+            "updateSpeed": 0.016666666666666666,
+            "targetStopDuration": 0,
+            "blendMode": 4,
+            "preWarmCycles": 100,
+            "preWarmStepOffset": 10,
+            "minInitialRotation": -0.1,
+            "maxInitialRotation": 0.1,
+            "startSpriteCellID": 0,
+            "endSpriteCellID": 63,
+            "spriteCellChangeSpeed": 0.9,
+            "spriteCellWidth": 128,
+            "spriteCellHeight": 128,
+            "spriteRandomStartCell": true,
+            "isAnimationSheetEnabled": true,
+            "colorGradients":
+            [
+                {
+                    "gradient": 0,
+                    "color1":
+                    [
+                        1,
+                        1,
+                        1,
+                        0
+                    ]
+                },
+                {
+                    "gradient": 0.1,
+                    "color1":
+                    [
+                        1,
+                        1,
+                        1,
+                        0.6
+                    ]
+                },
+                {
+                    "gradient": 0.9,
+                    "color1":
+                    [
+                        1,
+                        1,
+                        1,
+                        0.6
+                    ]
+                },
+                {
+                    "gradient": 1,
+                    "color1":
+                    [
+                        1,
+                        1,
+                        1,
+                        0
+                    ]
+                }
+            ],
+            "rampGradients":
+            [
+                {
+                    "gradient": 0,
+                    "color":
+                    [
+                        1,
+                        1,
+                        1
+                    ]
+                },
+                {
+                    "gradient": 1,
+                    "color":
+                    [
+                        0.7968,
+                        0.3685,
+                        0.1105
+                    ]
+                }
+            ],
+            "useRampGradients": true,
+            "colorRemapGradients":
+            [
+                {
+                    "gradient": 0,
+                    "factor1": 0.2,
+                    "factor2": 1
+                },
+                {
+                    "gradient": 1,
+                    "factor1": 0.2,
+                    "factor2": 1
+                }
+            ],
+            "textureMask":
+            [
+                1,
+                1,
+                1,
+                1
+            ],
+            "customShader": null,
+            "preventAutoStart": false
+        },
+        {
+            "name": "fireSystem3",
+            "id": "fireSystem3",
+            "capacity": 3,
+            "emitter":
+            [
+                0,
+                2.25,
+                0
+            ],
+            "particleEmitterType":
+            {
+                "type": "BoxParticleEmitter",
+                "direction1":
+                [
+                    0,
+                    1,
+                    0
+                ],
+                "direction2":
+                [
+                    0,
+                    1,
+                    0
+                ],
+                "minEmitBox":
+                [
+                    -0.5,
+                    0,
+                    -0.5
+                ],
+                "maxEmitBox":
+                [
+                    0.5,
+                    0,
+                    0.5
+                ]
+            },
+            "textureName": "fire/Fire_SpriteSheet3_8x8.png",
+            "invertY": false,
+            "animations": [],
+            "startDelay": 0,
+            "renderingGroupId": 0,
+            "isBillboardBased": true,
+            "billboardMode": 2,
+            "minAngularSpeed": 0,
+            "maxAngularSpeed": 0,
+            "minSize": 5,
+            "maxSize": 6,
+            "minScaleX": 1,
+            "maxScaleX": 1,
+            "minScaleY": 1,
+            "maxScaleY": 1,
+            "minEmitPower": 0,
+            "maxEmitPower": 0,
+            "minLifeTime": 2,
+            "maxLifeTime": 3,
+            "emitRate": 2,
+            "gravity":
+            [
+                0,
+                0,
+                0
+            ],
+            "noiseStrength":
+            [
+                10,
+                10,
+                10
+            ],
+            "color1":
+            [
+                1,
+                1,
+                1,
+                1
+            ],
+            "color2":
+            [
+                1,
+                1,
+                1,
+                1
+            ],
+            "colorDead":
+            [
+                1,
+                1,
+                1,
+                0
+            ],
+            "updateSpeed": 0.016666666666666666,
+            "targetStopDuration": 0,
+            "blendMode": 4,
+            "preWarmCycles": 100,
+            "preWarmStepOffset": 10,
+            "minInitialRotation": -0.1,
+            "maxInitialRotation": 0.1,
+            "startSpriteCellID": 0,
+            "endSpriteCellID": 63,
+            "spriteCellChangeSpeed": 0.9,
+            "spriteCellWidth": 128,
+            "spriteCellHeight": 128,
+            "spriteRandomStartCell": true,
+            "isAnimationSheetEnabled": true,
+            "colorGradients":
+            [
+                {
+                    "gradient": 0,
+                    "color1":
+                    [
+                        1,
+                        1,
+                        1,
+                        0
+                    ]
+                },
+                {
+                    "gradient": 0.1,
+                    "color1":
+                    [
+                        1,
+                        1,
+                        1,
+                        0.6
+                    ]
+                },
+                {
+                    "gradient": 0.9,
+                    "color1":
+                    [
+                        1,
+                        1,
+                        1,
+                        0.6
+                    ]
+                },
+                {
+                    "gradient": 1,
+                    "color1":
+                    [
+                        1,
+                        1,
+                        1,
+                        0
+                    ]
+                }
+            ],
+            "rampGradients":
+            [
+                {
+                    "gradient": 0,
+                    "color":
+                    [
+                        1,
+                        1,
+                        1
+                    ]
+                },
+                {
+                    "gradient": 1,
+                    "color":
+                    [
+                        0.7968,
+                        0.3685,
+                        0.1105
+                    ]
+                }
+            ],
+            "useRampGradients": true,
+            "colorRemapGradients":
+            [
+                {
+                    "gradient": 0,
+                    "factor1": 0.2,
+                    "factor2": 1
+                },
+                {
+                    "gradient": 1,
+                    "factor1": 0.2,
+                    "factor2": 1
+                }
+            ],
+            "textureMask":
+            [
+                1,
+                1,
+                1,
+                1
+            ],
+            "customShader": null,
+            "preventAutoStart": false
+        }
+    ]
+}

二進制
assets/particles/textures/fire/Fire_SpriteSheet1_8x8.png


二進制
assets/particles/textures/fire/Fire_SpriteSheet2_8x8.png


二進制
assets/particles/textures/fire/Fire_SpriteSheet3_8x8.png


二進制
assets/particles/textures/fire/sparks.png


文件差異過大導致無法顯示
+ 2987 - 2934
dist/preview release/babylon.d.ts


文件差異過大導致無法顯示
+ 1 - 1
dist/preview release/babylon.js


文件差異過大導致無法顯示
+ 236 - 58
dist/preview release/babylon.max.js


文件差異過大導致無法顯示
+ 236 - 58
dist/preview release/babylon.no-module.max.js


文件差異過大導致無法顯示
+ 1 - 1
dist/preview release/babylon.worker.js


文件差異過大導致無法顯示
+ 236 - 58
dist/preview release/es6.js


+ 96 - 96
dist/preview release/loaders/babylon.glTF2FileLoader.d.ts

@@ -351,7 +351,7 @@ declare module BABYLON {
 }
 
 
-declare module BABYLON.GLTF2 {
+declare module BABYLON.GLTF2.Loader {
     /**
      * Loader interface with an index field.
      */
@@ -364,7 +364,7 @@ declare module BABYLON.GLTF2 {
     /**
      * Loader interface with additional members.
      */
-    interface ILoaderAccessor extends IAccessor, IArrayItem {
+    interface IAccessor extends GLTF2.IAccessor, IArrayItem {
         /** @hidden */
         _data?: Promise<ArrayBufferView>;
         /** @hidden */
@@ -373,10 +373,10 @@ declare module BABYLON.GLTF2 {
     /**
      * Loader interface with additional members.
      */
-    interface ILoaderAnimationChannel extends IAnimationChannel, IArrayItem {
+    interface IAnimationChannel extends GLTF2.IAnimationChannel, IArrayItem {
     }
     /** @hidden */
-    interface _ILoaderAnimationSamplerData {
+    interface _IAnimationSamplerData {
         input: Float32Array;
         interpolation: AnimationSamplerInterpolation;
         output: Float32Array;
@@ -384,30 +384,30 @@ declare module BABYLON.GLTF2 {
     /**
      * Loader interface with additional members.
      */
-    interface ILoaderAnimationSampler extends IAnimationSampler, IArrayItem {
+    interface IAnimationSampler extends GLTF2.IAnimationSampler, IArrayItem {
         /** @hidden */
-        _data?: Promise<_ILoaderAnimationSamplerData>;
+        _data?: Promise<_IAnimationSamplerData>;
     }
     /**
      * Loader interface with additional members.
      */
-    interface ILoaderAnimation extends IAnimation, IArrayItem {
-        channels: ILoaderAnimationChannel[];
-        samplers: ILoaderAnimationSampler[];
+    interface IAnimation extends GLTF2.IAnimation, IArrayItem {
+        channels: IAnimationChannel[];
+        samplers: IAnimationSampler[];
         /** @hidden */
         _babylonAnimationGroup?: AnimationGroup;
     }
     /**
      * Loader interface with additional members.
      */
-    interface ILoaderBuffer extends IBuffer, IArrayItem {
+    interface IBuffer extends GLTF2.IBuffer, IArrayItem {
         /** @hidden */
         _data?: Promise<ArrayBufferView>;
     }
     /**
      * Loader interface with additional members.
      */
-    interface ILoaderBufferView extends IBufferView, IArrayItem {
+    interface IBufferView extends GLTF2.IBufferView, IArrayItem {
         /** @hidden */
         _data?: Promise<ArrayBufferView>;
         /** @hidden */
@@ -416,40 +416,40 @@ declare module BABYLON.GLTF2 {
     /**
      * Loader interface with additional members.
      */
-    interface ILoaderCamera extends ICamera, IArrayItem {
+    interface ICamera extends GLTF2.ICamera, IArrayItem {
     }
     /**
      * Loader interface with additional members.
      */
-    interface ILoaderImage extends IImage, IArrayItem {
+    interface IImage extends GLTF2.IImage, IArrayItem {
         /** @hidden */
         _data?: Promise<ArrayBufferView>;
     }
     /**
      * Loader interface with additional members.
      */
-    interface ILoaderMaterialNormalTextureInfo extends IMaterialNormalTextureInfo, ILoaderTextureInfo {
+    interface IMaterialNormalTextureInfo extends GLTF2.IMaterialNormalTextureInfo, ITextureInfo {
     }
     /**
      * Loader interface with additional members.
      */
-    interface ILoaderMaterialOcclusionTextureInfo extends IMaterialOcclusionTextureInfo, ILoaderTextureInfo {
+    interface IMaterialOcclusionTextureInfo extends GLTF2.IMaterialOcclusionTextureInfo, ITextureInfo {
     }
     /**
      * Loader interface with additional members.
      */
-    interface ILoaderMaterialPbrMetallicRoughness extends IMaterialPbrMetallicRoughness {
-        baseColorTexture?: ILoaderTextureInfo;
-        metallicRoughnessTexture?: ILoaderTextureInfo;
+    interface IMaterialPbrMetallicRoughness extends GLTF2.IMaterialPbrMetallicRoughness {
+        baseColorTexture?: ITextureInfo;
+        metallicRoughnessTexture?: ITextureInfo;
     }
     /**
      * Loader interface with additional members.
      */
-    interface ILoaderMaterial extends IMaterial, IArrayItem {
-        pbrMetallicRoughness?: ILoaderMaterialPbrMetallicRoughness;
-        normalTexture?: ILoaderMaterialNormalTextureInfo;
-        occlusionTexture?: ILoaderMaterialOcclusionTextureInfo;
-        emissiveTexture?: ILoaderTextureInfo;
+    interface IMaterial extends GLTF2.IMaterial, IArrayItem {
+        pbrMetallicRoughness?: IMaterialPbrMetallicRoughness;
+        normalTexture?: IMaterialNormalTextureInfo;
+        occlusionTexture?: IMaterialOcclusionTextureInfo;
+        emissiveTexture?: ITextureInfo;
         /** @hidden */
         _babylonData?: {
             [drawMode: number]: {
@@ -462,22 +462,22 @@ declare module BABYLON.GLTF2 {
     /**
      * Loader interface with additional members.
      */
-    interface ILoaderMesh extends IMesh, IArrayItem {
-        primitives: ILoaderMeshPrimitive[];
+    interface IMesh extends GLTF2.IMesh, IArrayItem {
+        primitives: IMeshPrimitive[];
     }
     /**
      * Loader interface with additional members.
      */
-    interface ILoaderMeshPrimitive extends IMeshPrimitive, IArrayItem {
+    interface IMeshPrimitive extends GLTF2.IMeshPrimitive, IArrayItem {
     }
     /**
      * Loader interface with additional members.
      */
-    interface ILoaderNode extends INode, IArrayItem {
+    interface INode extends GLTF2.INode, IArrayItem {
         /**
          * The parent glTF node.
          */
-        parent?: ILoaderNode;
+        parent?: INode;
         /** @hidden */
         _babylonMesh?: Mesh;
         /** @hidden */
@@ -488,7 +488,7 @@ declare module BABYLON.GLTF2 {
         _numMorphTargets?: number;
     }
     /** @hidden */
-    interface _ILoaderSamplerData {
+    interface _ISamplerData {
         noMipMaps: boolean;
         samplingMode: number;
         wrapU: number;
@@ -497,19 +497,19 @@ declare module BABYLON.GLTF2 {
     /**
      * Loader interface with additional members.
      */
-    interface ILoaderSampler extends ISampler, IArrayItem {
+    interface ISampler extends GLTF2.ISampler, IArrayItem {
         /** @hidden */
-        _data?: _ILoaderSamplerData;
+        _data?: _ISamplerData;
     }
     /**
      * Loader interface with additional members.
      */
-    interface ILoaderScene extends IScene, IArrayItem {
+    interface IScene extends GLTF2.IScene, IArrayItem {
     }
     /**
      * Loader interface with additional members.
      */
-    interface ILoaderSkin extends ISkin, IArrayItem {
+    interface ISkin extends GLTF2.ISkin, IArrayItem {
         /** @hidden */
         _babylonSkeleton?: Skeleton;
         /** @hidden */
@@ -518,30 +518,30 @@ declare module BABYLON.GLTF2 {
     /**
      * Loader interface with additional members.
      */
-    interface ILoaderTexture extends ITexture, IArrayItem {
+    interface ITexture extends GLTF2.ITexture, IArrayItem {
     }
     /**
      * Loader interface with additional members.
      */
-    interface ILoaderTextureInfo extends ITextureInfo {
+    interface ITextureInfo extends GLTF2.ITextureInfo {
     }
     /**
      * Loader interface with additional members.
      */
-    interface ILoaderGLTF extends IGLTF {
-        accessors?: ILoaderAccessor[];
-        animations?: ILoaderAnimation[];
-        buffers?: ILoaderBuffer[];
-        bufferViews?: ILoaderBufferView[];
-        cameras?: ILoaderCamera[];
-        images?: ILoaderImage[];
-        materials?: ILoaderMaterial[];
-        meshes?: ILoaderMesh[];
-        nodes?: ILoaderNode[];
-        samplers?: ILoaderSampler[];
-        scenes?: ILoaderScene[];
-        skins?: ILoaderSkin[];
-        textures?: ILoaderTexture[];
+    interface IGLTF extends GLTF2.IGLTF {
+        accessors?: IAccessor[];
+        animations?: IAnimation[];
+        buffers?: IBuffer[];
+        bufferViews?: IBufferView[];
+        cameras?: ICamera[];
+        images?: IImage[];
+        materials?: IMaterial[];
+        meshes?: IMesh[];
+        nodes?: INode[];
+        samplers?: ISampler[];
+        scenes?: IScene[];
+        skins?: ISkin[];
+        textures?: ITexture[];
     }
 }
 
@@ -566,14 +566,14 @@ declare module BABYLON.GLTF2 {
          * Assign an `index` field to each item of the given array.
          * @param array The array of items
          */
-        static Assign(array?: IArrayItem[]): void;
+        static Assign(array?: Loader.IArrayItem[]): void;
     }
     /**
      * The glTF 2.0 loader
      */
     class GLTFLoader implements IGLTFLoader {
         /** The glTF object parsed from the JSON. */
-        gltf: ILoaderGLTF;
+        gltf: Loader.IGLTF;
         /** The Babylon scene when loading the asset. */
         babylonScene: Scene;
         /** @hidden */
@@ -634,7 +634,7 @@ declare module BABYLON.GLTF2 {
          * @param scene The glTF scene property
          * @returns A promise that resolves when the load is complete
          */
-        loadSceneAsync(context: string, scene: ILoaderScene): Promise<void>;
+        loadSceneAsync(context: string, scene: Loader.IScene): Promise<void>;
         private _forEachPrimitive;
         private _getMeshes;
         private _getSkeletons;
@@ -647,7 +647,7 @@ declare module BABYLON.GLTF2 {
          * @param assign A function called synchronously after parsing the glTF properties
          * @returns A promise that resolves with the loaded Babylon mesh when the load is complete
          */
-        loadNodeAsync(context: string, node: ILoaderNode, assign?: (babylonMesh: Mesh) => void): Promise<Mesh>;
+        loadNodeAsync(context: string, node: Loader.INode, assign?: (babylonMesh: Mesh) => void): Promise<Mesh>;
         private _loadMeshAsync;
         private _loadMeshPrimitiveAsync;
         private _loadVertexDataAsync;
@@ -668,7 +668,7 @@ declare module BABYLON.GLTF2 {
          * @param assign A function called synchronously after parsing the glTF properties
          * @returns A promise that resolves with the loaded Babylon camera when the load is complete
          */
-        loadCameraAsync(context: string, camera: ILoaderCamera, assign?: (babylonCamera: Camera) => void): Promise<Camera>;
+        loadCameraAsync(context: string, camera: Loader.ICamera, assign?: (babylonCamera: Camera) => void): Promise<Camera>;
         private _loadAnimationsAsync;
         /**
          * Loads a glTF animation.
@@ -676,7 +676,7 @@ declare module BABYLON.GLTF2 {
          * @param animation The glTF animation property
          * @returns A promise that resolves with the loaded Babylon animation group when the load is complete
          */
-        loadAnimationAsync(context: string, animation: ILoaderAnimation): Promise<AnimationGroup>;
+        loadAnimationAsync(context: string, animation: Loader.IAnimation): Promise<AnimationGroup>;
         private _loadAnimationChannelAsync;
         private _loadAnimationSamplerAsync;
         private _loadBufferAsync;
@@ -686,14 +686,14 @@ declare module BABYLON.GLTF2 {
          * @param bufferView The glTF buffer view property
          * @returns A promise that resolves with the loaded data when the load is complete
          */
-        loadBufferViewAsync(context: string, bufferView: ILoaderBufferView): Promise<ArrayBufferView>;
+        loadBufferViewAsync(context: string, bufferView: Loader.IBufferView): Promise<ArrayBufferView>;
         private _loadIndicesAccessorAsync;
         private _loadFloatAccessorAsync;
         private _loadVertexBufferViewAsync;
         private _loadVertexAccessorAsync;
         private _loadMaterialMetallicRoughnessPropertiesAsync;
         /** @hidden */
-        _loadMaterialAsync(context: string, material: ILoaderMaterial, babylonMesh: Mesh, babylonDrawMode: number, assign?: (babylonMaterial: Material) => void): Promise<Material>;
+        _loadMaterialAsync(context: string, material: Loader.IMaterial, babylonMesh: Mesh, babylonDrawMode: number, assign?: (babylonMaterial: Material) => void): Promise<Material>;
         private _createDefaultMaterial;
         /**
          * Creates a Babylon material from a glTF material.
@@ -702,7 +702,7 @@ declare module BABYLON.GLTF2 {
          * @param babylonDrawMode The draw mode for the Babylon material
          * @returns The Babylon material
          */
-        createMaterial(context: string, material: ILoaderMaterial, babylonDrawMode: number): Material;
+        createMaterial(context: string, material: Loader.IMaterial, babylonDrawMode: number): Material;
         /**
          * Loads properties from a glTF material into a Babylon material.
          * @param context The context when loading the asset
@@ -710,7 +710,7 @@ declare module BABYLON.GLTF2 {
          * @param babylonMaterial The Babylon material
          * @returns A promise that resolves when the load is complete
          */
-        loadMaterialPropertiesAsync(context: string, material: ILoaderMaterial, babylonMaterial: Material): Promise<void>;
+        loadMaterialPropertiesAsync(context: string, material: Loader.IMaterial, babylonMaterial: Material): Promise<void>;
         /**
          * Loads the normal, occlusion, and emissive properties from a glTF material into a Babylon material.
          * @param context The context when loading the asset
@@ -718,7 +718,7 @@ declare module BABYLON.GLTF2 {
          * @param babylonMaterial The Babylon material
          * @returns A promise that resolves when the load is complete
          */
-        loadMaterialBasePropertiesAsync(context: string, material: ILoaderMaterial, babylonMaterial: Material): Promise<void>;
+        loadMaterialBasePropertiesAsync(context: string, material: Loader.IMaterial, babylonMaterial: Material): Promise<void>;
         /**
          * Loads the alpha properties from a glTF material into a Babylon material.
          * Must be called after the setting the albedo texture of the Babylon material when the material has an albedo texture.
@@ -726,7 +726,7 @@ declare module BABYLON.GLTF2 {
          * @param material The glTF material property
          * @param babylonMaterial The Babylon material
          */
-        loadMaterialAlphaProperties(context: string, material: ILoaderMaterial, babylonMaterial: Material): void;
+        loadMaterialAlphaProperties(context: string, material: Loader.IMaterial, babylonMaterial: Material): void;
         /**
          * Loads a glTF texture info.
          * @param context The context when loading the asset
@@ -734,7 +734,7 @@ declare module BABYLON.GLTF2 {
          * @param assign A function called synchronously after parsing the glTF properties
          * @returns A promise that resolves with the loaded Babylon texture when the load is complete
          */
-        loadTextureInfoAsync(context: string, textureInfo: ILoaderTextureInfo, assign?: (babylonTexture: BaseTexture) => void): Promise<BaseTexture>;
+        loadTextureInfoAsync(context: string, textureInfo: Loader.ITextureInfo, assign?: (babylonTexture: BaseTexture) => void): Promise<BaseTexture>;
         private _loadTextureAsync;
         private _loadSampler;
         /**
@@ -743,7 +743,7 @@ declare module BABYLON.GLTF2 {
          * @param image The glTF image property
          * @returns A promise that resolves with the loaded data when the load is complete
          */
-        loadImageAsync(context: string, image: ILoaderImage): Promise<ArrayBufferView>;
+        loadImageAsync(context: string, image: Loader.IImage): Promise<ArrayBufferView>;
         /**
          * Loads a glTF uri.
          * @param context The context when loading the asset
@@ -839,7 +839,7 @@ declare module BABYLON.GLTF2 {
          * @param scene The glTF scene property
          * @returns A promise that resolves when the load is complete or null if not handled
          */
-        loadSceneAsync?(context: string, scene: ILoaderScene): Nullable<Promise<void>>;
+        loadSceneAsync?(context: string, scene: Loader.IScene): Nullable<Promise<void>>;
         /**
          * Define this method to modify the default behavior when loading nodes.
          * @param context The context when loading the asset
@@ -847,7 +847,7 @@ declare module BABYLON.GLTF2 {
          * @param assign A function called synchronously after parsing the glTF properties
          * @returns A promise that resolves with the loaded Babylon mesh when the load is complete or null if not handled
          */
-        loadNodeAsync?(context: string, node: ILoaderNode, assign: (babylonMesh: Mesh) => void): Nullable<Promise<Mesh>>;
+        loadNodeAsync?(context: string, node: Loader.INode, assign: (babylonMesh: Mesh) => void): Nullable<Promise<Mesh>>;
         /**
          * Define this method to modify the default behavior when loading cameras.
          * @param context The context when loading the asset
@@ -855,14 +855,14 @@ declare module BABYLON.GLTF2 {
          * @param assign A function called synchronously after parsing the glTF properties
          * @returns A promise that resolves with the loaded Babylon camera when the load is complete or null if not handled
          */
-        loadCameraAsync?(context: string, camera: ILoaderCamera, assign: (babylonCamera: Camera) => void): Nullable<Promise<Camera>>;
+        loadCameraAsync?(context: string, camera: Loader.ICamera, assign: (babylonCamera: Camera) => void): Nullable<Promise<Camera>>;
         /**
          * @hidden Define this method to modify the default behavior when loading vertex data for mesh primitives.
          * @param context The context when loading the asset
          * @param primitive The glTF mesh primitive property
          * @returns A promise that resolves with the loaded geometry when the load is complete or null if not handled
          */
-        _loadVertexDataAsync?(context: string, primitive: ILoaderMeshPrimitive, babylonMesh: Mesh): Nullable<Promise<Geometry>>;
+        _loadVertexDataAsync?(context: string, primitive: Loader.IMeshPrimitive, babylonMesh: Mesh): Nullable<Promise<Geometry>>;
         /**
          * @hidden Define this method to modify the default behavior when loading materials. Load material creates the material and then loads material properties.
          * @param context The context when loading the asset
@@ -870,7 +870,7 @@ declare module BABYLON.GLTF2 {
          * @param assign A function called synchronously after parsing the glTF properties
          * @returns A promise that resolves with the loaded Babylon material when the load is complete or null if not handled
          */
-        _loadMaterialAsync?(context: string, material: ILoaderMaterial, babylonMesh: Mesh, babylonDrawMode: number, assign: (babylonMaterial: Material) => void): Nullable<Promise<Material>>;
+        _loadMaterialAsync?(context: string, material: Loader.IMaterial, babylonMesh: Mesh, babylonDrawMode: number, assign: (babylonMaterial: Material) => void): Nullable<Promise<Material>>;
         /**
          * Define this method to modify the default behavior when creating materials.
          * @param context The context when loading the asset
@@ -878,7 +878,7 @@ declare module BABYLON.GLTF2 {
          * @param babylonDrawMode The draw mode for the Babylon material
          * @returns The Babylon material or null if not handled
          */
-        createMaterial?(context: string, material: ILoaderMaterial, babylonDrawMode: number): Nullable<Material>;
+        createMaterial?(context: string, material: Loader.IMaterial, babylonDrawMode: number): Nullable<Material>;
         /**
          * Define this method to modify the default behavior when loading material properties.
          * @param context The context when loading the asset
@@ -886,7 +886,7 @@ declare module BABYLON.GLTF2 {
          * @param babylonMaterial The Babylon material
          * @returns A promise that resolves when the load is complete or null if not handled
          */
-        loadMaterialPropertiesAsync?(context: string, material: ILoaderMaterial, babylonMaterial: Material): Nullable<Promise<void>>;
+        loadMaterialPropertiesAsync?(context: string, material: Loader.IMaterial, babylonMaterial: Material): Nullable<Promise<void>>;
         /**
          * Define this method to modify the default behavior when loading texture infos.
          * @param context The context when loading the asset
@@ -894,14 +894,14 @@ declare module BABYLON.GLTF2 {
          * @param assign A function called synchronously after parsing the glTF properties
          * @returns A promise that resolves with the loaded Babylon texture when the load is complete or null if not handled
          */
-        loadTextureInfoAsync?(context: string, textureInfo: ITextureInfo, assign: (babylonTexture: BaseTexture) => void): Nullable<Promise<BaseTexture>>;
+        loadTextureInfoAsync?(context: string, textureInfo: Loader.ITextureInfo, assign: (babylonTexture: BaseTexture) => void): Nullable<Promise<BaseTexture>>;
         /**
          * Define this method to modify the default behavior when loading animations.
          * @param context The context when loading the asset
          * @param animation The glTF animation property
          * @returns A promise that resolves with the loaded Babylon animation group when the load is complete or null if not handled
          */
-        loadAnimationAsync?(context: string, animation: IAnimation): Nullable<Promise<AnimationGroup>>;
+        loadAnimationAsync?(context: string, animation: Loader.IAnimation): Nullable<Promise<AnimationGroup>>;
         /**
          * Define this method to modify the default behavior when loading uris.
          * @param context The context when loading the asset
@@ -914,11 +914,11 @@ declare module BABYLON.GLTF2 {
 /**
  * Defines the module for the built-in glTF 2.0 loader extensions.
  */
-declare module BABYLON.GLTF2.Extensions {
+declare module BABYLON.GLTF2.Loader.Extensions {
 }
 
 
-declare module BABYLON.GLTF2.Extensions {
+declare module BABYLON.GLTF2.Loader.Extensions {
     /**
      * [Specification](https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Vendor/MSFT_lod)
      */
@@ -957,9 +957,9 @@ declare module BABYLON.GLTF2.Extensions {
         /** @hidden */
         onReady(): void;
         /** @hidden */
-        loadNodeAsync(context: string, node: ILoaderNode, assign: (babylonMesh: Mesh) => void): Nullable<Promise<Mesh>>;
+        loadNodeAsync(context: string, node: INode, assign: (babylonMesh: Mesh) => void): Nullable<Promise<Mesh>>;
         /** @hidden */
-        _loadMaterialAsync(context: string, material: ILoaderMaterial, babylonMesh: Mesh, babylonDrawMode: number, assign: (babylonMaterial: Material) => void): Nullable<Promise<Material>>;
+        _loadMaterialAsync(context: string, material: IMaterial, babylonMesh: Mesh, babylonDrawMode: number, assign: (babylonMaterial: Material) => void): Nullable<Promise<Material>>;
         /** @hidden */
         _loadUriAsync(context: string, uri: string): Nullable<Promise<ArrayBufferView>>;
         /**
@@ -971,7 +971,7 @@ declare module BABYLON.GLTF2.Extensions {
 }
 
 
-declare module BABYLON.GLTF2.Extensions {
+declare module BABYLON.GLTF2.Loader.Extensions {
     /** @hidden */
     class MSFT_minecraftMesh implements IGLTFLoaderExtension {
         readonly name: string;
@@ -979,12 +979,12 @@ declare module BABYLON.GLTF2.Extensions {
         private _loader;
         constructor(loader: GLTFLoader);
         dispose(): void;
-        loadMaterialPropertiesAsync(context: string, material: ILoaderMaterial, babylonMaterial: Material): Nullable<Promise<void>>;
+        loadMaterialPropertiesAsync(context: string, material: IMaterial, babylonMaterial: Material): Nullable<Promise<void>>;
     }
 }
 
 
-declare module BABYLON.GLTF2.Extensions {
+declare module BABYLON.GLTF2.Loader.Extensions {
     /** @hidden */
     class MSFT_sRGBFactors implements IGLTFLoaderExtension {
         readonly name: string;
@@ -992,12 +992,12 @@ declare module BABYLON.GLTF2.Extensions {
         private _loader;
         constructor(loader: GLTFLoader);
         dispose(): void;
-        loadMaterialPropertiesAsync(context: string, material: ILoaderMaterial, babylonMaterial: Material): Nullable<Promise<void>>;
+        loadMaterialPropertiesAsync(context: string, material: IMaterial, babylonMaterial: Material): Nullable<Promise<void>>;
     }
 }
 
 
-declare module BABYLON.GLTF2.Extensions {
+declare module BABYLON.GLTF2.Loader.Extensions {
     /**
      * [Specification](https://github.com/najadojo/glTF/tree/MSFT_audio_emitter/extensions/2.0/Vendor/MSFT_audio_emitter)
      */
@@ -1016,11 +1016,11 @@ declare module BABYLON.GLTF2.Extensions {
         /** @hidden */
         onLoading(): void;
         /** @hidden */
-        loadSceneAsync(context: string, scene: ILoaderScene): Nullable<Promise<void>>;
+        loadSceneAsync(context: string, scene: IScene): Nullable<Promise<void>>;
         /** @hidden */
-        loadNodeAsync(context: string, node: ILoaderNode, assign: (babylonMesh: Mesh) => void): Nullable<Promise<Mesh>>;
+        loadNodeAsync(context: string, node: INode, assign: (babylonMesh: Mesh) => void): Nullable<Promise<Mesh>>;
         /** @hidden */
-        loadAnimationAsync(context: string, animation: ILoaderAnimation): Nullable<Promise<AnimationGroup>>;
+        loadAnimationAsync(context: string, animation: IAnimation): Nullable<Promise<AnimationGroup>>;
         private _loadClipAsync;
         private _loadEmitterAsync;
         private _getEventAction;
@@ -1029,7 +1029,7 @@ declare module BABYLON.GLTF2.Extensions {
 }
 
 
-declare module BABYLON.GLTF2.Extensions {
+declare module BABYLON.GLTF2.Loader.Extensions {
     /**
      * [Specification](https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Khronos/KHR_draco_mesh_compression)
      */
@@ -1045,12 +1045,12 @@ declare module BABYLON.GLTF2.Extensions {
         /** @hidden */
         dispose(): void;
         /** @hidden */
-        _loadVertexDataAsync(context: string, primitive: ILoaderMeshPrimitive, babylonMesh: Mesh): Nullable<Promise<Geometry>>;
+        _loadVertexDataAsync(context: string, primitive: IMeshPrimitive, babylonMesh: Mesh): Nullable<Promise<Geometry>>;
     }
 }
 
 
-declare module BABYLON.GLTF2.Extensions {
+declare module BABYLON.GLTF2.Loader.Extensions {
     /**
      * [Specification](https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Khronos/KHR_materials_pbrSpecularGlossiness)
      */
@@ -1065,13 +1065,13 @@ declare module BABYLON.GLTF2.Extensions {
         /** @hidden */
         dispose(): void;
         /** @hidden */
-        loadMaterialPropertiesAsync(context: string, material: ILoaderMaterial, babylonMaterial: Material): Nullable<Promise<void>>;
+        loadMaterialPropertiesAsync(context: string, material: IMaterial, babylonMaterial: Material): Nullable<Promise<void>>;
         private _loadSpecularGlossinessPropertiesAsync;
     }
 }
 
 
-declare module BABYLON.GLTF2.Extensions {
+declare module BABYLON.GLTF2.Loader.Extensions {
     /**
      * [Specification](https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Khronos/KHR_materials_unlit)
      */
@@ -1086,13 +1086,13 @@ declare module BABYLON.GLTF2.Extensions {
         /** @hidden */
         dispose(): void;
         /** @hidden */
-        loadMaterialPropertiesAsync(context: string, material: ILoaderMaterial, babylonMaterial: Material): Nullable<Promise<void>>;
+        loadMaterialPropertiesAsync(context: string, material: IMaterial, babylonMaterial: Material): Nullable<Promise<void>>;
         private _loadUnlitPropertiesAsync;
     }
 }
 
 
-declare module BABYLON.GLTF2.Extensions {
+declare module BABYLON.GLTF2.Loader.Extensions {
     /**
      * [Specification](https://github.com/KhronosGroup/glTF/blob/1048d162a44dbcb05aefc1874bfd423cf60135a6/extensions/2.0/Khronos/KHR_lights_punctual/README.md) (Experimental)
      */
@@ -1110,14 +1110,14 @@ declare module BABYLON.GLTF2.Extensions {
         /** @hidden */
         onLoading(): void;
         /** @hidden */
-        loadNodeAsync(context: string, node: ILoaderNode, assign: (babylonMesh: Mesh) => void): Nullable<Promise<Mesh>>;
+        loadNodeAsync(context: string, node: INode, assign: (babylonMesh: Mesh) => void): Nullable<Promise<Mesh>>;
     }
 }
 
 
-declare module BABYLON.GLTF2.Extensions {
+declare module BABYLON.GLTF2.Loader.Extensions {
     /**
-     * [Specification](https://github.com/AltspaceVR/glTF/blob/avr-sampler-offset-tile/extensions/2.0/Khronos/KHR_texture_transform/README.md) (Experimental)
+     * [Specification](https://github.com/KhronosGroup/glTF/blob/master/extensions/2.0/Khronos/KHR_texture_transform/README.md)
      */
     class KHR_texture_transform implements IGLTFLoaderExtension {
         /** The name of this extension. */
@@ -1135,7 +1135,7 @@ declare module BABYLON.GLTF2.Extensions {
 }
 
 
-declare module BABYLON.GLTF2.Extensions {
+declare module BABYLON.GLTF2.Loader.Extensions {
     /**
      * [Specification](https://github.com/KhronosGroup/glTF/blob/eb3e32332042e04691a5f35103f8c261e50d8f1e/extensions/2.0/Khronos/EXT_lights_image_based/README.md) (Experimental)
      */
@@ -1153,7 +1153,7 @@ declare module BABYLON.GLTF2.Extensions {
         /** @hidden */
         onLoading(): void;
         /** @hidden */
-        loadSceneAsync(context: string, scene: ILoaderScene): Nullable<Promise<void>>;
+        loadSceneAsync(context: string, scene: IScene): Nullable<Promise<void>>;
         private _loadLightAsync;
     }
 }

文件差異過大導致無法顯示
+ 945 - 915
dist/preview release/loaders/babylon.glTF2FileLoader.js


文件差異過大導致無法顯示
+ 1 - 1
dist/preview release/loaders/babylon.glTF2FileLoader.min.js


+ 96 - 96
dist/preview release/loaders/babylon.glTFFileLoader.d.ts

@@ -913,7 +913,7 @@ declare module BABYLON.GLTF1 {
 }
 
 
-declare module BABYLON.GLTF2 {
+declare module BABYLON.GLTF2.Loader {
     /**
      * Loader interface with an index field.
      */
@@ -926,7 +926,7 @@ declare module BABYLON.GLTF2 {
     /**
      * Loader interface with additional members.
      */
-    interface ILoaderAccessor extends IAccessor, IArrayItem {
+    interface IAccessor extends GLTF2.IAccessor, IArrayItem {
         /** @hidden */
         _data?: Promise<ArrayBufferView>;
         /** @hidden */
@@ -935,10 +935,10 @@ declare module BABYLON.GLTF2 {
     /**
      * Loader interface with additional members.
      */
-    interface ILoaderAnimationChannel extends IAnimationChannel, IArrayItem {
+    interface IAnimationChannel extends GLTF2.IAnimationChannel, IArrayItem {
     }
     /** @hidden */
-    interface _ILoaderAnimationSamplerData {
+    interface _IAnimationSamplerData {
         input: Float32Array;
         interpolation: AnimationSamplerInterpolation;
         output: Float32Array;
@@ -946,30 +946,30 @@ declare module BABYLON.GLTF2 {
     /**
      * Loader interface with additional members.
      */
-    interface ILoaderAnimationSampler extends IAnimationSampler, IArrayItem {
+    interface IAnimationSampler extends GLTF2.IAnimationSampler, IArrayItem {
         /** @hidden */
-        _data?: Promise<_ILoaderAnimationSamplerData>;
+        _data?: Promise<_IAnimationSamplerData>;
     }
     /**
      * Loader interface with additional members.
      */
-    interface ILoaderAnimation extends IAnimation, IArrayItem {
-        channels: ILoaderAnimationChannel[];
-        samplers: ILoaderAnimationSampler[];
+    interface IAnimation extends GLTF2.IAnimation, IArrayItem {
+        channels: IAnimationChannel[];
+        samplers: IAnimationSampler[];
         /** @hidden */
         _babylonAnimationGroup?: AnimationGroup;
     }
     /**
      * Loader interface with additional members.
      */
-    interface ILoaderBuffer extends IBuffer, IArrayItem {
+    interface IBuffer extends GLTF2.IBuffer, IArrayItem {
         /** @hidden */
         _data?: Promise<ArrayBufferView>;
     }
     /**
      * Loader interface with additional members.
      */
-    interface ILoaderBufferView extends IBufferView, IArrayItem {
+    interface IBufferView extends GLTF2.IBufferView, IArrayItem {
         /** @hidden */
         _data?: Promise<ArrayBufferView>;
         /** @hidden */
@@ -978,40 +978,40 @@ declare module BABYLON.GLTF2 {
     /**
      * Loader interface with additional members.
      */
-    interface ILoaderCamera extends ICamera, IArrayItem {
+    interface ICamera extends GLTF2.ICamera, IArrayItem {
     }
     /**
      * Loader interface with additional members.
      */
-    interface ILoaderImage extends IImage, IArrayItem {
+    interface IImage extends GLTF2.IImage, IArrayItem {
         /** @hidden */
         _data?: Promise<ArrayBufferView>;
     }
     /**
      * Loader interface with additional members.
      */
-    interface ILoaderMaterialNormalTextureInfo extends IMaterialNormalTextureInfo, ILoaderTextureInfo {
+    interface IMaterialNormalTextureInfo extends GLTF2.IMaterialNormalTextureInfo, ITextureInfo {
     }
     /**
      * Loader interface with additional members.
      */
-    interface ILoaderMaterialOcclusionTextureInfo extends IMaterialOcclusionTextureInfo, ILoaderTextureInfo {
+    interface IMaterialOcclusionTextureInfo extends GLTF2.IMaterialOcclusionTextureInfo, ITextureInfo {
     }
     /**
      * Loader interface with additional members.
      */
-    interface ILoaderMaterialPbrMetallicRoughness extends IMaterialPbrMetallicRoughness {
-        baseColorTexture?: ILoaderTextureInfo;
-        metallicRoughnessTexture?: ILoaderTextureInfo;
+    interface IMaterialPbrMetallicRoughness extends GLTF2.IMaterialPbrMetallicRoughness {
+        baseColorTexture?: ITextureInfo;
+        metallicRoughnessTexture?: ITextureInfo;
     }
     /**
      * Loader interface with additional members.
      */
-    interface ILoaderMaterial extends IMaterial, IArrayItem {
-        pbrMetallicRoughness?: ILoaderMaterialPbrMetallicRoughness;
-        normalTexture?: ILoaderMaterialNormalTextureInfo;
-        occlusionTexture?: ILoaderMaterialOcclusionTextureInfo;
-        emissiveTexture?: ILoaderTextureInfo;
+    interface IMaterial extends GLTF2.IMaterial, IArrayItem {
+        pbrMetallicRoughness?: IMaterialPbrMetallicRoughness;
+        normalTexture?: IMaterialNormalTextureInfo;
+        occlusionTexture?: IMaterialOcclusionTextureInfo;
+        emissiveTexture?: ITextureInfo;
         /** @hidden */
         _babylonData?: {
             [drawMode: number]: {
@@ -1024,22 +1024,22 @@ declare module BABYLON.GLTF2 {
     /**
      * Loader interface with additional members.
      */
-    interface ILoaderMesh extends IMesh, IArrayItem {
-        primitives: ILoaderMeshPrimitive[];
+    interface IMesh extends GLTF2.IMesh, IArrayItem {
+        primitives: IMeshPrimitive[];
     }
     /**
      * Loader interface with additional members.
      */
-    interface ILoaderMeshPrimitive extends IMeshPrimitive, IArrayItem {
+    interface IMeshPrimitive extends GLTF2.IMeshPrimitive, IArrayItem {
     }
     /**
      * Loader interface with additional members.
      */
-    interface ILoaderNode extends INode, IArrayItem {
+    interface INode extends GLTF2.INode, IArrayItem {
         /**
          * The parent glTF node.
          */
-        parent?: ILoaderNode;
+        parent?: INode;
         /** @hidden */
         _babylonMesh?: Mesh;
         /** @hidden */
@@ -1050,7 +1050,7 @@ declare module BABYLON.GLTF2 {
         _numMorphTargets?: number;
     }
     /** @hidden */
-    interface _ILoaderSamplerData {
+    interface _ISamplerData {
         noMipMaps: boolean;
         samplingMode: number;
         wrapU: number;
@@ -1059,19 +1059,19 @@ declare module BABYLON.GLTF2 {
     /**
      * Loader interface with additional members.
      */
-    interface ILoaderSampler extends ISampler, IArrayItem {
+    interface ISampler extends GLTF2.ISampler, IArrayItem {
         /** @hidden */
-        _data?: _ILoaderSamplerData;
+        _data?: _ISamplerData;
     }
     /**
      * Loader interface with additional members.
      */
-    interface ILoaderScene extends IScene, IArrayItem {
+    interface IScene extends GLTF2.IScene, IArrayItem {
     }
     /**
      * Loader interface with additional members.
      */
-    interface ILoaderSkin extends ISkin, IArrayItem {
+    interface ISkin extends GLTF2.ISkin, IArrayItem {
         /** @hidden */
         _babylonSkeleton?: Skeleton;
         /** @hidden */
@@ -1080,30 +1080,30 @@ declare module BABYLON.GLTF2 {
     /**
      * Loader interface with additional members.
      */
-    interface ILoaderTexture extends ITexture, IArrayItem {
+    interface ITexture extends GLTF2.ITexture, IArrayItem {
     }
     /**
      * Loader interface with additional members.
      */
-    interface ILoaderTextureInfo extends ITextureInfo {
+    interface ITextureInfo extends GLTF2.ITextureInfo {
     }
     /**
      * Loader interface with additional members.
      */
-    interface ILoaderGLTF extends IGLTF {
-        accessors?: ILoaderAccessor[];
-        animations?: ILoaderAnimation[];
-        buffers?: ILoaderBuffer[];
-        bufferViews?: ILoaderBufferView[];
-        cameras?: ILoaderCamera[];
-        images?: ILoaderImage[];
-        materials?: ILoaderMaterial[];
-        meshes?: ILoaderMesh[];
-        nodes?: ILoaderNode[];
-        samplers?: ILoaderSampler[];
-        scenes?: ILoaderScene[];
-        skins?: ILoaderSkin[];
-        textures?: ILoaderTexture[];
+    interface IGLTF extends GLTF2.IGLTF {
+        accessors?: IAccessor[];
+        animations?: IAnimation[];
+        buffers?: IBuffer[];
+        bufferViews?: IBufferView[];
+        cameras?: ICamera[];
+        images?: IImage[];
+        materials?: IMaterial[];
+        meshes?: IMesh[];
+        nodes?: INode[];
+        samplers?: ISampler[];
+        scenes?: IScene[];
+        skins?: ISkin[];
+        textures?: ITexture[];
     }
 }
 
@@ -1128,14 +1128,14 @@ declare module BABYLON.GLTF2 {
          * Assign an `index` field to each item of the given array.
          * @param array The array of items
          */
-        static Assign(array?: IArrayItem[]): void;
+        static Assign(array?: Loader.IArrayItem[]): void;
     }
     /**
      * The glTF 2.0 loader
      */
     class GLTFLoader implements IGLTFLoader {
         /** The glTF object parsed from the JSON. */
-        gltf: ILoaderGLTF;
+        gltf: Loader.IGLTF;
         /** The Babylon scene when loading the asset. */
         babylonScene: Scene;
         /** @hidden */
@@ -1196,7 +1196,7 @@ declare module BABYLON.GLTF2 {
          * @param scene The glTF scene property
          * @returns A promise that resolves when the load is complete
          */
-        loadSceneAsync(context: string, scene: ILoaderScene): Promise<void>;
+        loadSceneAsync(context: string, scene: Loader.IScene): Promise<void>;
         private _forEachPrimitive;
         private _getMeshes;
         private _getSkeletons;
@@ -1209,7 +1209,7 @@ declare module BABYLON.GLTF2 {
          * @param assign A function called synchronously after parsing the glTF properties
          * @returns A promise that resolves with the loaded Babylon mesh when the load is complete
          */
-        loadNodeAsync(context: string, node: ILoaderNode, assign?: (babylonMesh: Mesh) => void): Promise<Mesh>;
+        loadNodeAsync(context: string, node: Loader.INode, assign?: (babylonMesh: Mesh) => void): Promise<Mesh>;
         private _loadMeshAsync;
         private _loadMeshPrimitiveAsync;
         private _loadVertexDataAsync;
@@ -1230,7 +1230,7 @@ declare module BABYLON.GLTF2 {
          * @param assign A function called synchronously after parsing the glTF properties
          * @returns A promise that resolves with the loaded Babylon camera when the load is complete
          */
-        loadCameraAsync(context: string, camera: ILoaderCamera, assign?: (babylonCamera: Camera) => void): Promise<Camera>;
+        loadCameraAsync(context: string, camera: Loader.ICamera, assign?: (babylonCamera: Camera) => void): Promise<Camera>;
         private _loadAnimationsAsync;
         /**
          * Loads a glTF animation.
@@ -1238,7 +1238,7 @@ declare module BABYLON.GLTF2 {
          * @param animation The glTF animation property
          * @returns A promise that resolves with the loaded Babylon animation group when the load is complete
          */
-        loadAnimationAsync(context: string, animation: ILoaderAnimation): Promise<AnimationGroup>;
+        loadAnimationAsync(context: string, animation: Loader.IAnimation): Promise<AnimationGroup>;
         private _loadAnimationChannelAsync;
         private _loadAnimationSamplerAsync;
         private _loadBufferAsync;
@@ -1248,14 +1248,14 @@ declare module BABYLON.GLTF2 {
          * @param bufferView The glTF buffer view property
          * @returns A promise that resolves with the loaded data when the load is complete
          */
-        loadBufferViewAsync(context: string, bufferView: ILoaderBufferView): Promise<ArrayBufferView>;
+        loadBufferViewAsync(context: string, bufferView: Loader.IBufferView): Promise<ArrayBufferView>;
         private _loadIndicesAccessorAsync;
         private _loadFloatAccessorAsync;
         private _loadVertexBufferViewAsync;
         private _loadVertexAccessorAsync;
         private _loadMaterialMetallicRoughnessPropertiesAsync;
         /** @hidden */
-        _loadMaterialAsync(context: string, material: ILoaderMaterial, babylonMesh: Mesh, babylonDrawMode: number, assign?: (babylonMaterial: Material) => void): Promise<Material>;
+        _loadMaterialAsync(context: string, material: Loader.IMaterial, babylonMesh: Mesh, babylonDrawMode: number, assign?: (babylonMaterial: Material) => void): Promise<Material>;
         private _createDefaultMaterial;
         /**
          * Creates a Babylon material from a glTF material.
@@ -1264,7 +1264,7 @@ declare module BABYLON.GLTF2 {
          * @param babylonDrawMode The draw mode for the Babylon material
          * @returns The Babylon material
          */
-        createMaterial(context: string, material: ILoaderMaterial, babylonDrawMode: number): Material;
+        createMaterial(context: string, material: Loader.IMaterial, babylonDrawMode: number): Material;
         /**
          * Loads properties from a glTF material into a Babylon material.
          * @param context The context when loading the asset
@@ -1272,7 +1272,7 @@ declare module BABYLON.GLTF2 {
          * @param babylonMaterial The Babylon material
          * @returns A promise that resolves when the load is complete
          */
-        loadMaterialPropertiesAsync(context: string, material: ILoaderMaterial, babylonMaterial: Material): Promise<void>;
+        loadMaterialPropertiesAsync(context: string, material: Loader.IMaterial, babylonMaterial: Material): Promise<void>;
         /**
          * Loads the normal, occlusion, and emissive properties from a glTF material into a Babylon material.
          * @param context The context when loading the asset
@@ -1280,7 +1280,7 @@ declare module BABYLON.GLTF2 {
          * @param babylonMaterial The Babylon material
          * @returns A promise that resolves when the load is complete
          */
-        loadMaterialBasePropertiesAsync(context: string, material: ILoaderMaterial, babylonMaterial: Material): Promise<void>;
+        loadMaterialBasePropertiesAsync(context: string, material: Loader.IMaterial, babylonMaterial: Material): Promise<void>;
         /**
          * Loads the alpha properties from a glTF material into a Babylon material.
          * Must be called after the setting the albedo texture of the Babylon material when the material has an albedo texture.
@@ -1288,7 +1288,7 @@ declare module BABYLON.GLTF2 {
          * @param material The glTF material property
          * @param babylonMaterial The Babylon material
          */
-        loadMaterialAlphaProperties(context: string, material: ILoaderMaterial, babylonMaterial: Material): void;
+        loadMaterialAlphaProperties(context: string, material: Loader.IMaterial, babylonMaterial: Material): void;
         /**
          * Loads a glTF texture info.
          * @param context The context when loading the asset
@@ -1296,7 +1296,7 @@ declare module BABYLON.GLTF2 {
          * @param assign A function called synchronously after parsing the glTF properties
          * @returns A promise that resolves with the loaded Babylon texture when the load is complete
          */
-        loadTextureInfoAsync(context: string, textureInfo: ILoaderTextureInfo, assign?: (babylonTexture: BaseTexture) => void): Promise<BaseTexture>;
+        loadTextureInfoAsync(context: string, textureInfo: Loader.ITextureInfo, assign?: (babylonTexture: BaseTexture) => void): Promise<BaseTexture>;
         private _loadTextureAsync;
         private _loadSampler;
         /**
@@ -1305,7 +1305,7 @@ declare module BABYLON.GLTF2 {
          * @param image The glTF image property
          * @returns A promise that resolves with the loaded data when the load is complete
          */
-        loadImageAsync(context: string, image: ILoaderImage): Promise<ArrayBufferView>;
+        loadImageAsync(context: string, image: Loader.IImage): Promise<ArrayBufferView>;
         /**
          * Loads a glTF uri.
          * @param context The context when loading the asset
@@ -1401,7 +1401,7 @@ declare module BABYLON.GLTF2 {
          * @param scene The glTF scene property
          * @returns A promise that resolves when the load is complete or null if not handled
          */
-        loadSceneAsync?(context: string, scene: ILoaderScene): Nullable<Promise<void>>;
+        loadSceneAsync?(context: string, scene: Loader.IScene): Nullable<Promise<void>>;
         /**
          * Define this method to modify the default behavior when loading nodes.
          * @param context The context when loading the asset
@@ -1409,7 +1409,7 @@ declare module BABYLON.GLTF2 {
          * @param assign A function called synchronously after parsing the glTF properties
          * @returns A promise that resolves with the loaded Babylon mesh when the load is complete or null if not handled
          */
-        loadNodeAsync?(context: string, node: ILoaderNode, assign: (babylonMesh: Mesh) => void): Nullable<Promise<Mesh>>;
+        loadNodeAsync?(context: string, node: Loader.INode, assign: (babylonMesh: Mesh) => void): Nullable<Promise<Mesh>>;
         /**
          * Define this method to modify the default behavior when loading cameras.
          * @param context The context when loading the asset
@@ -1417,14 +1417,14 @@ declare module BABYLON.GLTF2 {
          * @param assign A function called synchronously after parsing the glTF properties
          * @returns A promise that resolves with the loaded Babylon camera when the load is complete or null if not handled
          */
-        loadCameraAsync?(context: string, camera: ILoaderCamera, assign: (babylonCamera: Camera) => void): Nullable<Promise<Camera>>;
+        loadCameraAsync?(context: string, camera: Loader.ICamera, assign: (babylonCamera: Camera) => void): Nullable<Promise<Camera>>;
         /**
          * @hidden Define this method to modify the default behavior when loading vertex data for mesh primitives.
          * @param context The context when loading the asset
          * @param primitive The glTF mesh primitive property
          * @returns A promise that resolves with the loaded geometry when the load is complete or null if not handled
          */
-        _loadVertexDataAsync?(context: string, primitive: ILoaderMeshPrimitive, babylonMesh: Mesh): Nullable<Promise<Geometry>>;
+        _loadVertexDataAsync?(context: string, primitive: Loader.IMeshPrimitive, babylonMesh: Mesh): Nullable<Promise<Geometry>>;
         /**
          * @hidden Define this method to modify the default behavior when loading materials. Load material creates the material and then loads material properties.
          * @param context The context when loading the asset
@@ -1432,7 +1432,7 @@ declare module BABYLON.GLTF2 {
          * @param assign A function called synchronously after parsing the glTF properties
          * @returns A promise that resolves with the loaded Babylon material when the load is complete or null if not handled
          */
-        _loadMaterialAsync?(context: string, material: ILoaderMaterial, babylonMesh: Mesh, babylonDrawMode: number, assign: (babylonMaterial: Material) => void): Nullable<Promise<Material>>;
+        _loadMaterialAsync?(context: string, material: Loader.IMaterial, babylonMesh: Mesh, babylonDrawMode: number, assign: (babylonMaterial: Material) => void): Nullable<Promise<Material>>;
         /**
          * Define this method to modify the default behavior when creating materials.
          * @param context The context when loading the asset
@@ -1440,7 +1440,7 @@ declare module BABYLON.GLTF2 {
          * @param babylonDrawMode The draw mode for the Babylon material
          * @returns The Babylon material or null if not handled
          */
-        createMaterial?(context: string, material: ILoaderMaterial, babylonDrawMode: number): Nullable<Material>;
+        createMaterial?(context: string, material: Loader.IMaterial, babylonDrawMode: number): Nullable<Material>;
         /**
          * Define this method to modify the default behavior when loading material properties.
          * @param context The context when loading the asset
@@ -1448,7 +1448,7 @@ declare module BABYLON.GLTF2 {
          * @param babylonMaterial The Babylon material
          * @returns A promise that resolves when the load is complete or null if not handled
          */
-        loadMaterialPropertiesAsync?(context: string, material: ILoaderMaterial, babylonMaterial: Material): Nullable<Promise<void>>;
+        loadMaterialPropertiesAsync?(context: string, material: Loader.IMaterial, babylonMaterial: Material): Nullable<Promise<void>>;
         /**
          * Define this method to modify the default behavior when loading texture infos.
          * @param context The context when loading the asset
@@ -1456,14 +1456,14 @@ declare module BABYLON.GLTF2 {
          * @param assign A function called synchronously after parsing the glTF properties
          * @returns A promise that resolves with the loaded Babylon texture when the load is complete or null if not handled
          */
-        loadTextureInfoAsync?(context: string, textureInfo: ITextureInfo, assign: (babylonTexture: BaseTexture) => void): Nullable<Promise<BaseTexture>>;
+        loadTextureInfoAsync?(context: string, textureInfo: Loader.ITextureInfo, assign: (babylonTexture: BaseTexture) => void): Nullable<Promise<BaseTexture>>;
         /**
          * Define this method to modify the default behavior when loading animations.
          * @param context The context when loading the asset
          * @param animation The glTF animation property
          * @returns A promise that resolves with the loaded Babylon animation group when the load is complete or null if not handled
          */
-        loadAnimationAsync?(context: string, animation: IAnimation): Nullable<Promise<AnimationGroup>>;
+        loadAnimationAsync?(context: string, animation: Loader.IAnimation): Nullable<Promise<AnimationGroup>>;
         /**
          * Define this method to modify the default behavior when loading uris.
          * @param context The context when loading the asset
@@ -1476,11 +1476,11 @@ declare module BABYLON.GLTF2 {
 /**
  * Defines the module for the built-in glTF 2.0 loader extensions.
  */
-declare module BABYLON.GLTF2.Extensions {
+declare module BABYLON.GLTF2.Loader.Extensions {
 }
 
 
-declare module BABYLON.GLTF2.Extensions {
+declare module BABYLON.GLTF2.Loader.Extensions {
     /**
      * [Specification](https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Vendor/MSFT_lod)
      */
@@ -1519,9 +1519,9 @@ declare module BABYLON.GLTF2.Extensions {
         /** @hidden */
         onReady(): void;
         /** @hidden */
-        loadNodeAsync(context: string, node: ILoaderNode, assign: (babylonMesh: Mesh) => void): Nullable<Promise<Mesh>>;
+        loadNodeAsync(context: string, node: INode, assign: (babylonMesh: Mesh) => void): Nullable<Promise<Mesh>>;
         /** @hidden */
-        _loadMaterialAsync(context: string, material: ILoaderMaterial, babylonMesh: Mesh, babylonDrawMode: number, assign: (babylonMaterial: Material) => void): Nullable<Promise<Material>>;
+        _loadMaterialAsync(context: string, material: IMaterial, babylonMesh: Mesh, babylonDrawMode: number, assign: (babylonMaterial: Material) => void): Nullable<Promise<Material>>;
         /** @hidden */
         _loadUriAsync(context: string, uri: string): Nullable<Promise<ArrayBufferView>>;
         /**
@@ -1533,7 +1533,7 @@ declare module BABYLON.GLTF2.Extensions {
 }
 
 
-declare module BABYLON.GLTF2.Extensions {
+declare module BABYLON.GLTF2.Loader.Extensions {
     /** @hidden */
     class MSFT_minecraftMesh implements IGLTFLoaderExtension {
         readonly name: string;
@@ -1541,12 +1541,12 @@ declare module BABYLON.GLTF2.Extensions {
         private _loader;
         constructor(loader: GLTFLoader);
         dispose(): void;
-        loadMaterialPropertiesAsync(context: string, material: ILoaderMaterial, babylonMaterial: Material): Nullable<Promise<void>>;
+        loadMaterialPropertiesAsync(context: string, material: IMaterial, babylonMaterial: Material): Nullable<Promise<void>>;
     }
 }
 
 
-declare module BABYLON.GLTF2.Extensions {
+declare module BABYLON.GLTF2.Loader.Extensions {
     /** @hidden */
     class MSFT_sRGBFactors implements IGLTFLoaderExtension {
         readonly name: string;
@@ -1554,12 +1554,12 @@ declare module BABYLON.GLTF2.Extensions {
         private _loader;
         constructor(loader: GLTFLoader);
         dispose(): void;
-        loadMaterialPropertiesAsync(context: string, material: ILoaderMaterial, babylonMaterial: Material): Nullable<Promise<void>>;
+        loadMaterialPropertiesAsync(context: string, material: IMaterial, babylonMaterial: Material): Nullable<Promise<void>>;
     }
 }
 
 
-declare module BABYLON.GLTF2.Extensions {
+declare module BABYLON.GLTF2.Loader.Extensions {
     /**
      * [Specification](https://github.com/najadojo/glTF/tree/MSFT_audio_emitter/extensions/2.0/Vendor/MSFT_audio_emitter)
      */
@@ -1578,11 +1578,11 @@ declare module BABYLON.GLTF2.Extensions {
         /** @hidden */
         onLoading(): void;
         /** @hidden */
-        loadSceneAsync(context: string, scene: ILoaderScene): Nullable<Promise<void>>;
+        loadSceneAsync(context: string, scene: IScene): Nullable<Promise<void>>;
         /** @hidden */
-        loadNodeAsync(context: string, node: ILoaderNode, assign: (babylonMesh: Mesh) => void): Nullable<Promise<Mesh>>;
+        loadNodeAsync(context: string, node: INode, assign: (babylonMesh: Mesh) => void): Nullable<Promise<Mesh>>;
         /** @hidden */
-        loadAnimationAsync(context: string, animation: ILoaderAnimation): Nullable<Promise<AnimationGroup>>;
+        loadAnimationAsync(context: string, animation: IAnimation): Nullable<Promise<AnimationGroup>>;
         private _loadClipAsync;
         private _loadEmitterAsync;
         private _getEventAction;
@@ -1591,7 +1591,7 @@ declare module BABYLON.GLTF2.Extensions {
 }
 
 
-declare module BABYLON.GLTF2.Extensions {
+declare module BABYLON.GLTF2.Loader.Extensions {
     /**
      * [Specification](https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Khronos/KHR_draco_mesh_compression)
      */
@@ -1607,12 +1607,12 @@ declare module BABYLON.GLTF2.Extensions {
         /** @hidden */
         dispose(): void;
         /** @hidden */
-        _loadVertexDataAsync(context: string, primitive: ILoaderMeshPrimitive, babylonMesh: Mesh): Nullable<Promise<Geometry>>;
+        _loadVertexDataAsync(context: string, primitive: IMeshPrimitive, babylonMesh: Mesh): Nullable<Promise<Geometry>>;
     }
 }
 
 
-declare module BABYLON.GLTF2.Extensions {
+declare module BABYLON.GLTF2.Loader.Extensions {
     /**
      * [Specification](https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Khronos/KHR_materials_pbrSpecularGlossiness)
      */
@@ -1627,13 +1627,13 @@ declare module BABYLON.GLTF2.Extensions {
         /** @hidden */
         dispose(): void;
         /** @hidden */
-        loadMaterialPropertiesAsync(context: string, material: ILoaderMaterial, babylonMaterial: Material): Nullable<Promise<void>>;
+        loadMaterialPropertiesAsync(context: string, material: IMaterial, babylonMaterial: Material): Nullable<Promise<void>>;
         private _loadSpecularGlossinessPropertiesAsync;
     }
 }
 
 
-declare module BABYLON.GLTF2.Extensions {
+declare module BABYLON.GLTF2.Loader.Extensions {
     /**
      * [Specification](https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Khronos/KHR_materials_unlit)
      */
@@ -1648,13 +1648,13 @@ declare module BABYLON.GLTF2.Extensions {
         /** @hidden */
         dispose(): void;
         /** @hidden */
-        loadMaterialPropertiesAsync(context: string, material: ILoaderMaterial, babylonMaterial: Material): Nullable<Promise<void>>;
+        loadMaterialPropertiesAsync(context: string, material: IMaterial, babylonMaterial: Material): Nullable<Promise<void>>;
         private _loadUnlitPropertiesAsync;
     }
 }
 
 
-declare module BABYLON.GLTF2.Extensions {
+declare module BABYLON.GLTF2.Loader.Extensions {
     /**
      * [Specification](https://github.com/KhronosGroup/glTF/blob/1048d162a44dbcb05aefc1874bfd423cf60135a6/extensions/2.0/Khronos/KHR_lights_punctual/README.md) (Experimental)
      */
@@ -1672,14 +1672,14 @@ declare module BABYLON.GLTF2.Extensions {
         /** @hidden */
         onLoading(): void;
         /** @hidden */
-        loadNodeAsync(context: string, node: ILoaderNode, assign: (babylonMesh: Mesh) => void): Nullable<Promise<Mesh>>;
+        loadNodeAsync(context: string, node: INode, assign: (babylonMesh: Mesh) => void): Nullable<Promise<Mesh>>;
     }
 }
 
 
-declare module BABYLON.GLTF2.Extensions {
+declare module BABYLON.GLTF2.Loader.Extensions {
     /**
-     * [Specification](https://github.com/AltspaceVR/glTF/blob/avr-sampler-offset-tile/extensions/2.0/Khronos/KHR_texture_transform/README.md) (Experimental)
+     * [Specification](https://github.com/KhronosGroup/glTF/blob/master/extensions/2.0/Khronos/KHR_texture_transform/README.md)
      */
     class KHR_texture_transform implements IGLTFLoaderExtension {
         /** The name of this extension. */
@@ -1697,7 +1697,7 @@ declare module BABYLON.GLTF2.Extensions {
 }
 
 
-declare module BABYLON.GLTF2.Extensions {
+declare module BABYLON.GLTF2.Loader.Extensions {
     /**
      * [Specification](https://github.com/KhronosGroup/glTF/blob/eb3e32332042e04691a5f35103f8c261e50d8f1e/extensions/2.0/Khronos/EXT_lights_image_based/README.md) (Experimental)
      */
@@ -1715,7 +1715,7 @@ declare module BABYLON.GLTF2.Extensions {
         /** @hidden */
         onLoading(): void;
         /** @hidden */
-        loadSceneAsync(context: string, scene: ILoaderScene): Nullable<Promise<void>>;
+        loadSceneAsync(context: string, scene: IScene): Nullable<Promise<void>>;
         private _loadLightAsync;
     }
 }

文件差異過大導致無法顯示
+ 945 - 915
dist/preview release/loaders/babylon.glTFFileLoader.js


文件差異過大導致無法顯示
+ 1 - 1
dist/preview release/loaders/babylon.glTFFileLoader.min.js


+ 96 - 96
dist/preview release/loaders/babylonjs.loaders.d.ts

@@ -1043,7 +1043,7 @@ declare module BABYLON.GLTF1 {
 }
 
 
-declare module BABYLON.GLTF2 {
+declare module BABYLON.GLTF2.Loader {
     /**
      * Loader interface with an index field.
      */
@@ -1056,7 +1056,7 @@ declare module BABYLON.GLTF2 {
     /**
      * Loader interface with additional members.
      */
-    interface ILoaderAccessor extends IAccessor, IArrayItem {
+    interface IAccessor extends GLTF2.IAccessor, IArrayItem {
         /** @hidden */
         _data?: Promise<ArrayBufferView>;
         /** @hidden */
@@ -1065,10 +1065,10 @@ declare module BABYLON.GLTF2 {
     /**
      * Loader interface with additional members.
      */
-    interface ILoaderAnimationChannel extends IAnimationChannel, IArrayItem {
+    interface IAnimationChannel extends GLTF2.IAnimationChannel, IArrayItem {
     }
     /** @hidden */
-    interface _ILoaderAnimationSamplerData {
+    interface _IAnimationSamplerData {
         input: Float32Array;
         interpolation: AnimationSamplerInterpolation;
         output: Float32Array;
@@ -1076,30 +1076,30 @@ declare module BABYLON.GLTF2 {
     /**
      * Loader interface with additional members.
      */
-    interface ILoaderAnimationSampler extends IAnimationSampler, IArrayItem {
+    interface IAnimationSampler extends GLTF2.IAnimationSampler, IArrayItem {
         /** @hidden */
-        _data?: Promise<_ILoaderAnimationSamplerData>;
+        _data?: Promise<_IAnimationSamplerData>;
     }
     /**
      * Loader interface with additional members.
      */
-    interface ILoaderAnimation extends IAnimation, IArrayItem {
-        channels: ILoaderAnimationChannel[];
-        samplers: ILoaderAnimationSampler[];
+    interface IAnimation extends GLTF2.IAnimation, IArrayItem {
+        channels: IAnimationChannel[];
+        samplers: IAnimationSampler[];
         /** @hidden */
         _babylonAnimationGroup?: AnimationGroup;
     }
     /**
      * Loader interface with additional members.
      */
-    interface ILoaderBuffer extends IBuffer, IArrayItem {
+    interface IBuffer extends GLTF2.IBuffer, IArrayItem {
         /** @hidden */
         _data?: Promise<ArrayBufferView>;
     }
     /**
      * Loader interface with additional members.
      */
-    interface ILoaderBufferView extends IBufferView, IArrayItem {
+    interface IBufferView extends GLTF2.IBufferView, IArrayItem {
         /** @hidden */
         _data?: Promise<ArrayBufferView>;
         /** @hidden */
@@ -1108,40 +1108,40 @@ declare module BABYLON.GLTF2 {
     /**
      * Loader interface with additional members.
      */
-    interface ILoaderCamera extends ICamera, IArrayItem {
+    interface ICamera extends GLTF2.ICamera, IArrayItem {
     }
     /**
      * Loader interface with additional members.
      */
-    interface ILoaderImage extends IImage, IArrayItem {
+    interface IImage extends GLTF2.IImage, IArrayItem {
         /** @hidden */
         _data?: Promise<ArrayBufferView>;
     }
     /**
      * Loader interface with additional members.
      */
-    interface ILoaderMaterialNormalTextureInfo extends IMaterialNormalTextureInfo, ILoaderTextureInfo {
+    interface IMaterialNormalTextureInfo extends GLTF2.IMaterialNormalTextureInfo, ITextureInfo {
     }
     /**
      * Loader interface with additional members.
      */
-    interface ILoaderMaterialOcclusionTextureInfo extends IMaterialOcclusionTextureInfo, ILoaderTextureInfo {
+    interface IMaterialOcclusionTextureInfo extends GLTF2.IMaterialOcclusionTextureInfo, ITextureInfo {
     }
     /**
      * Loader interface with additional members.
      */
-    interface ILoaderMaterialPbrMetallicRoughness extends IMaterialPbrMetallicRoughness {
-        baseColorTexture?: ILoaderTextureInfo;
-        metallicRoughnessTexture?: ILoaderTextureInfo;
+    interface IMaterialPbrMetallicRoughness extends GLTF2.IMaterialPbrMetallicRoughness {
+        baseColorTexture?: ITextureInfo;
+        metallicRoughnessTexture?: ITextureInfo;
     }
     /**
      * Loader interface with additional members.
      */
-    interface ILoaderMaterial extends IMaterial, IArrayItem {
-        pbrMetallicRoughness?: ILoaderMaterialPbrMetallicRoughness;
-        normalTexture?: ILoaderMaterialNormalTextureInfo;
-        occlusionTexture?: ILoaderMaterialOcclusionTextureInfo;
-        emissiveTexture?: ILoaderTextureInfo;
+    interface IMaterial extends GLTF2.IMaterial, IArrayItem {
+        pbrMetallicRoughness?: IMaterialPbrMetallicRoughness;
+        normalTexture?: IMaterialNormalTextureInfo;
+        occlusionTexture?: IMaterialOcclusionTextureInfo;
+        emissiveTexture?: ITextureInfo;
         /** @hidden */
         _babylonData?: {
             [drawMode: number]: {
@@ -1154,22 +1154,22 @@ declare module BABYLON.GLTF2 {
     /**
      * Loader interface with additional members.
      */
-    interface ILoaderMesh extends IMesh, IArrayItem {
-        primitives: ILoaderMeshPrimitive[];
+    interface IMesh extends GLTF2.IMesh, IArrayItem {
+        primitives: IMeshPrimitive[];
     }
     /**
      * Loader interface with additional members.
      */
-    interface ILoaderMeshPrimitive extends IMeshPrimitive, IArrayItem {
+    interface IMeshPrimitive extends GLTF2.IMeshPrimitive, IArrayItem {
     }
     /**
      * Loader interface with additional members.
      */
-    interface ILoaderNode extends INode, IArrayItem {
+    interface INode extends GLTF2.INode, IArrayItem {
         /**
          * The parent glTF node.
          */
-        parent?: ILoaderNode;
+        parent?: INode;
         /** @hidden */
         _babylonMesh?: Mesh;
         /** @hidden */
@@ -1180,7 +1180,7 @@ declare module BABYLON.GLTF2 {
         _numMorphTargets?: number;
     }
     /** @hidden */
-    interface _ILoaderSamplerData {
+    interface _ISamplerData {
         noMipMaps: boolean;
         samplingMode: number;
         wrapU: number;
@@ -1189,19 +1189,19 @@ declare module BABYLON.GLTF2 {
     /**
      * Loader interface with additional members.
      */
-    interface ILoaderSampler extends ISampler, IArrayItem {
+    interface ISampler extends GLTF2.ISampler, IArrayItem {
         /** @hidden */
-        _data?: _ILoaderSamplerData;
+        _data?: _ISamplerData;
     }
     /**
      * Loader interface with additional members.
      */
-    interface ILoaderScene extends IScene, IArrayItem {
+    interface IScene extends GLTF2.IScene, IArrayItem {
     }
     /**
      * Loader interface with additional members.
      */
-    interface ILoaderSkin extends ISkin, IArrayItem {
+    interface ISkin extends GLTF2.ISkin, IArrayItem {
         /** @hidden */
         _babylonSkeleton?: Skeleton;
         /** @hidden */
@@ -1210,30 +1210,30 @@ declare module BABYLON.GLTF2 {
     /**
      * Loader interface with additional members.
      */
-    interface ILoaderTexture extends ITexture, IArrayItem {
+    interface ITexture extends GLTF2.ITexture, IArrayItem {
     }
     /**
      * Loader interface with additional members.
      */
-    interface ILoaderTextureInfo extends ITextureInfo {
+    interface ITextureInfo extends GLTF2.ITextureInfo {
     }
     /**
      * Loader interface with additional members.
      */
-    interface ILoaderGLTF extends IGLTF {
-        accessors?: ILoaderAccessor[];
-        animations?: ILoaderAnimation[];
-        buffers?: ILoaderBuffer[];
-        bufferViews?: ILoaderBufferView[];
-        cameras?: ILoaderCamera[];
-        images?: ILoaderImage[];
-        materials?: ILoaderMaterial[];
-        meshes?: ILoaderMesh[];
-        nodes?: ILoaderNode[];
-        samplers?: ILoaderSampler[];
-        scenes?: ILoaderScene[];
-        skins?: ILoaderSkin[];
-        textures?: ILoaderTexture[];
+    interface IGLTF extends GLTF2.IGLTF {
+        accessors?: IAccessor[];
+        animations?: IAnimation[];
+        buffers?: IBuffer[];
+        bufferViews?: IBufferView[];
+        cameras?: ICamera[];
+        images?: IImage[];
+        materials?: IMaterial[];
+        meshes?: IMesh[];
+        nodes?: INode[];
+        samplers?: ISampler[];
+        scenes?: IScene[];
+        skins?: ISkin[];
+        textures?: ITexture[];
     }
 }
 
@@ -1258,14 +1258,14 @@ declare module BABYLON.GLTF2 {
          * Assign an `index` field to each item of the given array.
          * @param array The array of items
          */
-        static Assign(array?: IArrayItem[]): void;
+        static Assign(array?: Loader.IArrayItem[]): void;
     }
     /**
      * The glTF 2.0 loader
      */
     class GLTFLoader implements IGLTFLoader {
         /** The glTF object parsed from the JSON. */
-        gltf: ILoaderGLTF;
+        gltf: Loader.IGLTF;
         /** The Babylon scene when loading the asset. */
         babylonScene: Scene;
         /** @hidden */
@@ -1326,7 +1326,7 @@ declare module BABYLON.GLTF2 {
          * @param scene The glTF scene property
          * @returns A promise that resolves when the load is complete
          */
-        loadSceneAsync(context: string, scene: ILoaderScene): Promise<void>;
+        loadSceneAsync(context: string, scene: Loader.IScene): Promise<void>;
         private _forEachPrimitive;
         private _getMeshes;
         private _getSkeletons;
@@ -1339,7 +1339,7 @@ declare module BABYLON.GLTF2 {
          * @param assign A function called synchronously after parsing the glTF properties
          * @returns A promise that resolves with the loaded Babylon mesh when the load is complete
          */
-        loadNodeAsync(context: string, node: ILoaderNode, assign?: (babylonMesh: Mesh) => void): Promise<Mesh>;
+        loadNodeAsync(context: string, node: Loader.INode, assign?: (babylonMesh: Mesh) => void): Promise<Mesh>;
         private _loadMeshAsync;
         private _loadMeshPrimitiveAsync;
         private _loadVertexDataAsync;
@@ -1360,7 +1360,7 @@ declare module BABYLON.GLTF2 {
          * @param assign A function called synchronously after parsing the glTF properties
          * @returns A promise that resolves with the loaded Babylon camera when the load is complete
          */
-        loadCameraAsync(context: string, camera: ILoaderCamera, assign?: (babylonCamera: Camera) => void): Promise<Camera>;
+        loadCameraAsync(context: string, camera: Loader.ICamera, assign?: (babylonCamera: Camera) => void): Promise<Camera>;
         private _loadAnimationsAsync;
         /**
          * Loads a glTF animation.
@@ -1368,7 +1368,7 @@ declare module BABYLON.GLTF2 {
          * @param animation The glTF animation property
          * @returns A promise that resolves with the loaded Babylon animation group when the load is complete
          */
-        loadAnimationAsync(context: string, animation: ILoaderAnimation): Promise<AnimationGroup>;
+        loadAnimationAsync(context: string, animation: Loader.IAnimation): Promise<AnimationGroup>;
         private _loadAnimationChannelAsync;
         private _loadAnimationSamplerAsync;
         private _loadBufferAsync;
@@ -1378,14 +1378,14 @@ declare module BABYLON.GLTF2 {
          * @param bufferView The glTF buffer view property
          * @returns A promise that resolves with the loaded data when the load is complete
          */
-        loadBufferViewAsync(context: string, bufferView: ILoaderBufferView): Promise<ArrayBufferView>;
+        loadBufferViewAsync(context: string, bufferView: Loader.IBufferView): Promise<ArrayBufferView>;
         private _loadIndicesAccessorAsync;
         private _loadFloatAccessorAsync;
         private _loadVertexBufferViewAsync;
         private _loadVertexAccessorAsync;
         private _loadMaterialMetallicRoughnessPropertiesAsync;
         /** @hidden */
-        _loadMaterialAsync(context: string, material: ILoaderMaterial, babylonMesh: Mesh, babylonDrawMode: number, assign?: (babylonMaterial: Material) => void): Promise<Material>;
+        _loadMaterialAsync(context: string, material: Loader.IMaterial, babylonMesh: Mesh, babylonDrawMode: number, assign?: (babylonMaterial: Material) => void): Promise<Material>;
         private _createDefaultMaterial;
         /**
          * Creates a Babylon material from a glTF material.
@@ -1394,7 +1394,7 @@ declare module BABYLON.GLTF2 {
          * @param babylonDrawMode The draw mode for the Babylon material
          * @returns The Babylon material
          */
-        createMaterial(context: string, material: ILoaderMaterial, babylonDrawMode: number): Material;
+        createMaterial(context: string, material: Loader.IMaterial, babylonDrawMode: number): Material;
         /**
          * Loads properties from a glTF material into a Babylon material.
          * @param context The context when loading the asset
@@ -1402,7 +1402,7 @@ declare module BABYLON.GLTF2 {
          * @param babylonMaterial The Babylon material
          * @returns A promise that resolves when the load is complete
          */
-        loadMaterialPropertiesAsync(context: string, material: ILoaderMaterial, babylonMaterial: Material): Promise<void>;
+        loadMaterialPropertiesAsync(context: string, material: Loader.IMaterial, babylonMaterial: Material): Promise<void>;
         /**
          * Loads the normal, occlusion, and emissive properties from a glTF material into a Babylon material.
          * @param context The context when loading the asset
@@ -1410,7 +1410,7 @@ declare module BABYLON.GLTF2 {
          * @param babylonMaterial The Babylon material
          * @returns A promise that resolves when the load is complete
          */
-        loadMaterialBasePropertiesAsync(context: string, material: ILoaderMaterial, babylonMaterial: Material): Promise<void>;
+        loadMaterialBasePropertiesAsync(context: string, material: Loader.IMaterial, babylonMaterial: Material): Promise<void>;
         /**
          * Loads the alpha properties from a glTF material into a Babylon material.
          * Must be called after the setting the albedo texture of the Babylon material when the material has an albedo texture.
@@ -1418,7 +1418,7 @@ declare module BABYLON.GLTF2 {
          * @param material The glTF material property
          * @param babylonMaterial The Babylon material
          */
-        loadMaterialAlphaProperties(context: string, material: ILoaderMaterial, babylonMaterial: Material): void;
+        loadMaterialAlphaProperties(context: string, material: Loader.IMaterial, babylonMaterial: Material): void;
         /**
          * Loads a glTF texture info.
          * @param context The context when loading the asset
@@ -1426,7 +1426,7 @@ declare module BABYLON.GLTF2 {
          * @param assign A function called synchronously after parsing the glTF properties
          * @returns A promise that resolves with the loaded Babylon texture when the load is complete
          */
-        loadTextureInfoAsync(context: string, textureInfo: ILoaderTextureInfo, assign?: (babylonTexture: BaseTexture) => void): Promise<BaseTexture>;
+        loadTextureInfoAsync(context: string, textureInfo: Loader.ITextureInfo, assign?: (babylonTexture: BaseTexture) => void): Promise<BaseTexture>;
         private _loadTextureAsync;
         private _loadSampler;
         /**
@@ -1435,7 +1435,7 @@ declare module BABYLON.GLTF2 {
          * @param image The glTF image property
          * @returns A promise that resolves with the loaded data when the load is complete
          */
-        loadImageAsync(context: string, image: ILoaderImage): Promise<ArrayBufferView>;
+        loadImageAsync(context: string, image: Loader.IImage): Promise<ArrayBufferView>;
         /**
          * Loads a glTF uri.
          * @param context The context when loading the asset
@@ -1531,7 +1531,7 @@ declare module BABYLON.GLTF2 {
          * @param scene The glTF scene property
          * @returns A promise that resolves when the load is complete or null if not handled
          */
-        loadSceneAsync?(context: string, scene: ILoaderScene): Nullable<Promise<void>>;
+        loadSceneAsync?(context: string, scene: Loader.IScene): Nullable<Promise<void>>;
         /**
          * Define this method to modify the default behavior when loading nodes.
          * @param context The context when loading the asset
@@ -1539,7 +1539,7 @@ declare module BABYLON.GLTF2 {
          * @param assign A function called synchronously after parsing the glTF properties
          * @returns A promise that resolves with the loaded Babylon mesh when the load is complete or null if not handled
          */
-        loadNodeAsync?(context: string, node: ILoaderNode, assign: (babylonMesh: Mesh) => void): Nullable<Promise<Mesh>>;
+        loadNodeAsync?(context: string, node: Loader.INode, assign: (babylonMesh: Mesh) => void): Nullable<Promise<Mesh>>;
         /**
          * Define this method to modify the default behavior when loading cameras.
          * @param context The context when loading the asset
@@ -1547,14 +1547,14 @@ declare module BABYLON.GLTF2 {
          * @param assign A function called synchronously after parsing the glTF properties
          * @returns A promise that resolves with the loaded Babylon camera when the load is complete or null if not handled
          */
-        loadCameraAsync?(context: string, camera: ILoaderCamera, assign: (babylonCamera: Camera) => void): Nullable<Promise<Camera>>;
+        loadCameraAsync?(context: string, camera: Loader.ICamera, assign: (babylonCamera: Camera) => void): Nullable<Promise<Camera>>;
         /**
          * @hidden Define this method to modify the default behavior when loading vertex data for mesh primitives.
          * @param context The context when loading the asset
          * @param primitive The glTF mesh primitive property
          * @returns A promise that resolves with the loaded geometry when the load is complete or null if not handled
          */
-        _loadVertexDataAsync?(context: string, primitive: ILoaderMeshPrimitive, babylonMesh: Mesh): Nullable<Promise<Geometry>>;
+        _loadVertexDataAsync?(context: string, primitive: Loader.IMeshPrimitive, babylonMesh: Mesh): Nullable<Promise<Geometry>>;
         /**
          * @hidden Define this method to modify the default behavior when loading materials. Load material creates the material and then loads material properties.
          * @param context The context when loading the asset
@@ -1562,7 +1562,7 @@ declare module BABYLON.GLTF2 {
          * @param assign A function called synchronously after parsing the glTF properties
          * @returns A promise that resolves with the loaded Babylon material when the load is complete or null if not handled
          */
-        _loadMaterialAsync?(context: string, material: ILoaderMaterial, babylonMesh: Mesh, babylonDrawMode: number, assign: (babylonMaterial: Material) => void): Nullable<Promise<Material>>;
+        _loadMaterialAsync?(context: string, material: Loader.IMaterial, babylonMesh: Mesh, babylonDrawMode: number, assign: (babylonMaterial: Material) => void): Nullable<Promise<Material>>;
         /**
          * Define this method to modify the default behavior when creating materials.
          * @param context The context when loading the asset
@@ -1570,7 +1570,7 @@ declare module BABYLON.GLTF2 {
          * @param babylonDrawMode The draw mode for the Babylon material
          * @returns The Babylon material or null if not handled
          */
-        createMaterial?(context: string, material: ILoaderMaterial, babylonDrawMode: number): Nullable<Material>;
+        createMaterial?(context: string, material: Loader.IMaterial, babylonDrawMode: number): Nullable<Material>;
         /**
          * Define this method to modify the default behavior when loading material properties.
          * @param context The context when loading the asset
@@ -1578,7 +1578,7 @@ declare module BABYLON.GLTF2 {
          * @param babylonMaterial The Babylon material
          * @returns A promise that resolves when the load is complete or null if not handled
          */
-        loadMaterialPropertiesAsync?(context: string, material: ILoaderMaterial, babylonMaterial: Material): Nullable<Promise<void>>;
+        loadMaterialPropertiesAsync?(context: string, material: Loader.IMaterial, babylonMaterial: Material): Nullable<Promise<void>>;
         /**
          * Define this method to modify the default behavior when loading texture infos.
          * @param context The context when loading the asset
@@ -1586,14 +1586,14 @@ declare module BABYLON.GLTF2 {
          * @param assign A function called synchronously after parsing the glTF properties
          * @returns A promise that resolves with the loaded Babylon texture when the load is complete or null if not handled
          */
-        loadTextureInfoAsync?(context: string, textureInfo: ITextureInfo, assign: (babylonTexture: BaseTexture) => void): Nullable<Promise<BaseTexture>>;
+        loadTextureInfoAsync?(context: string, textureInfo: Loader.ITextureInfo, assign: (babylonTexture: BaseTexture) => void): Nullable<Promise<BaseTexture>>;
         /**
          * Define this method to modify the default behavior when loading animations.
          * @param context The context when loading the asset
          * @param animation The glTF animation property
          * @returns A promise that resolves with the loaded Babylon animation group when the load is complete or null if not handled
          */
-        loadAnimationAsync?(context: string, animation: IAnimation): Nullable<Promise<AnimationGroup>>;
+        loadAnimationAsync?(context: string, animation: Loader.IAnimation): Nullable<Promise<AnimationGroup>>;
         /**
          * Define this method to modify the default behavior when loading uris.
          * @param context The context when loading the asset
@@ -1606,11 +1606,11 @@ declare module BABYLON.GLTF2 {
 /**
  * Defines the module for the built-in glTF 2.0 loader extensions.
  */
-declare module BABYLON.GLTF2.Extensions {
+declare module BABYLON.GLTF2.Loader.Extensions {
 }
 
 
-declare module BABYLON.GLTF2.Extensions {
+declare module BABYLON.GLTF2.Loader.Extensions {
     /**
      * [Specification](https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Vendor/MSFT_lod)
      */
@@ -1649,9 +1649,9 @@ declare module BABYLON.GLTF2.Extensions {
         /** @hidden */
         onReady(): void;
         /** @hidden */
-        loadNodeAsync(context: string, node: ILoaderNode, assign: (babylonMesh: Mesh) => void): Nullable<Promise<Mesh>>;
+        loadNodeAsync(context: string, node: INode, assign: (babylonMesh: Mesh) => void): Nullable<Promise<Mesh>>;
         /** @hidden */
-        _loadMaterialAsync(context: string, material: ILoaderMaterial, babylonMesh: Mesh, babylonDrawMode: number, assign: (babylonMaterial: Material) => void): Nullable<Promise<Material>>;
+        _loadMaterialAsync(context: string, material: IMaterial, babylonMesh: Mesh, babylonDrawMode: number, assign: (babylonMaterial: Material) => void): Nullable<Promise<Material>>;
         /** @hidden */
         _loadUriAsync(context: string, uri: string): Nullable<Promise<ArrayBufferView>>;
         /**
@@ -1663,7 +1663,7 @@ declare module BABYLON.GLTF2.Extensions {
 }
 
 
-declare module BABYLON.GLTF2.Extensions {
+declare module BABYLON.GLTF2.Loader.Extensions {
     /** @hidden */
     class MSFT_minecraftMesh implements IGLTFLoaderExtension {
         readonly name: string;
@@ -1671,12 +1671,12 @@ declare module BABYLON.GLTF2.Extensions {
         private _loader;
         constructor(loader: GLTFLoader);
         dispose(): void;
-        loadMaterialPropertiesAsync(context: string, material: ILoaderMaterial, babylonMaterial: Material): Nullable<Promise<void>>;
+        loadMaterialPropertiesAsync(context: string, material: IMaterial, babylonMaterial: Material): Nullable<Promise<void>>;
     }
 }
 
 
-declare module BABYLON.GLTF2.Extensions {
+declare module BABYLON.GLTF2.Loader.Extensions {
     /** @hidden */
     class MSFT_sRGBFactors implements IGLTFLoaderExtension {
         readonly name: string;
@@ -1684,12 +1684,12 @@ declare module BABYLON.GLTF2.Extensions {
         private _loader;
         constructor(loader: GLTFLoader);
         dispose(): void;
-        loadMaterialPropertiesAsync(context: string, material: ILoaderMaterial, babylonMaterial: Material): Nullable<Promise<void>>;
+        loadMaterialPropertiesAsync(context: string, material: IMaterial, babylonMaterial: Material): Nullable<Promise<void>>;
     }
 }
 
 
-declare module BABYLON.GLTF2.Extensions {
+declare module BABYLON.GLTF2.Loader.Extensions {
     /**
      * [Specification](https://github.com/najadojo/glTF/tree/MSFT_audio_emitter/extensions/2.0/Vendor/MSFT_audio_emitter)
      */
@@ -1708,11 +1708,11 @@ declare module BABYLON.GLTF2.Extensions {
         /** @hidden */
         onLoading(): void;
         /** @hidden */
-        loadSceneAsync(context: string, scene: ILoaderScene): Nullable<Promise<void>>;
+        loadSceneAsync(context: string, scene: IScene): Nullable<Promise<void>>;
         /** @hidden */
-        loadNodeAsync(context: string, node: ILoaderNode, assign: (babylonMesh: Mesh) => void): Nullable<Promise<Mesh>>;
+        loadNodeAsync(context: string, node: INode, assign: (babylonMesh: Mesh) => void): Nullable<Promise<Mesh>>;
         /** @hidden */
-        loadAnimationAsync(context: string, animation: ILoaderAnimation): Nullable<Promise<AnimationGroup>>;
+        loadAnimationAsync(context: string, animation: IAnimation): Nullable<Promise<AnimationGroup>>;
         private _loadClipAsync;
         private _loadEmitterAsync;
         private _getEventAction;
@@ -1721,7 +1721,7 @@ declare module BABYLON.GLTF2.Extensions {
 }
 
 
-declare module BABYLON.GLTF2.Extensions {
+declare module BABYLON.GLTF2.Loader.Extensions {
     /**
      * [Specification](https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Khronos/KHR_draco_mesh_compression)
      */
@@ -1737,12 +1737,12 @@ declare module BABYLON.GLTF2.Extensions {
         /** @hidden */
         dispose(): void;
         /** @hidden */
-        _loadVertexDataAsync(context: string, primitive: ILoaderMeshPrimitive, babylonMesh: Mesh): Nullable<Promise<Geometry>>;
+        _loadVertexDataAsync(context: string, primitive: IMeshPrimitive, babylonMesh: Mesh): Nullable<Promise<Geometry>>;
     }
 }
 
 
-declare module BABYLON.GLTF2.Extensions {
+declare module BABYLON.GLTF2.Loader.Extensions {
     /**
      * [Specification](https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Khronos/KHR_materials_pbrSpecularGlossiness)
      */
@@ -1757,13 +1757,13 @@ declare module BABYLON.GLTF2.Extensions {
         /** @hidden */
         dispose(): void;
         /** @hidden */
-        loadMaterialPropertiesAsync(context: string, material: ILoaderMaterial, babylonMaterial: Material): Nullable<Promise<void>>;
+        loadMaterialPropertiesAsync(context: string, material: IMaterial, babylonMaterial: Material): Nullable<Promise<void>>;
         private _loadSpecularGlossinessPropertiesAsync;
     }
 }
 
 
-declare module BABYLON.GLTF2.Extensions {
+declare module BABYLON.GLTF2.Loader.Extensions {
     /**
      * [Specification](https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Khronos/KHR_materials_unlit)
      */
@@ -1778,13 +1778,13 @@ declare module BABYLON.GLTF2.Extensions {
         /** @hidden */
         dispose(): void;
         /** @hidden */
-        loadMaterialPropertiesAsync(context: string, material: ILoaderMaterial, babylonMaterial: Material): Nullable<Promise<void>>;
+        loadMaterialPropertiesAsync(context: string, material: IMaterial, babylonMaterial: Material): Nullable<Promise<void>>;
         private _loadUnlitPropertiesAsync;
     }
 }
 
 
-declare module BABYLON.GLTF2.Extensions {
+declare module BABYLON.GLTF2.Loader.Extensions {
     /**
      * [Specification](https://github.com/KhronosGroup/glTF/blob/1048d162a44dbcb05aefc1874bfd423cf60135a6/extensions/2.0/Khronos/KHR_lights_punctual/README.md) (Experimental)
      */
@@ -1802,14 +1802,14 @@ declare module BABYLON.GLTF2.Extensions {
         /** @hidden */
         onLoading(): void;
         /** @hidden */
-        loadNodeAsync(context: string, node: ILoaderNode, assign: (babylonMesh: Mesh) => void): Nullable<Promise<Mesh>>;
+        loadNodeAsync(context: string, node: INode, assign: (babylonMesh: Mesh) => void): Nullable<Promise<Mesh>>;
     }
 }
 
 
-declare module BABYLON.GLTF2.Extensions {
+declare module BABYLON.GLTF2.Loader.Extensions {
     /**
-     * [Specification](https://github.com/AltspaceVR/glTF/blob/avr-sampler-offset-tile/extensions/2.0/Khronos/KHR_texture_transform/README.md) (Experimental)
+     * [Specification](https://github.com/KhronosGroup/glTF/blob/master/extensions/2.0/Khronos/KHR_texture_transform/README.md)
      */
     class KHR_texture_transform implements IGLTFLoaderExtension {
         /** The name of this extension. */
@@ -1827,7 +1827,7 @@ declare module BABYLON.GLTF2.Extensions {
 }
 
 
-declare module BABYLON.GLTF2.Extensions {
+declare module BABYLON.GLTF2.Loader.Extensions {
     /**
      * [Specification](https://github.com/KhronosGroup/glTF/blob/eb3e32332042e04691a5f35103f8c261e50d8f1e/extensions/2.0/Khronos/EXT_lights_image_based/README.md) (Experimental)
      */
@@ -1845,7 +1845,7 @@ declare module BABYLON.GLTF2.Extensions {
         /** @hidden */
         onLoading(): void;
         /** @hidden */
-        loadSceneAsync(context: string, scene: ILoaderScene): Nullable<Promise<void>>;
+        loadSceneAsync(context: string, scene: IScene): Nullable<Promise<void>>;
         private _loadLightAsync;
     }
 }

文件差異過大導致無法顯示
+ 945 - 915
dist/preview release/loaders/babylonjs.loaders.js


文件差異過大導致無法顯示
+ 1 - 1
dist/preview release/loaders/babylonjs.loaders.min.js


+ 96 - 96
dist/preview release/loaders/babylonjs.loaders.module.d.ts

@@ -1050,7 +1050,7 @@ declare module BABYLON.GLTF1 {
 }
 
 
-declare module BABYLON.GLTF2 {
+declare module BABYLON.GLTF2.Loader {
     /**
      * Loader interface with an index field.
      */
@@ -1063,7 +1063,7 @@ declare module BABYLON.GLTF2 {
     /**
      * Loader interface with additional members.
      */
-    interface ILoaderAccessor extends IAccessor, IArrayItem {
+    interface IAccessor extends GLTF2.IAccessor, IArrayItem {
         /** @hidden */
         _data?: Promise<ArrayBufferView>;
         /** @hidden */
@@ -1072,10 +1072,10 @@ declare module BABYLON.GLTF2 {
     /**
      * Loader interface with additional members.
      */
-    interface ILoaderAnimationChannel extends IAnimationChannel, IArrayItem {
+    interface IAnimationChannel extends GLTF2.IAnimationChannel, IArrayItem {
     }
     /** @hidden */
-    interface _ILoaderAnimationSamplerData {
+    interface _IAnimationSamplerData {
         input: Float32Array;
         interpolation: AnimationSamplerInterpolation;
         output: Float32Array;
@@ -1083,30 +1083,30 @@ declare module BABYLON.GLTF2 {
     /**
      * Loader interface with additional members.
      */
-    interface ILoaderAnimationSampler extends IAnimationSampler, IArrayItem {
+    interface IAnimationSampler extends GLTF2.IAnimationSampler, IArrayItem {
         /** @hidden */
-        _data?: Promise<_ILoaderAnimationSamplerData>;
+        _data?: Promise<_IAnimationSamplerData>;
     }
     /**
      * Loader interface with additional members.
      */
-    interface ILoaderAnimation extends IAnimation, IArrayItem {
-        channels: ILoaderAnimationChannel[];
-        samplers: ILoaderAnimationSampler[];
+    interface IAnimation extends GLTF2.IAnimation, IArrayItem {
+        channels: IAnimationChannel[];
+        samplers: IAnimationSampler[];
         /** @hidden */
         _babylonAnimationGroup?: AnimationGroup;
     }
     /**
      * Loader interface with additional members.
      */
-    interface ILoaderBuffer extends IBuffer, IArrayItem {
+    interface IBuffer extends GLTF2.IBuffer, IArrayItem {
         /** @hidden */
         _data?: Promise<ArrayBufferView>;
     }
     /**
      * Loader interface with additional members.
      */
-    interface ILoaderBufferView extends IBufferView, IArrayItem {
+    interface IBufferView extends GLTF2.IBufferView, IArrayItem {
         /** @hidden */
         _data?: Promise<ArrayBufferView>;
         /** @hidden */
@@ -1115,40 +1115,40 @@ declare module BABYLON.GLTF2 {
     /**
      * Loader interface with additional members.
      */
-    interface ILoaderCamera extends ICamera, IArrayItem {
+    interface ICamera extends GLTF2.ICamera, IArrayItem {
     }
     /**
      * Loader interface with additional members.
      */
-    interface ILoaderImage extends IImage, IArrayItem {
+    interface IImage extends GLTF2.IImage, IArrayItem {
         /** @hidden */
         _data?: Promise<ArrayBufferView>;
     }
     /**
      * Loader interface with additional members.
      */
-    interface ILoaderMaterialNormalTextureInfo extends IMaterialNormalTextureInfo, ILoaderTextureInfo {
+    interface IMaterialNormalTextureInfo extends GLTF2.IMaterialNormalTextureInfo, ITextureInfo {
     }
     /**
      * Loader interface with additional members.
      */
-    interface ILoaderMaterialOcclusionTextureInfo extends IMaterialOcclusionTextureInfo, ILoaderTextureInfo {
+    interface IMaterialOcclusionTextureInfo extends GLTF2.IMaterialOcclusionTextureInfo, ITextureInfo {
     }
     /**
      * Loader interface with additional members.
      */
-    interface ILoaderMaterialPbrMetallicRoughness extends IMaterialPbrMetallicRoughness {
-        baseColorTexture?: ILoaderTextureInfo;
-        metallicRoughnessTexture?: ILoaderTextureInfo;
+    interface IMaterialPbrMetallicRoughness extends GLTF2.IMaterialPbrMetallicRoughness {
+        baseColorTexture?: ITextureInfo;
+        metallicRoughnessTexture?: ITextureInfo;
     }
     /**
      * Loader interface with additional members.
      */
-    interface ILoaderMaterial extends IMaterial, IArrayItem {
-        pbrMetallicRoughness?: ILoaderMaterialPbrMetallicRoughness;
-        normalTexture?: ILoaderMaterialNormalTextureInfo;
-        occlusionTexture?: ILoaderMaterialOcclusionTextureInfo;
-        emissiveTexture?: ILoaderTextureInfo;
+    interface IMaterial extends GLTF2.IMaterial, IArrayItem {
+        pbrMetallicRoughness?: IMaterialPbrMetallicRoughness;
+        normalTexture?: IMaterialNormalTextureInfo;
+        occlusionTexture?: IMaterialOcclusionTextureInfo;
+        emissiveTexture?: ITextureInfo;
         /** @hidden */
         _babylonData?: {
             [drawMode: number]: {
@@ -1161,22 +1161,22 @@ declare module BABYLON.GLTF2 {
     /**
      * Loader interface with additional members.
      */
-    interface ILoaderMesh extends IMesh, IArrayItem {
-        primitives: ILoaderMeshPrimitive[];
+    interface IMesh extends GLTF2.IMesh, IArrayItem {
+        primitives: IMeshPrimitive[];
     }
     /**
      * Loader interface with additional members.
      */
-    interface ILoaderMeshPrimitive extends IMeshPrimitive, IArrayItem {
+    interface IMeshPrimitive extends GLTF2.IMeshPrimitive, IArrayItem {
     }
     /**
      * Loader interface with additional members.
      */
-    interface ILoaderNode extends INode, IArrayItem {
+    interface INode extends GLTF2.INode, IArrayItem {
         /**
          * The parent glTF node.
          */
-        parent?: ILoaderNode;
+        parent?: INode;
         /** @hidden */
         _babylonMesh?: Mesh;
         /** @hidden */
@@ -1187,7 +1187,7 @@ declare module BABYLON.GLTF2 {
         _numMorphTargets?: number;
     }
     /** @hidden */
-    interface _ILoaderSamplerData {
+    interface _ISamplerData {
         noMipMaps: boolean;
         samplingMode: number;
         wrapU: number;
@@ -1196,19 +1196,19 @@ declare module BABYLON.GLTF2 {
     /**
      * Loader interface with additional members.
      */
-    interface ILoaderSampler extends ISampler, IArrayItem {
+    interface ISampler extends GLTF2.ISampler, IArrayItem {
         /** @hidden */
-        _data?: _ILoaderSamplerData;
+        _data?: _ISamplerData;
     }
     /**
      * Loader interface with additional members.
      */
-    interface ILoaderScene extends IScene, IArrayItem {
+    interface IScene extends GLTF2.IScene, IArrayItem {
     }
     /**
      * Loader interface with additional members.
      */
-    interface ILoaderSkin extends ISkin, IArrayItem {
+    interface ISkin extends GLTF2.ISkin, IArrayItem {
         /** @hidden */
         _babylonSkeleton?: Skeleton;
         /** @hidden */
@@ -1217,30 +1217,30 @@ declare module BABYLON.GLTF2 {
     /**
      * Loader interface with additional members.
      */
-    interface ILoaderTexture extends ITexture, IArrayItem {
+    interface ITexture extends GLTF2.ITexture, IArrayItem {
     }
     /**
      * Loader interface with additional members.
      */
-    interface ILoaderTextureInfo extends ITextureInfo {
+    interface ITextureInfo extends GLTF2.ITextureInfo {
     }
     /**
      * Loader interface with additional members.
      */
-    interface ILoaderGLTF extends IGLTF {
-        accessors?: ILoaderAccessor[];
-        animations?: ILoaderAnimation[];
-        buffers?: ILoaderBuffer[];
-        bufferViews?: ILoaderBufferView[];
-        cameras?: ILoaderCamera[];
-        images?: ILoaderImage[];
-        materials?: ILoaderMaterial[];
-        meshes?: ILoaderMesh[];
-        nodes?: ILoaderNode[];
-        samplers?: ILoaderSampler[];
-        scenes?: ILoaderScene[];
-        skins?: ILoaderSkin[];
-        textures?: ILoaderTexture[];
+    interface IGLTF extends GLTF2.IGLTF {
+        accessors?: IAccessor[];
+        animations?: IAnimation[];
+        buffers?: IBuffer[];
+        bufferViews?: IBufferView[];
+        cameras?: ICamera[];
+        images?: IImage[];
+        materials?: IMaterial[];
+        meshes?: IMesh[];
+        nodes?: INode[];
+        samplers?: ISampler[];
+        scenes?: IScene[];
+        skins?: ISkin[];
+        textures?: ITexture[];
     }
 }
 
@@ -1265,14 +1265,14 @@ declare module BABYLON.GLTF2 {
          * Assign an `index` field to each item of the given array.
          * @param array The array of items
          */
-        static Assign(array?: IArrayItem[]): void;
+        static Assign(array?: Loader.IArrayItem[]): void;
     }
     /**
      * The glTF 2.0 loader
      */
     class GLTFLoader implements IGLTFLoader {
         /** The glTF object parsed from the JSON. */
-        gltf: ILoaderGLTF;
+        gltf: Loader.IGLTF;
         /** The Babylon scene when loading the asset. */
         babylonScene: Scene;
         /** @hidden */
@@ -1333,7 +1333,7 @@ declare module BABYLON.GLTF2 {
          * @param scene The glTF scene property
          * @returns A promise that resolves when the load is complete
          */
-        loadSceneAsync(context: string, scene: ILoaderScene): Promise<void>;
+        loadSceneAsync(context: string, scene: Loader.IScene): Promise<void>;
         private _forEachPrimitive;
         private _getMeshes;
         private _getSkeletons;
@@ -1346,7 +1346,7 @@ declare module BABYLON.GLTF2 {
          * @param assign A function called synchronously after parsing the glTF properties
          * @returns A promise that resolves with the loaded Babylon mesh when the load is complete
          */
-        loadNodeAsync(context: string, node: ILoaderNode, assign?: (babylonMesh: Mesh) => void): Promise<Mesh>;
+        loadNodeAsync(context: string, node: Loader.INode, assign?: (babylonMesh: Mesh) => void): Promise<Mesh>;
         private _loadMeshAsync;
         private _loadMeshPrimitiveAsync;
         private _loadVertexDataAsync;
@@ -1367,7 +1367,7 @@ declare module BABYLON.GLTF2 {
          * @param assign A function called synchronously after parsing the glTF properties
          * @returns A promise that resolves with the loaded Babylon camera when the load is complete
          */
-        loadCameraAsync(context: string, camera: ILoaderCamera, assign?: (babylonCamera: Camera) => void): Promise<Camera>;
+        loadCameraAsync(context: string, camera: Loader.ICamera, assign?: (babylonCamera: Camera) => void): Promise<Camera>;
         private _loadAnimationsAsync;
         /**
          * Loads a glTF animation.
@@ -1375,7 +1375,7 @@ declare module BABYLON.GLTF2 {
          * @param animation The glTF animation property
          * @returns A promise that resolves with the loaded Babylon animation group when the load is complete
          */
-        loadAnimationAsync(context: string, animation: ILoaderAnimation): Promise<AnimationGroup>;
+        loadAnimationAsync(context: string, animation: Loader.IAnimation): Promise<AnimationGroup>;
         private _loadAnimationChannelAsync;
         private _loadAnimationSamplerAsync;
         private _loadBufferAsync;
@@ -1385,14 +1385,14 @@ declare module BABYLON.GLTF2 {
          * @param bufferView The glTF buffer view property
          * @returns A promise that resolves with the loaded data when the load is complete
          */
-        loadBufferViewAsync(context: string, bufferView: ILoaderBufferView): Promise<ArrayBufferView>;
+        loadBufferViewAsync(context: string, bufferView: Loader.IBufferView): Promise<ArrayBufferView>;
         private _loadIndicesAccessorAsync;
         private _loadFloatAccessorAsync;
         private _loadVertexBufferViewAsync;
         private _loadVertexAccessorAsync;
         private _loadMaterialMetallicRoughnessPropertiesAsync;
         /** @hidden */
-        _loadMaterialAsync(context: string, material: ILoaderMaterial, babylonMesh: Mesh, babylonDrawMode: number, assign?: (babylonMaterial: Material) => void): Promise<Material>;
+        _loadMaterialAsync(context: string, material: Loader.IMaterial, babylonMesh: Mesh, babylonDrawMode: number, assign?: (babylonMaterial: Material) => void): Promise<Material>;
         private _createDefaultMaterial;
         /**
          * Creates a Babylon material from a glTF material.
@@ -1401,7 +1401,7 @@ declare module BABYLON.GLTF2 {
          * @param babylonDrawMode The draw mode for the Babylon material
          * @returns The Babylon material
          */
-        createMaterial(context: string, material: ILoaderMaterial, babylonDrawMode: number): Material;
+        createMaterial(context: string, material: Loader.IMaterial, babylonDrawMode: number): Material;
         /**
          * Loads properties from a glTF material into a Babylon material.
          * @param context The context when loading the asset
@@ -1409,7 +1409,7 @@ declare module BABYLON.GLTF2 {
          * @param babylonMaterial The Babylon material
          * @returns A promise that resolves when the load is complete
          */
-        loadMaterialPropertiesAsync(context: string, material: ILoaderMaterial, babylonMaterial: Material): Promise<void>;
+        loadMaterialPropertiesAsync(context: string, material: Loader.IMaterial, babylonMaterial: Material): Promise<void>;
         /**
          * Loads the normal, occlusion, and emissive properties from a glTF material into a Babylon material.
          * @param context The context when loading the asset
@@ -1417,7 +1417,7 @@ declare module BABYLON.GLTF2 {
          * @param babylonMaterial The Babylon material
          * @returns A promise that resolves when the load is complete
          */
-        loadMaterialBasePropertiesAsync(context: string, material: ILoaderMaterial, babylonMaterial: Material): Promise<void>;
+        loadMaterialBasePropertiesAsync(context: string, material: Loader.IMaterial, babylonMaterial: Material): Promise<void>;
         /**
          * Loads the alpha properties from a glTF material into a Babylon material.
          * Must be called after the setting the albedo texture of the Babylon material when the material has an albedo texture.
@@ -1425,7 +1425,7 @@ declare module BABYLON.GLTF2 {
          * @param material The glTF material property
          * @param babylonMaterial The Babylon material
          */
-        loadMaterialAlphaProperties(context: string, material: ILoaderMaterial, babylonMaterial: Material): void;
+        loadMaterialAlphaProperties(context: string, material: Loader.IMaterial, babylonMaterial: Material): void;
         /**
          * Loads a glTF texture info.
          * @param context The context when loading the asset
@@ -1433,7 +1433,7 @@ declare module BABYLON.GLTF2 {
          * @param assign A function called synchronously after parsing the glTF properties
          * @returns A promise that resolves with the loaded Babylon texture when the load is complete
          */
-        loadTextureInfoAsync(context: string, textureInfo: ILoaderTextureInfo, assign?: (babylonTexture: BaseTexture) => void): Promise<BaseTexture>;
+        loadTextureInfoAsync(context: string, textureInfo: Loader.ITextureInfo, assign?: (babylonTexture: BaseTexture) => void): Promise<BaseTexture>;
         private _loadTextureAsync;
         private _loadSampler;
         /**
@@ -1442,7 +1442,7 @@ declare module BABYLON.GLTF2 {
          * @param image The glTF image property
          * @returns A promise that resolves with the loaded data when the load is complete
          */
-        loadImageAsync(context: string, image: ILoaderImage): Promise<ArrayBufferView>;
+        loadImageAsync(context: string, image: Loader.IImage): Promise<ArrayBufferView>;
         /**
          * Loads a glTF uri.
          * @param context The context when loading the asset
@@ -1538,7 +1538,7 @@ declare module BABYLON.GLTF2 {
          * @param scene The glTF scene property
          * @returns A promise that resolves when the load is complete or null if not handled
          */
-        loadSceneAsync?(context: string, scene: ILoaderScene): Nullable<Promise<void>>;
+        loadSceneAsync?(context: string, scene: Loader.IScene): Nullable<Promise<void>>;
         /**
          * Define this method to modify the default behavior when loading nodes.
          * @param context The context when loading the asset
@@ -1546,7 +1546,7 @@ declare module BABYLON.GLTF2 {
          * @param assign A function called synchronously after parsing the glTF properties
          * @returns A promise that resolves with the loaded Babylon mesh when the load is complete or null if not handled
          */
-        loadNodeAsync?(context: string, node: ILoaderNode, assign: (babylonMesh: Mesh) => void): Nullable<Promise<Mesh>>;
+        loadNodeAsync?(context: string, node: Loader.INode, assign: (babylonMesh: Mesh) => void): Nullable<Promise<Mesh>>;
         /**
          * Define this method to modify the default behavior when loading cameras.
          * @param context The context when loading the asset
@@ -1554,14 +1554,14 @@ declare module BABYLON.GLTF2 {
          * @param assign A function called synchronously after parsing the glTF properties
          * @returns A promise that resolves with the loaded Babylon camera when the load is complete or null if not handled
          */
-        loadCameraAsync?(context: string, camera: ILoaderCamera, assign: (babylonCamera: Camera) => void): Nullable<Promise<Camera>>;
+        loadCameraAsync?(context: string, camera: Loader.ICamera, assign: (babylonCamera: Camera) => void): Nullable<Promise<Camera>>;
         /**
          * @hidden Define this method to modify the default behavior when loading vertex data for mesh primitives.
          * @param context The context when loading the asset
          * @param primitive The glTF mesh primitive property
          * @returns A promise that resolves with the loaded geometry when the load is complete or null if not handled
          */
-        _loadVertexDataAsync?(context: string, primitive: ILoaderMeshPrimitive, babylonMesh: Mesh): Nullable<Promise<Geometry>>;
+        _loadVertexDataAsync?(context: string, primitive: Loader.IMeshPrimitive, babylonMesh: Mesh): Nullable<Promise<Geometry>>;
         /**
          * @hidden Define this method to modify the default behavior when loading materials. Load material creates the material and then loads material properties.
          * @param context The context when loading the asset
@@ -1569,7 +1569,7 @@ declare module BABYLON.GLTF2 {
          * @param assign A function called synchronously after parsing the glTF properties
          * @returns A promise that resolves with the loaded Babylon material when the load is complete or null if not handled
          */
-        _loadMaterialAsync?(context: string, material: ILoaderMaterial, babylonMesh: Mesh, babylonDrawMode: number, assign: (babylonMaterial: Material) => void): Nullable<Promise<Material>>;
+        _loadMaterialAsync?(context: string, material: Loader.IMaterial, babylonMesh: Mesh, babylonDrawMode: number, assign: (babylonMaterial: Material) => void): Nullable<Promise<Material>>;
         /**
          * Define this method to modify the default behavior when creating materials.
          * @param context The context when loading the asset
@@ -1577,7 +1577,7 @@ declare module BABYLON.GLTF2 {
          * @param babylonDrawMode The draw mode for the Babylon material
          * @returns The Babylon material or null if not handled
          */
-        createMaterial?(context: string, material: ILoaderMaterial, babylonDrawMode: number): Nullable<Material>;
+        createMaterial?(context: string, material: Loader.IMaterial, babylonDrawMode: number): Nullable<Material>;
         /**
          * Define this method to modify the default behavior when loading material properties.
          * @param context The context when loading the asset
@@ -1585,7 +1585,7 @@ declare module BABYLON.GLTF2 {
          * @param babylonMaterial The Babylon material
          * @returns A promise that resolves when the load is complete or null if not handled
          */
-        loadMaterialPropertiesAsync?(context: string, material: ILoaderMaterial, babylonMaterial: Material): Nullable<Promise<void>>;
+        loadMaterialPropertiesAsync?(context: string, material: Loader.IMaterial, babylonMaterial: Material): Nullable<Promise<void>>;
         /**
          * Define this method to modify the default behavior when loading texture infos.
          * @param context The context when loading the asset
@@ -1593,14 +1593,14 @@ declare module BABYLON.GLTF2 {
          * @param assign A function called synchronously after parsing the glTF properties
          * @returns A promise that resolves with the loaded Babylon texture when the load is complete or null if not handled
          */
-        loadTextureInfoAsync?(context: string, textureInfo: ITextureInfo, assign: (babylonTexture: BaseTexture) => void): Nullable<Promise<BaseTexture>>;
+        loadTextureInfoAsync?(context: string, textureInfo: Loader.ITextureInfo, assign: (babylonTexture: BaseTexture) => void): Nullable<Promise<BaseTexture>>;
         /**
          * Define this method to modify the default behavior when loading animations.
          * @param context The context when loading the asset
          * @param animation The glTF animation property
          * @returns A promise that resolves with the loaded Babylon animation group when the load is complete or null if not handled
          */
-        loadAnimationAsync?(context: string, animation: IAnimation): Nullable<Promise<AnimationGroup>>;
+        loadAnimationAsync?(context: string, animation: Loader.IAnimation): Nullable<Promise<AnimationGroup>>;
         /**
          * Define this method to modify the default behavior when loading uris.
          * @param context The context when loading the asset
@@ -1613,11 +1613,11 @@ declare module BABYLON.GLTF2 {
 /**
  * Defines the module for the built-in glTF 2.0 loader extensions.
  */
-declare module BABYLON.GLTF2.Extensions {
+declare module BABYLON.GLTF2.Loader.Extensions {
 }
 
 
-declare module BABYLON.GLTF2.Extensions {
+declare module BABYLON.GLTF2.Loader.Extensions {
     /**
      * [Specification](https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Vendor/MSFT_lod)
      */
@@ -1656,9 +1656,9 @@ declare module BABYLON.GLTF2.Extensions {
         /** @hidden */
         onReady(): void;
         /** @hidden */
-        loadNodeAsync(context: string, node: ILoaderNode, assign: (babylonMesh: Mesh) => void): Nullable<Promise<Mesh>>;
+        loadNodeAsync(context: string, node: INode, assign: (babylonMesh: Mesh) => void): Nullable<Promise<Mesh>>;
         /** @hidden */
-        _loadMaterialAsync(context: string, material: ILoaderMaterial, babylonMesh: Mesh, babylonDrawMode: number, assign: (babylonMaterial: Material) => void): Nullable<Promise<Material>>;
+        _loadMaterialAsync(context: string, material: IMaterial, babylonMesh: Mesh, babylonDrawMode: number, assign: (babylonMaterial: Material) => void): Nullable<Promise<Material>>;
         /** @hidden */
         _loadUriAsync(context: string, uri: string): Nullable<Promise<ArrayBufferView>>;
         /**
@@ -1670,7 +1670,7 @@ declare module BABYLON.GLTF2.Extensions {
 }
 
 
-declare module BABYLON.GLTF2.Extensions {
+declare module BABYLON.GLTF2.Loader.Extensions {
     /** @hidden */
     class MSFT_minecraftMesh implements IGLTFLoaderExtension {
         readonly name: string;
@@ -1678,12 +1678,12 @@ declare module BABYLON.GLTF2.Extensions {
         private _loader;
         constructor(loader: GLTFLoader);
         dispose(): void;
-        loadMaterialPropertiesAsync(context: string, material: ILoaderMaterial, babylonMaterial: Material): Nullable<Promise<void>>;
+        loadMaterialPropertiesAsync(context: string, material: IMaterial, babylonMaterial: Material): Nullable<Promise<void>>;
     }
 }
 
 
-declare module BABYLON.GLTF2.Extensions {
+declare module BABYLON.GLTF2.Loader.Extensions {
     /** @hidden */
     class MSFT_sRGBFactors implements IGLTFLoaderExtension {
         readonly name: string;
@@ -1691,12 +1691,12 @@ declare module BABYLON.GLTF2.Extensions {
         private _loader;
         constructor(loader: GLTFLoader);
         dispose(): void;
-        loadMaterialPropertiesAsync(context: string, material: ILoaderMaterial, babylonMaterial: Material): Nullable<Promise<void>>;
+        loadMaterialPropertiesAsync(context: string, material: IMaterial, babylonMaterial: Material): Nullable<Promise<void>>;
     }
 }
 
 
-declare module BABYLON.GLTF2.Extensions {
+declare module BABYLON.GLTF2.Loader.Extensions {
     /**
      * [Specification](https://github.com/najadojo/glTF/tree/MSFT_audio_emitter/extensions/2.0/Vendor/MSFT_audio_emitter)
      */
@@ -1715,11 +1715,11 @@ declare module BABYLON.GLTF2.Extensions {
         /** @hidden */
         onLoading(): void;
         /** @hidden */
-        loadSceneAsync(context: string, scene: ILoaderScene): Nullable<Promise<void>>;
+        loadSceneAsync(context: string, scene: IScene): Nullable<Promise<void>>;
         /** @hidden */
-        loadNodeAsync(context: string, node: ILoaderNode, assign: (babylonMesh: Mesh) => void): Nullable<Promise<Mesh>>;
+        loadNodeAsync(context: string, node: INode, assign: (babylonMesh: Mesh) => void): Nullable<Promise<Mesh>>;
         /** @hidden */
-        loadAnimationAsync(context: string, animation: ILoaderAnimation): Nullable<Promise<AnimationGroup>>;
+        loadAnimationAsync(context: string, animation: IAnimation): Nullable<Promise<AnimationGroup>>;
         private _loadClipAsync;
         private _loadEmitterAsync;
         private _getEventAction;
@@ -1728,7 +1728,7 @@ declare module BABYLON.GLTF2.Extensions {
 }
 
 
-declare module BABYLON.GLTF2.Extensions {
+declare module BABYLON.GLTF2.Loader.Extensions {
     /**
      * [Specification](https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Khronos/KHR_draco_mesh_compression)
      */
@@ -1744,12 +1744,12 @@ declare module BABYLON.GLTF2.Extensions {
         /** @hidden */
         dispose(): void;
         /** @hidden */
-        _loadVertexDataAsync(context: string, primitive: ILoaderMeshPrimitive, babylonMesh: Mesh): Nullable<Promise<Geometry>>;
+        _loadVertexDataAsync(context: string, primitive: IMeshPrimitive, babylonMesh: Mesh): Nullable<Promise<Geometry>>;
     }
 }
 
 
-declare module BABYLON.GLTF2.Extensions {
+declare module BABYLON.GLTF2.Loader.Extensions {
     /**
      * [Specification](https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Khronos/KHR_materials_pbrSpecularGlossiness)
      */
@@ -1764,13 +1764,13 @@ declare module BABYLON.GLTF2.Extensions {
         /** @hidden */
         dispose(): void;
         /** @hidden */
-        loadMaterialPropertiesAsync(context: string, material: ILoaderMaterial, babylonMaterial: Material): Nullable<Promise<void>>;
+        loadMaterialPropertiesAsync(context: string, material: IMaterial, babylonMaterial: Material): Nullable<Promise<void>>;
         private _loadSpecularGlossinessPropertiesAsync;
     }
 }
 
 
-declare module BABYLON.GLTF2.Extensions {
+declare module BABYLON.GLTF2.Loader.Extensions {
     /**
      * [Specification](https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Khronos/KHR_materials_unlit)
      */
@@ -1785,13 +1785,13 @@ declare module BABYLON.GLTF2.Extensions {
         /** @hidden */
         dispose(): void;
         /** @hidden */
-        loadMaterialPropertiesAsync(context: string, material: ILoaderMaterial, babylonMaterial: Material): Nullable<Promise<void>>;
+        loadMaterialPropertiesAsync(context: string, material: IMaterial, babylonMaterial: Material): Nullable<Promise<void>>;
         private _loadUnlitPropertiesAsync;
     }
 }
 
 
-declare module BABYLON.GLTF2.Extensions {
+declare module BABYLON.GLTF2.Loader.Extensions {
     /**
      * [Specification](https://github.com/KhronosGroup/glTF/blob/1048d162a44dbcb05aefc1874bfd423cf60135a6/extensions/2.0/Khronos/KHR_lights_punctual/README.md) (Experimental)
      */
@@ -1809,14 +1809,14 @@ declare module BABYLON.GLTF2.Extensions {
         /** @hidden */
         onLoading(): void;
         /** @hidden */
-        loadNodeAsync(context: string, node: ILoaderNode, assign: (babylonMesh: Mesh) => void): Nullable<Promise<Mesh>>;
+        loadNodeAsync(context: string, node: INode, assign: (babylonMesh: Mesh) => void): Nullable<Promise<Mesh>>;
     }
 }
 
 
-declare module BABYLON.GLTF2.Extensions {
+declare module BABYLON.GLTF2.Loader.Extensions {
     /**
-     * [Specification](https://github.com/AltspaceVR/glTF/blob/avr-sampler-offset-tile/extensions/2.0/Khronos/KHR_texture_transform/README.md) (Experimental)
+     * [Specification](https://github.com/KhronosGroup/glTF/blob/master/extensions/2.0/Khronos/KHR_texture_transform/README.md)
      */
     class KHR_texture_transform implements IGLTFLoaderExtension {
         /** The name of this extension. */
@@ -1834,7 +1834,7 @@ declare module BABYLON.GLTF2.Extensions {
 }
 
 
-declare module BABYLON.GLTF2.Extensions {
+declare module BABYLON.GLTF2.Loader.Extensions {
     /**
      * [Specification](https://github.com/KhronosGroup/glTF/blob/eb3e32332042e04691a5f35103f8c261e50d8f1e/extensions/2.0/Khronos/EXT_lights_image_based/README.md) (Experimental)
      */
@@ -1852,7 +1852,7 @@ declare module BABYLON.GLTF2.Extensions {
         /** @hidden */
         onLoading(): void;
         /** @hidden */
-        loadSceneAsync(context: string, scene: ILoaderScene): Nullable<Promise<void>>;
+        loadSceneAsync(context: string, scene: IScene): Nullable<Promise<void>>;
         private _loadLightAsync;
     }
 }

文件差異過大導致無法顯示
+ 1 - 1
dist/preview release/viewer/babylon.viewer.js


文件差異過大導致無法顯示
+ 2 - 2
dist/preview release/viewer/babylon.viewer.max.js


+ 6 - 1
src/Particles/babylon.IParticleSystem.ts

@@ -451,7 +451,12 @@ module BABYLON {
          * You must use addRampGradient and removeRampGradient to udpate this list
          * @returns the list of ramp gradients
          */
-        getRampGradients(): Nullable<Array<Color3Gradient>>;             
+        getRampGradients(): Nullable<Array<Color3Gradient>>;
+        
+        /** Gets or sets a boolean indicating that ramp gradients must be used
+         * @see http://doc.babylonjs.com/babylon101/particles#ramp-gradients
+         */        
+        useRampGradients: boolean;
         
         /**
          * Adds a new color remap gradient

+ 15 - 1
src/Particles/babylon.gpuParticleSystem.ts

@@ -538,7 +538,21 @@
          */
         public getRampGradients(): Nullable<Array<Color3Gradient>> {
             return null;
-        }             
+        }   
+        
+        /** 
+         * Not supported by GPUParticleSystem
+         * Gets or sets a boolean indicating that ramp gradients must be used
+         * @see http://doc.babylonjs.com/babylon101/particles#ramp-gradients
+         */
+        public get useRampGradients(): boolean {
+            //Not supported by GPUParticleSystem
+            return false;
+        }
+
+        public set useRampGradients(value: boolean) {
+            //Not supported by GPUParticleSystem
+        }
         
 
         /**

+ 5 - 2
src/Particles/babylon.particleSystem.ts

@@ -2008,6 +2008,7 @@
 
             if (particleSystem.particleTexture) {
                 serializationObject.textureName = particleSystem.particleTexture.name;
+                serializationObject.invertY = particleSystem.particleTexture._invertY;
             }
 
             // Animations
@@ -2079,6 +2080,7 @@
 
                     serializationObject.rampGradients.push(serializedGradient);
                 }
+                serializationObject.useRampGradients = particleSystem.useRampGradients;
             }
 
             let colorRemapGradients = particleSystem.getColorRemapGradients();
@@ -2254,7 +2256,7 @@
         public static _Parse(parsedParticleSystem: any, particleSystem: IParticleSystem, scene: Scene, rootUrl: string) {
             // Texture
             if (parsedParticleSystem.textureName) {
-                particleSystem.particleTexture = new Texture(rootUrl + parsedParticleSystem.textureName, scene);
+                particleSystem.particleTexture = new Texture(rootUrl + parsedParticleSystem.textureName, scene, false, parsedParticleSystem.invertY !== undefined ? parsedParticleSystem.invertY : true);
                 particleSystem.particleTexture.name = parsedParticleSystem.textureName;
             }
 
@@ -2342,8 +2344,9 @@
 
             if (parsedParticleSystem.rampGradients) {
                 for (var rampGradient of parsedParticleSystem.rampGradients) {
-                    particleSystem.addRampGradient(rampGradient.gradient, Color3.FromArray(rampGradient.color1));
+                    particleSystem.addRampGradient(rampGradient.gradient, Color3.FromArray(rampGradient.color));
                 }
+                particleSystem.useRampGradients = parsedParticleSystem.useRampGradients;
             }
 
             if (parsedParticleSystem.colorRemapGradients) {

+ 0 - 4
src/babylon.node.ts

@@ -535,10 +535,6 @@
          * @returns an array of {BABYLON.Node}
          */
         public getChildren(predicate?: (node: Node) => boolean): Node[] {
-            if (!predicate) {
-                return this._children;
-            }
-
             return this.getDescendants(true, predicate);
         }