Sfoglia il codice sorgente

Merge pull request #6154 from BabylonJS/master

Perf matters
David Catuhe 6 anni fa
parent
commit
2f6a006cc4
88 ha cambiato i file con 1554 aggiunte e 1017 eliminazioni
  1. 45 42
      Playground/babylon.d.txt
  2. 1 1
      Viewer/src/model/viewerModel.ts
  3. 45 42
      dist/preview release/babylon.d.ts
  4. 2 2
      dist/preview release/babylon.js
  5. 468 94
      dist/preview release/babylon.max.js
  6. 1 1
      dist/preview release/babylon.max.js.map
  7. 91 85
      dist/preview release/babylon.module.d.ts
  8. 39 39
      dist/preview release/gui/babylon.gui.js
  9. 1 1
      dist/preview release/gui/babylon.gui.js.map
  10. 2 2
      dist/preview release/inspector/babylon.inspector.bundle.js
  11. 6 1
      dist/preview release/inspector/babylon.inspector.bundle.max.js
  12. 1 1
      dist/preview release/inspector/babylon.inspector.bundle.max.js.map
  13. 6 6
      dist/preview release/loaders/babylon.glTF2FileLoader.js
  14. 1 1
      dist/preview release/loaders/babylon.glTF2FileLoader.js.map
  15. 1 1
      dist/preview release/loaders/babylon.glTF2FileLoader.min.js
  16. 6 6
      dist/preview release/loaders/babylon.glTFFileLoader.js
  17. 1 1
      dist/preview release/loaders/babylon.glTFFileLoader.js.map
  18. 1 1
      dist/preview release/loaders/babylon.glTFFileLoader.min.js
  19. 6 6
      dist/preview release/loaders/babylonjs.loaders.js
  20. 1 1
      dist/preview release/loaders/babylonjs.loaders.js.map
  21. 1 1
      dist/preview release/loaders/babylonjs.loaders.min.js
  22. 1 1
      dist/preview release/packagesSizeBaseLine.json
  23. 91 85
      dist/preview release/viewer/babylon.module.d.ts
  24. 312 312
      dist/preview release/viewer/babylon.viewer.js
  25. 3 3
      dist/preview release/viewer/babylon.viewer.max.js
  26. 1 1
      dist/preview release/what's new.md
  27. 3 1
      inspector/src/components/actionTabs/tabs/propertyGrids/animationPropertyGridComponent.tsx
  28. 4 1
      inspector/src/components/sceneExplorer/entities/sceneTreeItemComponent.tsx
  29. 6 6
      loaders/src/glTF/2.0/glTFLoader.ts
  30. 2 2
      src/Animations/animatable.ts
  31. 5 5
      src/Animations/runtimeAnimation.ts
  32. 1 1
      src/Bones/skeleton.ts
  33. 3 1
      src/Culling/boundingBox.ts
  34. 8 2
      src/Engines/engine.ts
  35. 7 0
      src/Gizmos/boundingBoxGizmo.ts
  36. 16 16
      src/Materials/PBR/pbrBaseMaterial.ts
  37. 4 4
      src/Materials/Textures/baseTexture.ts
  38. 46 46
      src/Materials/Textures/internalTexture.ts
  39. 39 39
      src/Materials/Textures/texture.ts
  40. 11 11
      src/Materials/material.ts
  41. 1 1
      src/Materials/shaderMaterial.ts
  42. 2 2
      src/Maths/math.ts
  43. 13 71
      src/Meshes/abstractMesh.ts
  44. 16 14
      src/Meshes/mesh.ts
  45. 9 9
      src/Meshes/subMesh.ts
  46. 10 3
      src/Meshes/transformNode.ts
  47. 1 1
      src/Misc/tools.ts
  48. 68 8
      src/node.ts
  49. 2 2
      src/scene.ts
  50. BIN
      tests/validation/ReferenceImages/gltfAnimationNode.png
  51. BIN
      tests/validation/ReferenceImages/gltfAnimationNodeMisc.png
  52. BIN
      tests/validation/ReferenceImages/gltfAnimationSkin0.png
  53. BIN
      tests/validation/ReferenceImages/gltfAnimationSkin1.png
  54. BIN
      tests/validation/ReferenceImages/gltfAnimationSkinType.png
  55. BIN
      tests/validation/ReferenceImages/gltfBufferInterleaved.png
  56. BIN
      tests/validation/ReferenceImages/gltfMaterial.png
  57. BIN
      tests/validation/ReferenceImages/gltfMaterialAlphaBlend.png
  58. BIN
      tests/validation/ReferenceImages/gltfMaterialAlphaMask.png
  59. BIN
      tests/validation/ReferenceImages/gltfMaterialDoubleSided.png
  60. BIN
      tests/validation/ReferenceImages/gltfMaterialDoubleSidedBack.png
  61. BIN
      tests/validation/ReferenceImages/gltfMaterialDoubleSidedFront.png
  62. BIN
      tests/validation/ReferenceImages/gltfMaterialMetallicRoughness.png
  63. BIN
      tests/validation/ReferenceImages/gltfMaterialMetallicRoughness0.png
  64. BIN
      tests/validation/ReferenceImages/gltfMaterialMetallicRoughness1.png
  65. BIN
      tests/validation/ReferenceImages/gltfMaterialMixed.png
  66. BIN
      tests/validation/ReferenceImages/gltfMaterialSpecularGlossiness.png
  67. BIN
      tests/validation/ReferenceImages/gltfMaterialSpecularGlossiness0.png
  68. BIN
      tests/validation/ReferenceImages/gltfMaterialSpecularGlossiness1.png
  69. BIN
      tests/validation/ReferenceImages/gltfMeshPrimitiveAttribute.png
  70. BIN
      tests/validation/ReferenceImages/gltfMeshPrimitiveMode.png
  71. BIN
      tests/validation/ReferenceImages/gltfMeshPrimitiveMode0.png
  72. BIN
      tests/validation/ReferenceImages/gltfMeshPrimitiveMode1.png
  73. BIN
      tests/validation/ReferenceImages/gltfMeshPrimitiveVertexColor.png
  74. BIN
      tests/validation/ReferenceImages/gltfMeshPrimitives.png
  75. BIN
      tests/validation/ReferenceImages/gltfMeshPrimitivesUV.png
  76. BIN
      tests/validation/ReferenceImages/gltfMeshPrimitivesUV0.png
  77. BIN
      tests/validation/ReferenceImages/gltfMeshPrimitivesUV1.png
  78. BIN
      tests/validation/ReferenceImages/gltfNodeAttribute0.png
  79. BIN
      tests/validation/ReferenceImages/gltfNodeAttribute1.png
  80. BIN
      tests/validation/ReferenceImages/gltfNodeNegativeScale0.png
  81. BIN
      tests/validation/ReferenceImages/gltfNodeNegativeScale1.png
  82. BIN
      tests/validation/ReferenceImages/gltfPrimitiveAttribute.png
  83. BIN
      tests/validation/ReferenceImages/gltfTextureSampler.png
  84. BIN
      tests/validation/ReferenceImages/gltfTextureSampler0.png
  85. BIN
      tests/validation/ReferenceImages/gltfTextureSampler1.png
  86. BIN
      tests/validation/ReferenceImages/nested_BBG.png
  87. 133 34
      tests/validation/config.json
  88. 10 0
      tests/validation/validation.js

+ 45 - 42
Playground/babylon.d.txt

@@ -484,7 +484,7 @@ declare module BABYLON {
          */
         static FromHexString(hex: string): Color3;
         /**
-         * Creates a new Vector3 from the starting index of the given array
+         * Creates a new Color3 from the starting index of the given array
          * @param array defines the source array
          * @param offset defines an offset in the source array
          * @returns a new Color3 object
@@ -6289,8 +6289,8 @@ declare module BABYLON {
         /** @hidden */
size: number;
         /** @hidden */
extension: string;
         /** @hidden */
files: Nullable<string[]>;
-        /** @hidden */
workingCanvas: HTMLCanvasElement;
-        /** @hidden */
workingContext: CanvasRenderingContext2D;
+        /** @hidden */
workingCanvas: Nullable<HTMLCanvasElement>;
+        /** @hidden */
workingContext: Nullable<CanvasRenderingContext2D>;
         /** @hidden */
framebuffer: Nullable<WebGLFramebuffer>;
         /** @hidden */
depthStencilBuffer: Nullable<WebGLRenderbuffer>;
         /** @hidden */
MSAAFramebuffer: Nullable<WebGLFramebuffer>;
@@ -6311,9 +6311,9 @@ declare module BABYLON {
         /** @hidden */
lodGenerationOffset: number;
         /** @hidden */
colorTextureArray: Nullable<WebGLTexture>;
         /** @hidden */
depthStencilTextureArray: Nullable<WebGLTexture>;
-        /** @hidden */
lodTextureHigh: BaseTexture;
-        /** @hidden */
lodTextureMid: BaseTexture;
-        /** @hidden */
lodTextureLow: BaseTexture;
+        /** @hidden */
lodTextureHigh: Nullable<BaseTexture>;
+        /** @hidden */
lodTextureMid: Nullable<BaseTexture>;
+        /** @hidden */
lodTextureLow: Nullable<BaseTexture>;
         /** @hidden */
isRGBD: boolean;
         /** @hidden */
webGLTexture: Nullable<WebGLTexture>;
         /** @hidden */
references: number;
@@ -7442,7 +7442,7 @@ declare module BABYLON {
          * Gets or sets a boolean indicating that even if rotationQuaternion is defined, you can keep updating rotation property and Babylon.js will just mix both
          */
         reIntegrateRotationIntoRotationQuaternion: boolean;
-        /** @hidden */
poseMatrix: Matrix;
+        /** @hidden */
poseMatrix: Nullable<Matrix>;
         /** @hidden */
localMatrix: Matrix;
         private _usePivotMatrix;
         private _absolutePosition;
@@ -17736,7 +17736,7 @@ declare module BABYLON {
          * List of inspectable custom properties (used by the Inspector)
          * @see https://doc.babylonjs.com/how_to/debug_layer#extensibility
          */
-        inspectableCustomProperties: IInspectable[];
+        inspectableCustomProperties: Nullable<IInspectable[]>;
         private _noMipmap;
         /** @hidden */
invertY: boolean;
         private _rowGenerationMatrix;
@@ -18207,7 +18207,7 @@ declare module BABYLON {
         /**
          * Gets the root Animatable used to synchronize and normalize animations
          */
-        readonly syncRoot: Animatable;
+        readonly syncRoot: Nullable<Animatable>;
         /**
          * Gets the current frame of the first RuntimeAnimation
          * Used to synchronize Animatables
@@ -18628,7 +18628,7 @@ declare module BABYLON {
         /**
          * Clone the current skeleton
          * @param name defines the name of the new skeleton
-         * @param id defines the id of the enw skeleton
+         * @param id defines the id of the new skeleton
          * @returns the new skeleton
          */
         clone(name: string, id: string): Skeleton;
@@ -21337,15 +21337,15 @@ declare module BABYLON {
         /**
          * Callback triggered when the material is compiled
          */
-        onCompiled: (effect: Effect) => void;
+        onCompiled: Nullable<(effect: Effect) => void>;
         /**
          * Callback triggered when an error occurs
          */
-        onError: (effect: Effect, errors: string) => void;
+        onError: Nullable<(effect: Effect, errors: string) => void>;
         /**
          * Callback triggered to get the render target textures
          */
-        getRenderTargetTextures: () => SmartArray<RenderTargetTexture>;
+        getRenderTargetTextures: Nullable<() => SmartArray<RenderTargetTexture>>;
         /**
          * Gets a boolean indicating that current material needs to register RTT
          */
@@ -21360,7 +21360,7 @@ declare module BABYLON {
         /**
          * Stores the animations for the material
          */
-        animations: Array<Animation>;
+        animations: Nullable<Array<Animation>>;
         /**
         * An event triggered when the material is disposed
         */
@@ -21797,7 +21797,7 @@ declare module BABYLON {
         private _linesIndexBuffer;
         /** @hidden */
lastColliderWorldVertices: Nullable<Vector3[]>;
         /** @hidden */
trianglePlanes: Plane[];
-        /** @hidden */
lastColliderTransformMatrix: Matrix;
+        /** @hidden */
lastColliderTransformMatrix: Nullable<Matrix>;
         /** @hidden */
renderId: number;
         /** @hidden */
alphaIndex: number;
         /** @hidden */
distanceToCamera: number;
@@ -23560,7 +23560,7 @@ declare module BABYLON {
         /** @hidden */
occlusionQuery: Nullable<WebGLQuery>;
         private _visibility;
         /** @hidden */
isActive: boolean;
-        /** @hidden */
renderingGroup: RenderingGroup;
+        /** @hidden */
renderingGroup: Nullable<RenderingGroup>;
         /**
          * Gets or sets mesh visibility between 0 and 1 (default is 1)
          */
@@ -23703,7 +23703,7 @@ declare module BABYLON {
         /** @hidden */
unIndexed: boolean;
         /** @hidden */
lightSources: Light[];
         /** @hidden */
protected readonly _positions: Nullable<Vector3[]>;
-        /** @hidden */
waitingActions: any;
+        /** @hidden */
waitingActions: Nullable<any>;
         /** @hidden */
waitingFreezeWorldMatrix: Nullable<boolean>;
         private _skeleton;
         /** @hidden */
bonesTransformMatrices: Nullable<Float32Array>;
@@ -23912,16 +23912,6 @@ declare module BABYLON {
          */
         calcRotatePOV(flipBack: number, twirlClockwise: number, tiltRight: number): Vector3;
         /**
-         * Return the minimum and maximum world vectors of the entire hierarchy under current mesh
-         * @param includeDescendants Include bounding info from descendants as well (true by default)
-         * @param predicate defines a callback function that can be customize to filter what meshes should be included in the list used to compute the bounding vectors
-         * @returns the new bounding vectors
-         */
-        getHierarchyBoundingVectors(includeDescendants?: boolean, predicate?: Nullable<(abstractMesh: AbstractMesh) => boolean>): {
-            min: Vector3;
-            max: Vector3;
-        };
-        /**
          * This method recomputes and sets a new BoundingInfo to the mesh unless it is locked.
          * This means the mesh underlying bounding box and sphere are recomputed.
          * @param applySkeleton defines whether to apply the skeleton before computing the bounding info
@@ -23972,7 +23962,7 @@ declare module BABYLON {
          * Gets Collider object used to compute collisions (not physics)
          * @see http://doc.babylonjs.com/babylon101/cameras,_mesh_collisions_and_gravity
          */
-        readonly collider: Collider;
+        readonly collider: Nullable<Collider>;
         /**
          * Move the mesh using collision engine
          * @see http://doc.babylonjs.com/babylon101/cameras,_mesh_collisions_and_gravity
@@ -24409,7 +24399,7 @@ declare module BABYLON {
         /**
          * Callback raised when the node is ready to be used
          */
-        onReady: (node: Node) => void;
+        onReady: Nullable<(node: Node) => void>;
         private _isEnabled;
         private _isParentEnabled;
         private _isReady;
@@ -24638,6 +24628,16 @@ declare module BABYLON {
          * @param scene defines the hosting scene
          */
         static ParseAnimationRanges(node: Node, parsedNode: any, scene: Scene): void;
+        /**
+     * Return the minimum and maximum world vectors of the entire hierarchy under current node
+     * @param includeDescendants Include bounding info from descendants as well (true by default)
+     * @param predicate defines a callback function that can be customize to filter what meshes should be included in the list used to compute the bounding vectors
+     * @returns the new bounding vectors
+     */
+        getHierarchyBoundingVectors(includeDescendants?: boolean, predicate?: Nullable<(abstractMesh: AbstractMesh) => boolean>): {
+            min: Vector3;
+            max: Vector3;
+        };
     }
 }
 declare module BABYLON {
@@ -27614,7 +27614,7 @@ declare module BABYLON {
          * @param indexParameters defines an object containing the index values to use to compile shaders (like the maximum number of simultaneous lights)
          * @returns the new Effect
          */
-        createEffect(baseName: any, attributesNamesOrOptions: string[] | EffectCreationOptions, uniformsNamesOrEngine: string[] | Engine, samplers?: string[], defines?: string, fallbacks?: EffectFallbacks, onCompiled?: (effect: Effect) => void, onError?: (effect: Effect, errors: string) => void, indexParameters?: any): Effect;
+        createEffect(baseName: any, attributesNamesOrOptions: string[] | EffectCreationOptions, uniformsNamesOrEngine: string[] | Engine, samplers?: string[], defines?: string, fallbacks?: EffectFallbacks, onCompiled?: Nullable<(effect: Effect) => void>, onError?: Nullable<(effect: Effect, errors: string) => void>, indexParameters?: any): Effect;
         private _compileShader;
         private _compileRawShader;
         /**
@@ -30050,7 +30050,7 @@ declare module BABYLON {
         /**
          * Array of animations
          */
-        animations: Array<Animation>;
+        animations: Nullable<Array<Animation>>;
     }
     /** Interface used by value gradients (color, factor, ...) */
     export interface IValueGradient {
@@ -41589,6 +41589,9 @@ declare module BABYLON {
          * Relative bounding box pivot used when scaling the attached mesh. When null object with scale from the opposite corner. 0.5,0.5,0.5 for center and 0.5,0,0.5 for bottom (Default: null)
          */
         scalePivot: Nullable<Vector3>;
+        /**
+         * Mesh used as a pivot to rotate the attached mesh
+         */
         private _anchorMesh;
         private _existingMeshScale;
         private _dragMesh;
@@ -44082,11 +44085,11 @@ declare module BABYLON {
         /**
          * AKA Diffuse Texture in standard nomenclature.
          */
-        protected _albedoTexture: BaseTexture;
+        protected _albedoTexture: Nullable<BaseTexture>;
         /**
          * AKA Occlusion Texture in other nomenclature.
          */
-        protected _ambientTexture: BaseTexture;
+        protected _ambientTexture: Nullable<BaseTexture>;
         /**
          * AKA Occlusion Texture Intensity in other nomenclature.
          */
@@ -44100,23 +44103,23 @@ declare module BABYLON {
         /**
          * Stores the alpha values in a texture.
          */
-        protected _opacityTexture: BaseTexture;
+        protected _opacityTexture: Nullable<BaseTexture>;
         /**
          * Stores the reflection values in a texture.
          */
-        protected _reflectionTexture: BaseTexture;
+        protected _reflectionTexture: Nullable<BaseTexture>;
         /**
          * Stores the emissive values in a texture.
          */
-        protected _emissiveTexture: BaseTexture;
+        protected _emissiveTexture: Nullable<BaseTexture>;
         /**
          * AKA Specular texture in other nomenclature.
          */
-        protected _reflectivityTexture: BaseTexture;
+        protected _reflectivityTexture: Nullable<BaseTexture>;
         /**
          * Used to switch from specular/glossiness to metallic/roughness workflow.
          */
-        protected _metallicTexture: BaseTexture;
+        protected _metallicTexture: Nullable<BaseTexture>;
         /**
          * Specifies the metallic scalar of the metallic/roughness workflow.
          * Can also be used to scale the metalness values of the metallic texture.
@@ -44131,15 +44134,15 @@ declare module BABYLON {
          * Used to enable roughness/glossiness fetch from a separate channel depending on the current mode.
          * Gray Scale represents roughness in metallic mode and glossiness in specular mode.
          */
-        protected _microSurfaceTexture: BaseTexture;
+        protected _microSurfaceTexture: Nullable<BaseTexture>;
         /**
          * Stores surface normal data used to displace a mesh in a texture.
          */
-        protected _bumpTexture: BaseTexture;
+        protected _bumpTexture: Nullable<BaseTexture>;
         /**
          * Stores the pre-calculated light information of a mesh in a texture.
          */
-        protected _lightmapTexture: BaseTexture;
+        protected _lightmapTexture: Nullable<BaseTexture>;
         /**
          * The color of a material in ambient lighting.
          */
@@ -44442,7 +44445,7 @@ declare module BABYLON {
         /**
          * Gets the texture used for the alpha test.
          */
-        getAlphaTestTexture(): BaseTexture;
+        getAlphaTestTexture(): Nullable<BaseTexture>;
         /**
          * Specifies that the submesh is ready to be used.
          * @param mesh - BJS mesh.

+ 1 - 1
Viewer/src/model/viewerModel.ts

@@ -264,7 +264,7 @@ export class ViewerModel implements IDisposable {
                 let ag = new AnimationGroup("animation-" + idx, this._configurationContainer && this._configurationContainer.scene);
                 let add = false;
                 skeleton.getAnimatables().forEach((a) => {
-                    if (a.animations[0]) {
+                    if (a.animations && a.animations[0]) {
                         ag.addTargetedAnimation(a.animations[0], a);
                         add = true;
                     }

+ 45 - 42
dist/preview release/babylon.d.ts

@@ -484,7 +484,7 @@ declare module BABYLON {
          */
         static FromHexString(hex: string): Color3;
         /**
-         * Creates a new Vector3 from the starting index of the given array
+         * Creates a new Color3 from the starting index of the given array
          * @param array defines the source array
          * @param offset defines an offset in the source array
          * @returns a new Color3 object
@@ -6325,9 +6325,9 @@ declare module BABYLON {
         /** @hidden */
         _files: Nullable<string[]>;
         /** @hidden */
-        _workingCanvas: HTMLCanvasElement;
+        _workingCanvas: Nullable<HTMLCanvasElement>;
         /** @hidden */
-        _workingContext: CanvasRenderingContext2D;
+        _workingContext: Nullable<CanvasRenderingContext2D>;
         /** @hidden */
         _framebuffer: Nullable<WebGLFramebuffer>;
         /** @hidden */
@@ -6369,11 +6369,11 @@ declare module BABYLON {
         /** @hidden */
         _depthStencilTextureArray: Nullable<WebGLTexture>;
         /** @hidden */
-        _lodTextureHigh: BaseTexture;
+        _lodTextureHigh: Nullable<BaseTexture>;
         /** @hidden */
-        _lodTextureMid: BaseTexture;
+        _lodTextureMid: Nullable<BaseTexture>;
         /** @hidden */
-        _lodTextureLow: BaseTexture;
+        _lodTextureLow: Nullable<BaseTexture>;
         /** @hidden */
         _isRGBD: boolean;
         /** @hidden */
@@ -7525,7 +7525,7 @@ declare module BABYLON {
          */
         reIntegrateRotationIntoRotationQuaternion: boolean;
         /** @hidden */
-        _poseMatrix: Matrix;
+        _poseMatrix: Nullable<Matrix>;
         /** @hidden */
         _localMatrix: Matrix;
         private _usePivotMatrix;
@@ -18009,7 +18009,7 @@ declare module BABYLON {
          * List of inspectable custom properties (used by the Inspector)
          * @see https://doc.babylonjs.com/how_to/debug_layer#extensibility
          */
-        inspectableCustomProperties: IInspectable[];
+        inspectableCustomProperties: Nullable<IInspectable[]>;
         private _noMipmap;
         /** @hidden */
         _invertY: boolean;
@@ -18485,7 +18485,7 @@ declare module BABYLON {
         /**
          * Gets the root Animatable used to synchronize and normalize animations
          */
-        readonly syncRoot: Animatable;
+        readonly syncRoot: Nullable<Animatable>;
         /**
          * Gets the current frame of the first RuntimeAnimation
          * Used to synchronize Animatables
@@ -18915,7 +18915,7 @@ declare module BABYLON {
         /**
          * Clone the current skeleton
          * @param name defines the name of the new skeleton
-         * @param id defines the id of the enw skeleton
+         * @param id defines the id of the new skeleton
          * @returns the new skeleton
          */
         clone(name: string, id: string): Skeleton;
@@ -21669,15 +21669,15 @@ declare module BABYLON {
         /**
          * Callback triggered when the material is compiled
          */
-        onCompiled: (effect: Effect) => void;
+        onCompiled: Nullable<(effect: Effect) => void>;
         /**
          * Callback triggered when an error occurs
          */
-        onError: (effect: Effect, errors: string) => void;
+        onError: Nullable<(effect: Effect, errors: string) => void>;
         /**
          * Callback triggered to get the render target textures
          */
-        getRenderTargetTextures: () => SmartArray<RenderTargetTexture>;
+        getRenderTargetTextures: Nullable<() => SmartArray<RenderTargetTexture>>;
         /**
          * Gets a boolean indicating that current material needs to register RTT
          */
@@ -21693,7 +21693,7 @@ declare module BABYLON {
         /**
          * Stores the animations for the material
          */
-        animations: Array<Animation>;
+        animations: Nullable<Array<Animation>>;
         /**
         * An event triggered when the material is disposed
         */
@@ -22140,7 +22140,7 @@ declare module BABYLON {
         /** @hidden */
         _trianglePlanes: Plane[];
         /** @hidden */
-        _lastColliderTransformMatrix: Matrix;
+        _lastColliderTransformMatrix: Nullable<Matrix>;
         /** @hidden */
         _renderId: number;
         /** @hidden */
@@ -23944,7 +23944,7 @@ declare module BABYLON {
         /** @hidden */
         _isActive: boolean;
         /** @hidden */
-        _renderingGroup: RenderingGroup;
+        _renderingGroup: Nullable<RenderingGroup>;
         /**
          * Gets or sets mesh visibility between 0 and 1 (default is 1)
          */
@@ -24096,7 +24096,7 @@ declare module BABYLON {
         /** @hidden */
         readonly _positions: Nullable<Vector3[]>;
         /** @hidden */
-        _waitingActions: any;
+        _waitingActions: Nullable<any>;
         /** @hidden */
         _waitingFreezeWorldMatrix: Nullable<boolean>;
         private _skeleton;
@@ -24322,16 +24322,6 @@ declare module BABYLON {
          */
         calcRotatePOV(flipBack: number, twirlClockwise: number, tiltRight: number): Vector3;
         /**
-         * Return the minimum and maximum world vectors of the entire hierarchy under current mesh
-         * @param includeDescendants Include bounding info from descendants as well (true by default)
-         * @param predicate defines a callback function that can be customize to filter what meshes should be included in the list used to compute the bounding vectors
-         * @returns the new bounding vectors
-         */
-        getHierarchyBoundingVectors(includeDescendants?: boolean, predicate?: Nullable<(abstractMesh: AbstractMesh) => boolean>): {
-            min: Vector3;
-            max: Vector3;
-        };
-        /**
          * This method recomputes and sets a new BoundingInfo to the mesh unless it is locked.
          * This means the mesh underlying bounding box and sphere are recomputed.
          * @param applySkeleton defines whether to apply the skeleton before computing the bounding info
@@ -24387,7 +24377,7 @@ declare module BABYLON {
          * Gets Collider object used to compute collisions (not physics)
          * @see http://doc.babylonjs.com/babylon101/cameras,_mesh_collisions_and_gravity
          */
-        readonly collider: Collider;
+        readonly collider: Nullable<Collider>;
         /**
          * Move the mesh using collision engine
          * @see http://doc.babylonjs.com/babylon101/cameras,_mesh_collisions_and_gravity
@@ -24831,7 +24821,7 @@ declare module BABYLON {
         /**
          * Callback raised when the node is ready to be used
          */
-        onReady: (node: Node) => void;
+        onReady: Nullable<(node: Node) => void>;
         private _isEnabled;
         private _isParentEnabled;
         private _isReady;
@@ -25077,6 +25067,16 @@ declare module BABYLON {
          * @param scene defines the hosting scene
          */
         static ParseAnimationRanges(node: Node, parsedNode: any, scene: Scene): void;
+        /**
+     * Return the minimum and maximum world vectors of the entire hierarchy under current node
+     * @param includeDescendants Include bounding info from descendants as well (true by default)
+     * @param predicate defines a callback function that can be customize to filter what meshes should be included in the list used to compute the bounding vectors
+     * @returns the new bounding vectors
+     */
+        getHierarchyBoundingVectors(includeDescendants?: boolean, predicate?: Nullable<(abstractMesh: AbstractMesh) => boolean>): {
+            min: Vector3;
+            max: Vector3;
+        };
     }
 }
 declare module BABYLON {
@@ -28081,7 +28081,7 @@ declare module BABYLON {
          * @param indexParameters defines an object containing the index values to use to compile shaders (like the maximum number of simultaneous lights)
          * @returns the new Effect
          */
-        createEffect(baseName: any, attributesNamesOrOptions: string[] | EffectCreationOptions, uniformsNamesOrEngine: string[] | Engine, samplers?: string[], defines?: string, fallbacks?: EffectFallbacks, onCompiled?: (effect: Effect) => void, onError?: (effect: Effect, errors: string) => void, indexParameters?: any): Effect;
+        createEffect(baseName: any, attributesNamesOrOptions: string[] | EffectCreationOptions, uniformsNamesOrEngine: string[] | Engine, samplers?: string[], defines?: string, fallbacks?: EffectFallbacks, onCompiled?: Nullable<(effect: Effect) => void>, onError?: Nullable<(effect: Effect, errors: string) => void>, indexParameters?: any): Effect;
         private _compileShader;
         private _compileRawShader;
         /**
@@ -30587,7 +30587,7 @@ declare module BABYLON {
         /**
          * Array of animations
          */
-        animations: Array<Animation>;
+        animations: Nullable<Array<Animation>>;
     }
     /** Interface used by value gradients (color, factor, ...) */
     export interface IValueGradient {
@@ -42259,6 +42259,9 @@ declare module BABYLON {
          * Relative bounding box pivot used when scaling the attached mesh. When null object with scale from the opposite corner. 0.5,0.5,0.5 for center and 0.5,0,0.5 for bottom (Default: null)
          */
         scalePivot: Nullable<Vector3>;
+        /**
+         * Mesh used as a pivot to rotate the attached mesh
+         */
         private _anchorMesh;
         private _existingMeshScale;
         private _dragMesh;
@@ -44764,11 +44767,11 @@ declare module BABYLON {
         /**
          * AKA Diffuse Texture in standard nomenclature.
          */
-        protected _albedoTexture: BaseTexture;
+        protected _albedoTexture: Nullable<BaseTexture>;
         /**
          * AKA Occlusion Texture in other nomenclature.
          */
-        protected _ambientTexture: BaseTexture;
+        protected _ambientTexture: Nullable<BaseTexture>;
         /**
          * AKA Occlusion Texture Intensity in other nomenclature.
          */
@@ -44782,23 +44785,23 @@ declare module BABYLON {
         /**
          * Stores the alpha values in a texture.
          */
-        protected _opacityTexture: BaseTexture;
+        protected _opacityTexture: Nullable<BaseTexture>;
         /**
          * Stores the reflection values in a texture.
          */
-        protected _reflectionTexture: BaseTexture;
+        protected _reflectionTexture: Nullable<BaseTexture>;
         /**
          * Stores the emissive values in a texture.
          */
-        protected _emissiveTexture: BaseTexture;
+        protected _emissiveTexture: Nullable<BaseTexture>;
         /**
          * AKA Specular texture in other nomenclature.
          */
-        protected _reflectivityTexture: BaseTexture;
+        protected _reflectivityTexture: Nullable<BaseTexture>;
         /**
          * Used to switch from specular/glossiness to metallic/roughness workflow.
          */
-        protected _metallicTexture: BaseTexture;
+        protected _metallicTexture: Nullable<BaseTexture>;
         /**
          * Specifies the metallic scalar of the metallic/roughness workflow.
          * Can also be used to scale the metalness values of the metallic texture.
@@ -44813,15 +44816,15 @@ declare module BABYLON {
          * Used to enable roughness/glossiness fetch from a separate channel depending on the current mode.
          * Gray Scale represents roughness in metallic mode and glossiness in specular mode.
          */
-        protected _microSurfaceTexture: BaseTexture;
+        protected _microSurfaceTexture: Nullable<BaseTexture>;
         /**
          * Stores surface normal data used to displace a mesh in a texture.
          */
-        protected _bumpTexture: BaseTexture;
+        protected _bumpTexture: Nullable<BaseTexture>;
         /**
          * Stores the pre-calculated light information of a mesh in a texture.
          */
-        protected _lightmapTexture: BaseTexture;
+        protected _lightmapTexture: Nullable<BaseTexture>;
         /**
          * The color of a material in ambient lighting.
          */
@@ -45124,7 +45127,7 @@ declare module BABYLON {
         /**
          * Gets the texture used for the alpha test.
          */
-        getAlphaTestTexture(): BaseTexture;
+        getAlphaTestTexture(): Nullable<BaseTexture>;
         /**
          * Specifies that the submesh is ready to be used.
          * @param mesh - BJS mesh.

File diff suppressed because it is too large
+ 2 - 2
dist/preview release/babylon.js


File diff suppressed because it is too large
+ 468 - 94
dist/preview release/babylon.max.js


File diff suppressed because it is too large
+ 1 - 1
dist/preview release/babylon.max.js.map


+ 91 - 85
dist/preview release/babylon.module.d.ts

@@ -486,7 +486,7 @@ declare module "babylonjs/Maths/math" {
          */
         static FromHexString(hex: string): Color3;
         /**
-         * Creates a new Vector3 from the starting index of the given array
+         * Creates a new Color3 from the starting index of the given array
          * @param array defines the source array
          * @param offset defines an offset in the source array
          * @returns a new Color3 object
@@ -6350,9 +6350,9 @@ declare module "babylonjs/Materials/Textures/internalTexture" {
         /** @hidden */
         _files: Nullable<string[]>;
         /** @hidden */
-        _workingCanvas: HTMLCanvasElement;
+        _workingCanvas: Nullable<HTMLCanvasElement>;
         /** @hidden */
-        _workingContext: CanvasRenderingContext2D;
+        _workingContext: Nullable<CanvasRenderingContext2D>;
         /** @hidden */
         _framebuffer: Nullable<WebGLFramebuffer>;
         /** @hidden */
@@ -6394,11 +6394,11 @@ declare module "babylonjs/Materials/Textures/internalTexture" {
         /** @hidden */
         _depthStencilTextureArray: Nullable<WebGLTexture>;
         /** @hidden */
-        _lodTextureHigh: BaseTexture;
+        _lodTextureHigh: Nullable<BaseTexture>;
         /** @hidden */
-        _lodTextureMid: BaseTexture;
+        _lodTextureMid: Nullable<BaseTexture>;
         /** @hidden */
-        _lodTextureLow: BaseTexture;
+        _lodTextureLow: Nullable<BaseTexture>;
         /** @hidden */
         _isRGBD: boolean;
         /** @hidden */
@@ -7580,7 +7580,7 @@ declare module "babylonjs/Meshes/transformNode" {
          */
         reIntegrateRotationIntoRotationQuaternion: boolean;
         /** @hidden */
-        _poseMatrix: Matrix;
+        _poseMatrix: Nullable<Matrix>;
         /** @hidden */
         _localMatrix: Matrix;
         private _usePivotMatrix;
@@ -18488,7 +18488,7 @@ declare module "babylonjs/Materials/Textures/texture" {
          * List of inspectable custom properties (used by the Inspector)
          * @see https://doc.babylonjs.com/how_to/debug_layer#extensibility
          */
-        inspectableCustomProperties: IInspectable[];
+        inspectableCustomProperties: Nullable<IInspectable[]>;
         private _noMipmap;
         /** @hidden */
         _invertY: boolean;
@@ -18976,7 +18976,7 @@ declare module "babylonjs/Animations/animatable" {
         /**
          * Gets the root Animatable used to synchronize and normalize animations
          */
-        readonly syncRoot: Animatable;
+        readonly syncRoot: Nullable<Animatable>;
         /**
          * Gets the current frame of the first RuntimeAnimation
          * Used to synchronize Animatables
@@ -19423,7 +19423,7 @@ declare module "babylonjs/Bones/skeleton" {
         /**
          * Clone the current skeleton
          * @param name defines the name of the new skeleton
-         * @param id defines the id of the enw skeleton
+         * @param id defines the id of the new skeleton
          * @returns the new skeleton
          */
         clone(name: string, id: string): Skeleton;
@@ -22246,15 +22246,15 @@ declare module "babylonjs/Materials/material" {
         /**
          * Callback triggered when the material is compiled
          */
-        onCompiled: (effect: Effect) => void;
+        onCompiled: Nullable<(effect: Effect) => void>;
         /**
          * Callback triggered when an error occurs
          */
-        onError: (effect: Effect, errors: string) => void;
+        onError: Nullable<(effect: Effect, errors: string) => void>;
         /**
          * Callback triggered to get the render target textures
          */
-        getRenderTargetTextures: () => SmartArray<RenderTargetTexture>;
+        getRenderTargetTextures: Nullable<() => SmartArray<RenderTargetTexture>>;
         /**
          * Gets a boolean indicating that current material needs to register RTT
          */
@@ -22270,7 +22270,7 @@ declare module "babylonjs/Materials/material" {
         /**
          * Stores the animations for the material
          */
-        animations: Array<Animation>;
+        animations: Nullable<Array<Animation>>;
         /**
         * An event triggered when the material is disposed
         */
@@ -22730,7 +22730,7 @@ declare module "babylonjs/Meshes/subMesh" {
         /** @hidden */
         _trianglePlanes: Plane[];
         /** @hidden */
-        _lastColliderTransformMatrix: Matrix;
+        _lastColliderTransformMatrix: Nullable<Matrix>;
         /** @hidden */
         _renderId: number;
         /** @hidden */
@@ -24582,7 +24582,7 @@ declare module "babylonjs/Meshes/abstractMesh" {
         /** @hidden */
         _isActive: boolean;
         /** @hidden */
-        _renderingGroup: RenderingGroup;
+        _renderingGroup: Nullable<RenderingGroup>;
         /**
          * Gets or sets mesh visibility between 0 and 1 (default is 1)
          */
@@ -24734,7 +24734,7 @@ declare module "babylonjs/Meshes/abstractMesh" {
         /** @hidden */
         readonly _positions: Nullable<Vector3[]>;
         /** @hidden */
-        _waitingActions: any;
+        _waitingActions: Nullable<any>;
         /** @hidden */
         _waitingFreezeWorldMatrix: Nullable<boolean>;
         private _skeleton;
@@ -24960,16 +24960,6 @@ declare module "babylonjs/Meshes/abstractMesh" {
          */
         calcRotatePOV(flipBack: number, twirlClockwise: number, tiltRight: number): Vector3;
         /**
-         * Return the minimum and maximum world vectors of the entire hierarchy under current mesh
-         * @param includeDescendants Include bounding info from descendants as well (true by default)
-         * @param predicate defines a callback function that can be customize to filter what meshes should be included in the list used to compute the bounding vectors
-         * @returns the new bounding vectors
-         */
-        getHierarchyBoundingVectors(includeDescendants?: boolean, predicate?: Nullable<(abstractMesh: AbstractMesh) => boolean>): {
-            min: Vector3;
-            max: Vector3;
-        };
-        /**
          * This method recomputes and sets a new BoundingInfo to the mesh unless it is locked.
          * This means the mesh underlying bounding box and sphere are recomputed.
          * @param applySkeleton defines whether to apply the skeleton before computing the bounding info
@@ -25025,7 +25015,7 @@ declare module "babylonjs/Meshes/abstractMesh" {
          * Gets Collider object used to compute collisions (not physics)
          * @see http://doc.babylonjs.com/babylon101/cameras,_mesh_collisions_and_gravity
          */
-        readonly collider: Collider;
+        readonly collider: Nullable<Collider>;
         /**
          * Move the mesh using collision engine
          * @see http://doc.babylonjs.com/babylon101/cameras,_mesh_collisions_and_gravity
@@ -25409,7 +25399,7 @@ declare module "babylonjs/Actions/abstractActionManager" {
 declare module "babylonjs/node" {
     import { Scene } from "babylonjs/scene";
     import { Nullable } from "babylonjs/types";
-    import { Matrix } from "babylonjs/Maths/math";
+    import { Matrix, Vector3 } from "babylonjs/Maths/math";
     import { Engine } from "babylonjs/Engines/engine";
     import { IBehaviorAware, Behavior } from "babylonjs/Behaviors/behavior";
     import { Observable } from "babylonjs/Misc/observable";
@@ -25491,7 +25481,7 @@ declare module "babylonjs/node" {
         /**
          * Callback raised when the node is ready to be used
          */
-        onReady: (node: Node) => void;
+        onReady: Nullable<(node: Node) => void>;
         private _isEnabled;
         private _isParentEnabled;
         private _isReady;
@@ -25737,6 +25727,16 @@ declare module "babylonjs/node" {
          * @param scene defines the hosting scene
          */
         static ParseAnimationRanges(node: Node, parsedNode: any, scene: Scene): void;
+        /**
+     * Return the minimum and maximum world vectors of the entire hierarchy under current node
+     * @param includeDescendants Include bounding info from descendants as well (true by default)
+     * @param predicate defines a callback function that can be customize to filter what meshes should be included in the list used to compute the bounding vectors
+     * @returns the new bounding vectors
+     */
+        getHierarchyBoundingVectors(includeDescendants?: boolean, predicate?: Nullable<(abstractMesh: AbstractMesh) => boolean>): {
+            min: Vector3;
+            max: Vector3;
+        };
     }
 }
 declare module "babylonjs/Animations/animation" {
@@ -28803,7 +28803,7 @@ declare module "babylonjs/Engines/engine" {
          * @param indexParameters defines an object containing the index values to use to compile shaders (like the maximum number of simultaneous lights)
          * @returns the new Effect
          */
-        createEffect(baseName: any, attributesNamesOrOptions: string[] | EffectCreationOptions, uniformsNamesOrEngine: string[] | Engine, samplers?: string[], defines?: string, fallbacks?: EffectFallbacks, onCompiled?: (effect: Effect) => void, onError?: (effect: Effect, errors: string) => void, indexParameters?: any): Effect;
+        createEffect(baseName: any, attributesNamesOrOptions: string[] | EffectCreationOptions, uniformsNamesOrEngine: string[] | Engine, samplers?: string[], defines?: string, fallbacks?: EffectFallbacks, onCompiled?: Nullable<(effect: Effect) => void>, onError?: Nullable<(effect: Effect, errors: string) => void>, indexParameters?: any): Effect;
         private _compileShader;
         private _compileRawShader;
         /**
@@ -31354,7 +31354,7 @@ declare module "babylonjs/Misc/tools" {
         /**
          * Array of animations
          */
-        animations: Array<Animation>;
+        animations: Nullable<Array<Animation>>;
     }
     /** Interface used by value gradients (color, factor, ...) */
     export interface IValueGradient {
@@ -43832,6 +43832,9 @@ declare module "babylonjs/Gizmos/boundingBoxGizmo" {
          * Relative bounding box pivot used when scaling the attached mesh. When null object with scale from the opposite corner. 0.5,0.5,0.5 for center and 0.5,0,0.5 for bottom (Default: null)
          */
         scalePivot: Nullable<Vector3>;
+        /**
+         * Mesh used as a pivot to rotate the attached mesh
+         */
         private _anchorMesh;
         private _existingMeshScale;
         private _dragMesh;
@@ -46576,11 +46579,11 @@ declare module "babylonjs/Materials/PBR/pbrBaseMaterial" {
         /**
          * AKA Diffuse Texture in standard nomenclature.
          */
-        protected _albedoTexture: BaseTexture;
+        protected _albedoTexture: Nullable<BaseTexture>;
         /**
          * AKA Occlusion Texture in other nomenclature.
          */
-        protected _ambientTexture: BaseTexture;
+        protected _ambientTexture: Nullable<BaseTexture>;
         /**
          * AKA Occlusion Texture Intensity in other nomenclature.
          */
@@ -46594,23 +46597,23 @@ declare module "babylonjs/Materials/PBR/pbrBaseMaterial" {
         /**
          * Stores the alpha values in a texture.
          */
-        protected _opacityTexture: BaseTexture;
+        protected _opacityTexture: Nullable<BaseTexture>;
         /**
          * Stores the reflection values in a texture.
          */
-        protected _reflectionTexture: BaseTexture;
+        protected _reflectionTexture: Nullable<BaseTexture>;
         /**
          * Stores the emissive values in a texture.
          */
-        protected _emissiveTexture: BaseTexture;
+        protected _emissiveTexture: Nullable<BaseTexture>;
         /**
          * AKA Specular texture in other nomenclature.
          */
-        protected _reflectivityTexture: BaseTexture;
+        protected _reflectivityTexture: Nullable<BaseTexture>;
         /**
          * Used to switch from specular/glossiness to metallic/roughness workflow.
          */
-        protected _metallicTexture: BaseTexture;
+        protected _metallicTexture: Nullable<BaseTexture>;
         /**
          * Specifies the metallic scalar of the metallic/roughness workflow.
          * Can also be used to scale the metalness values of the metallic texture.
@@ -46625,15 +46628,15 @@ declare module "babylonjs/Materials/PBR/pbrBaseMaterial" {
          * Used to enable roughness/glossiness fetch from a separate channel depending on the current mode.
          * Gray Scale represents roughness in metallic mode and glossiness in specular mode.
          */
-        protected _microSurfaceTexture: BaseTexture;
+        protected _microSurfaceTexture: Nullable<BaseTexture>;
         /**
          * Stores surface normal data used to displace a mesh in a texture.
          */
-        protected _bumpTexture: BaseTexture;
+        protected _bumpTexture: Nullable<BaseTexture>;
         /**
          * Stores the pre-calculated light information of a mesh in a texture.
          */
-        protected _lightmapTexture: BaseTexture;
+        protected _lightmapTexture: Nullable<BaseTexture>;
         /**
          * The color of a material in ambient lighting.
          */
@@ -46936,7 +46939,7 @@ declare module "babylonjs/Materials/PBR/pbrBaseMaterial" {
         /**
          * Gets the texture used for the alpha test.
          */
-        getAlphaTestTexture(): BaseTexture;
+        getAlphaTestTexture(): Nullable<BaseTexture>;
         /**
          * Specifies that the submesh is ready to be used.
          * @param mesh - BJS mesh.
@@ -59973,7 +59976,7 @@ declare module BABYLON {
          */
         static FromHexString(hex: string): Color3;
         /**
-         * Creates a new Vector3 from the starting index of the given array
+         * Creates a new Color3 from the starting index of the given array
          * @param array defines the source array
          * @param offset defines an offset in the source array
          * @returns a new Color3 object
@@ -65814,9 +65817,9 @@ declare module BABYLON {
         /** @hidden */
         _files: Nullable<string[]>;
         /** @hidden */
-        _workingCanvas: HTMLCanvasElement;
+        _workingCanvas: Nullable<HTMLCanvasElement>;
         /** @hidden */
-        _workingContext: CanvasRenderingContext2D;
+        _workingContext: Nullable<CanvasRenderingContext2D>;
         /** @hidden */
         _framebuffer: Nullable<WebGLFramebuffer>;
         /** @hidden */
@@ -65858,11 +65861,11 @@ declare module BABYLON {
         /** @hidden */
         _depthStencilTextureArray: Nullable<WebGLTexture>;
         /** @hidden */
-        _lodTextureHigh: BaseTexture;
+        _lodTextureHigh: Nullable<BaseTexture>;
         /** @hidden */
-        _lodTextureMid: BaseTexture;
+        _lodTextureMid: Nullable<BaseTexture>;
         /** @hidden */
-        _lodTextureLow: BaseTexture;
+        _lodTextureLow: Nullable<BaseTexture>;
         /** @hidden */
         _isRGBD: boolean;
         /** @hidden */
@@ -67014,7 +67017,7 @@ declare module BABYLON {
          */
         reIntegrateRotationIntoRotationQuaternion: boolean;
         /** @hidden */
-        _poseMatrix: Matrix;
+        _poseMatrix: Nullable<Matrix>;
         /** @hidden */
         _localMatrix: Matrix;
         private _usePivotMatrix;
@@ -77498,7 +77501,7 @@ declare module BABYLON {
          * List of inspectable custom properties (used by the Inspector)
          * @see https://doc.babylonjs.com/how_to/debug_layer#extensibility
          */
-        inspectableCustomProperties: IInspectable[];
+        inspectableCustomProperties: Nullable<IInspectable[]>;
         private _noMipmap;
         /** @hidden */
         _invertY: boolean;
@@ -77974,7 +77977,7 @@ declare module BABYLON {
         /**
          * Gets the root Animatable used to synchronize and normalize animations
          */
-        readonly syncRoot: Animatable;
+        readonly syncRoot: Nullable<Animatable>;
         /**
          * Gets the current frame of the first RuntimeAnimation
          * Used to synchronize Animatables
@@ -78404,7 +78407,7 @@ declare module BABYLON {
         /**
          * Clone the current skeleton
          * @param name defines the name of the new skeleton
-         * @param id defines the id of the enw skeleton
+         * @param id defines the id of the new skeleton
          * @returns the new skeleton
          */
         clone(name: string, id: string): Skeleton;
@@ -81158,15 +81161,15 @@ declare module BABYLON {
         /**
          * Callback triggered when the material is compiled
          */
-        onCompiled: (effect: Effect) => void;
+        onCompiled: Nullable<(effect: Effect) => void>;
         /**
          * Callback triggered when an error occurs
          */
-        onError: (effect: Effect, errors: string) => void;
+        onError: Nullable<(effect: Effect, errors: string) => void>;
         /**
          * Callback triggered to get the render target textures
          */
-        getRenderTargetTextures: () => SmartArray<RenderTargetTexture>;
+        getRenderTargetTextures: Nullable<() => SmartArray<RenderTargetTexture>>;
         /**
          * Gets a boolean indicating that current material needs to register RTT
          */
@@ -81182,7 +81185,7 @@ declare module BABYLON {
         /**
          * Stores the animations for the material
          */
-        animations: Array<Animation>;
+        animations: Nullable<Array<Animation>>;
         /**
         * An event triggered when the material is disposed
         */
@@ -81629,7 +81632,7 @@ declare module BABYLON {
         /** @hidden */
         _trianglePlanes: Plane[];
         /** @hidden */
-        _lastColliderTransformMatrix: Matrix;
+        _lastColliderTransformMatrix: Nullable<Matrix>;
         /** @hidden */
         _renderId: number;
         /** @hidden */
@@ -83433,7 +83436,7 @@ declare module BABYLON {
         /** @hidden */
         _isActive: boolean;
         /** @hidden */
-        _renderingGroup: RenderingGroup;
+        _renderingGroup: Nullable<RenderingGroup>;
         /**
          * Gets or sets mesh visibility between 0 and 1 (default is 1)
          */
@@ -83585,7 +83588,7 @@ declare module BABYLON {
         /** @hidden */
         readonly _positions: Nullable<Vector3[]>;
         /** @hidden */
-        _waitingActions: any;
+        _waitingActions: Nullable<any>;
         /** @hidden */
         _waitingFreezeWorldMatrix: Nullable<boolean>;
         private _skeleton;
@@ -83811,16 +83814,6 @@ declare module BABYLON {
          */
         calcRotatePOV(flipBack: number, twirlClockwise: number, tiltRight: number): Vector3;
         /**
-         * Return the minimum and maximum world vectors of the entire hierarchy under current mesh
-         * @param includeDescendants Include bounding info from descendants as well (true by default)
-         * @param predicate defines a callback function that can be customize to filter what meshes should be included in the list used to compute the bounding vectors
-         * @returns the new bounding vectors
-         */
-        getHierarchyBoundingVectors(includeDescendants?: boolean, predicate?: Nullable<(abstractMesh: AbstractMesh) => boolean>): {
-            min: Vector3;
-            max: Vector3;
-        };
-        /**
          * This method recomputes and sets a new BoundingInfo to the mesh unless it is locked.
          * This means the mesh underlying bounding box and sphere are recomputed.
          * @param applySkeleton defines whether to apply the skeleton before computing the bounding info
@@ -83876,7 +83869,7 @@ declare module BABYLON {
          * Gets Collider object used to compute collisions (not physics)
          * @see http://doc.babylonjs.com/babylon101/cameras,_mesh_collisions_and_gravity
          */
-        readonly collider: Collider;
+        readonly collider: Nullable<Collider>;
         /**
          * Move the mesh using collision engine
          * @see http://doc.babylonjs.com/babylon101/cameras,_mesh_collisions_and_gravity
@@ -84320,7 +84313,7 @@ declare module BABYLON {
         /**
          * Callback raised when the node is ready to be used
          */
-        onReady: (node: Node) => void;
+        onReady: Nullable<(node: Node) => void>;
         private _isEnabled;
         private _isParentEnabled;
         private _isReady;
@@ -84566,6 +84559,16 @@ declare module BABYLON {
          * @param scene defines the hosting scene
          */
         static ParseAnimationRanges(node: Node, parsedNode: any, scene: Scene): void;
+        /**
+     * Return the minimum and maximum world vectors of the entire hierarchy under current node
+     * @param includeDescendants Include bounding info from descendants as well (true by default)
+     * @param predicate defines a callback function that can be customize to filter what meshes should be included in the list used to compute the bounding vectors
+     * @returns the new bounding vectors
+     */
+        getHierarchyBoundingVectors(includeDescendants?: boolean, predicate?: Nullable<(abstractMesh: AbstractMesh) => boolean>): {
+            min: Vector3;
+            max: Vector3;
+        };
     }
 }
 declare module BABYLON {
@@ -87570,7 +87573,7 @@ declare module BABYLON {
          * @param indexParameters defines an object containing the index values to use to compile shaders (like the maximum number of simultaneous lights)
          * @returns the new Effect
          */
-        createEffect(baseName: any, attributesNamesOrOptions: string[] | EffectCreationOptions, uniformsNamesOrEngine: string[] | Engine, samplers?: string[], defines?: string, fallbacks?: EffectFallbacks, onCompiled?: (effect: Effect) => void, onError?: (effect: Effect, errors: string) => void, indexParameters?: any): Effect;
+        createEffect(baseName: any, attributesNamesOrOptions: string[] | EffectCreationOptions, uniformsNamesOrEngine: string[] | Engine, samplers?: string[], defines?: string, fallbacks?: EffectFallbacks, onCompiled?: Nullable<(effect: Effect) => void>, onError?: Nullable<(effect: Effect, errors: string) => void>, indexParameters?: any): Effect;
         private _compileShader;
         private _compileRawShader;
         /**
@@ -90076,7 +90079,7 @@ declare module BABYLON {
         /**
          * Array of animations
          */
-        animations: Array<Animation>;
+        animations: Nullable<Array<Animation>>;
     }
     /** Interface used by value gradients (color, factor, ...) */
     export interface IValueGradient {
@@ -101748,6 +101751,9 @@ declare module BABYLON {
          * Relative bounding box pivot used when scaling the attached mesh. When null object with scale from the opposite corner. 0.5,0.5,0.5 for center and 0.5,0,0.5 for bottom (Default: null)
          */
         scalePivot: Nullable<Vector3>;
+        /**
+         * Mesh used as a pivot to rotate the attached mesh
+         */
         private _anchorMesh;
         private _existingMeshScale;
         private _dragMesh;
@@ -104253,11 +104259,11 @@ declare module BABYLON {
         /**
          * AKA Diffuse Texture in standard nomenclature.
          */
-        protected _albedoTexture: BaseTexture;
+        protected _albedoTexture: Nullable<BaseTexture>;
         /**
          * AKA Occlusion Texture in other nomenclature.
          */
-        protected _ambientTexture: BaseTexture;
+        protected _ambientTexture: Nullable<BaseTexture>;
         /**
          * AKA Occlusion Texture Intensity in other nomenclature.
          */
@@ -104271,23 +104277,23 @@ declare module BABYLON {
         /**
          * Stores the alpha values in a texture.
          */
-        protected _opacityTexture: BaseTexture;
+        protected _opacityTexture: Nullable<BaseTexture>;
         /**
          * Stores the reflection values in a texture.
          */
-        protected _reflectionTexture: BaseTexture;
+        protected _reflectionTexture: Nullable<BaseTexture>;
         /**
          * Stores the emissive values in a texture.
          */
-        protected _emissiveTexture: BaseTexture;
+        protected _emissiveTexture: Nullable<BaseTexture>;
         /**
          * AKA Specular texture in other nomenclature.
          */
-        protected _reflectivityTexture: BaseTexture;
+        protected _reflectivityTexture: Nullable<BaseTexture>;
         /**
          * Used to switch from specular/glossiness to metallic/roughness workflow.
          */
-        protected _metallicTexture: BaseTexture;
+        protected _metallicTexture: Nullable<BaseTexture>;
         /**
          * Specifies the metallic scalar of the metallic/roughness workflow.
          * Can also be used to scale the metalness values of the metallic texture.
@@ -104302,15 +104308,15 @@ declare module BABYLON {
          * Used to enable roughness/glossiness fetch from a separate channel depending on the current mode.
          * Gray Scale represents roughness in metallic mode and glossiness in specular mode.
          */
-        protected _microSurfaceTexture: BaseTexture;
+        protected _microSurfaceTexture: Nullable<BaseTexture>;
         /**
          * Stores surface normal data used to displace a mesh in a texture.
          */
-        protected _bumpTexture: BaseTexture;
+        protected _bumpTexture: Nullable<BaseTexture>;
         /**
          * Stores the pre-calculated light information of a mesh in a texture.
          */
-        protected _lightmapTexture: BaseTexture;
+        protected _lightmapTexture: Nullable<BaseTexture>;
         /**
          * The color of a material in ambient lighting.
          */
@@ -104613,7 +104619,7 @@ declare module BABYLON {
         /**
          * Gets the texture used for the alpha test.
          */
-        getAlphaTestTexture(): BaseTexture;
+        getAlphaTestTexture(): Nullable<BaseTexture>;
         /**
          * Specifies that the submesh is ready to be used.
          * @param mesh - BJS mesh.

+ 39 - 39
dist/preview release/gui/babylon.gui.js

@@ -7,7 +7,7 @@
 		exports["babylonjs-gui"] = factory(require("babylonjs"));
 	else
 		root["BABYLON"] = root["BABYLON"] || {}, root["BABYLON"]["GUI"] = factory(root["BABYLON"]);
-})((typeof self !== "undefined" ? self : typeof global !== "undefined" ? global : this), function(__WEBPACK_EXTERNAL_MODULE_babylonjs_Maths_math__) {
+})((typeof self !== "undefined" ? self : typeof global !== "undefined" ? global : this), function(__WEBPACK_EXTERNAL_MODULE_babylonjs_Misc_observable__) {
 return /******/ (function(modules) { // webpackBootstrap
 /******/ 	// The module cache
 /******/ 	var installedModules = {};
@@ -355,7 +355,7 @@ module.exports = g;
 "use strict";
 __webpack_require__.r(__webpack_exports__);
 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "AdvancedDynamicTextureInstrumentation", function() { return AdvancedDynamicTextureInstrumentation; });
-/* harmony import */ var babylonjs_Misc_tools__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! babylonjs/Misc/tools */ "babylonjs/Maths/math");
+/* harmony import */ var babylonjs_Misc_tools__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! babylonjs/Misc/tools */ "babylonjs/Misc/observable");
 /* harmony import */ var babylonjs_Misc_tools__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(babylonjs_Misc_tools__WEBPACK_IMPORTED_MODULE_0__);
 
 /**
@@ -498,7 +498,7 @@ var AdvancedDynamicTextureInstrumentation = /** @class */ (function () {
 __webpack_require__.r(__webpack_exports__);
 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "AdvancedDynamicTexture", function() { return AdvancedDynamicTexture; });
 /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "../../node_modules/tslib/tslib.es6.js");
-/* harmony import */ var babylonjs_Misc_observable__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! babylonjs/Misc/observable */ "babylonjs/Maths/math");
+/* harmony import */ var babylonjs_Misc_observable__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! babylonjs/Misc/observable */ "babylonjs/Misc/observable");
 /* harmony import */ var babylonjs_Misc_observable__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(babylonjs_Misc_observable__WEBPACK_IMPORTED_MODULE_1__);
 /* harmony import */ var _controls_container__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./controls/container */ "./2D/controls/container.ts");
 /* harmony import */ var _style__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./style */ "./2D/style.ts");
@@ -1619,7 +1619,7 @@ var Button = /** @class */ (function (_super) {
 __webpack_require__.r(__webpack_exports__);
 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Checkbox", function() { return Checkbox; });
 /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "../../node_modules/tslib/tslib.es6.js");
-/* harmony import */ var babylonjs_Misc_observable__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! babylonjs/Misc/observable */ "babylonjs/Maths/math");
+/* harmony import */ var babylonjs_Misc_observable__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! babylonjs/Misc/observable */ "babylonjs/Misc/observable");
 /* harmony import */ var babylonjs_Misc_observable__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(babylonjs_Misc_observable__WEBPACK_IMPORTED_MODULE_1__);
 /* harmony import */ var _control__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./control */ "./2D/controls/control.ts");
 /* harmony import */ var _stackPanel__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./stackPanel */ "./2D/controls/stackPanel.ts");
@@ -1800,7 +1800,7 @@ var Checkbox = /** @class */ (function (_super) {
 __webpack_require__.r(__webpack_exports__);
 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ColorPicker", function() { return ColorPicker; });
 /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "../../node_modules/tslib/tslib.es6.js");
-/* harmony import */ var babylonjs_Misc_observable__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! babylonjs/Misc/observable */ "babylonjs/Maths/math");
+/* harmony import */ var babylonjs_Misc_observable__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! babylonjs/Misc/observable */ "babylonjs/Misc/observable");
 /* harmony import */ var babylonjs_Misc_observable__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(babylonjs_Misc_observable__WEBPACK_IMPORTED_MODULE_1__);
 /* harmony import */ var _control__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./control */ "./2D/controls/control.ts");
 /* harmony import */ var _inputText__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./inputText */ "./2D/controls/inputText.ts");
@@ -3247,7 +3247,7 @@ var ColorPicker = /** @class */ (function (_super) {
 __webpack_require__.r(__webpack_exports__);
 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Container", function() { return Container; });
 /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "../../node_modules/tslib/tslib.es6.js");
-/* harmony import */ var babylonjs_Misc_logger__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! babylonjs/Misc/logger */ "babylonjs/Maths/math");
+/* harmony import */ var babylonjs_Misc_logger__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! babylonjs/Misc/logger */ "babylonjs/Misc/observable");
 /* harmony import */ var babylonjs_Misc_logger__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(babylonjs_Misc_logger__WEBPACK_IMPORTED_MODULE_1__);
 /* harmony import */ var _control__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./control */ "./2D/controls/control.ts");
 /* harmony import */ var _measure__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../measure */ "./2D/measure.ts");
@@ -3652,7 +3652,7 @@ var Container = /** @class */ (function (_super) {
 "use strict";
 __webpack_require__.r(__webpack_exports__);
 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Control", function() { return Control; });
-/* harmony import */ var babylonjs_Misc_observable__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! babylonjs/Misc/observable */ "babylonjs/Maths/math");
+/* harmony import */ var babylonjs_Misc_observable__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! babylonjs/Misc/observable */ "babylonjs/Misc/observable");
 /* harmony import */ var babylonjs_Misc_observable__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(babylonjs_Misc_observable__WEBPACK_IMPORTED_MODULE_0__);
 /* harmony import */ var _valueAndUnit__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../valueAndUnit */ "./2D/valueAndUnit.ts");
 /* harmony import */ var _measure__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../measure */ "./2D/measure.ts");
@@ -6212,7 +6212,7 @@ var Grid = /** @class */ (function (_super) {
 __webpack_require__.r(__webpack_exports__);
 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Image", function() { return Image; });
 /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "../../node_modules/tslib/tslib.es6.js");
-/* harmony import */ var babylonjs_Misc_observable__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! babylonjs/Misc/observable */ "babylonjs/Maths/math");
+/* harmony import */ var babylonjs_Misc_observable__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! babylonjs/Misc/observable */ "babylonjs/Misc/observable");
 /* harmony import */ var babylonjs_Misc_observable__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(babylonjs_Misc_observable__WEBPACK_IMPORTED_MODULE_1__);
 /* harmony import */ var _control__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./control */ "./2D/controls/control.ts");
 
@@ -6987,7 +6987,7 @@ var InputPassword = /** @class */ (function (_super) {
 __webpack_require__.r(__webpack_exports__);
 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "InputText", function() { return InputText; });
 /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "../../node_modules/tslib/tslib.es6.js");
-/* harmony import */ var babylonjs_Misc_observable__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! babylonjs/Misc/observable */ "babylonjs/Maths/math");
+/* harmony import */ var babylonjs_Misc_observable__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! babylonjs/Misc/observable */ "babylonjs/Misc/observable");
 /* harmony import */ var babylonjs_Misc_observable__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(babylonjs_Misc_observable__WEBPACK_IMPORTED_MODULE_1__);
 /* harmony import */ var _control__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./control */ "./2D/controls/control.ts");
 /* harmony import */ var _valueAndUnit__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../valueAndUnit */ "./2D/valueAndUnit.ts");
@@ -7996,7 +7996,7 @@ var InputText = /** @class */ (function (_super) {
 __webpack_require__.r(__webpack_exports__);
 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Line", function() { return Line; });
 /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "../../node_modules/tslib/tslib.es6.js");
-/* harmony import */ var babylonjs_Maths_math__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! babylonjs/Maths/math */ "babylonjs/Maths/math");
+/* harmony import */ var babylonjs_Maths_math__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! babylonjs/Maths/math */ "babylonjs/Misc/observable");
 /* harmony import */ var babylonjs_Maths_math__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(babylonjs_Maths_math__WEBPACK_IMPORTED_MODULE_1__);
 /* harmony import */ var _control__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./control */ "./2D/controls/control.ts");
 /* harmony import */ var _valueAndUnit__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../valueAndUnit */ "./2D/valueAndUnit.ts");
@@ -8264,7 +8264,7 @@ var Line = /** @class */ (function (_super) {
 __webpack_require__.r(__webpack_exports__);
 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MultiLine", function() { return MultiLine; });
 /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "../../node_modules/tslib/tslib.es6.js");
-/* harmony import */ var babylonjs_Meshes_abstractMesh__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! babylonjs/Meshes/abstractMesh */ "babylonjs/Maths/math");
+/* harmony import */ var babylonjs_Meshes_abstractMesh__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! babylonjs/Meshes/abstractMesh */ "babylonjs/Misc/observable");
 /* harmony import */ var babylonjs_Meshes_abstractMesh__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(babylonjs_Meshes_abstractMesh__WEBPACK_IMPORTED_MODULE_1__);
 /* harmony import */ var _control__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./control */ "./2D/controls/control.ts");
 /* harmony import */ var _multiLinePoint__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../multiLinePoint */ "./2D/multiLinePoint.ts");
@@ -8531,7 +8531,7 @@ var MultiLine = /** @class */ (function (_super) {
 __webpack_require__.r(__webpack_exports__);
 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "RadioButton", function() { return RadioButton; });
 /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "../../node_modules/tslib/tslib.es6.js");
-/* harmony import */ var babylonjs_Misc_observable__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! babylonjs/Misc/observable */ "babylonjs/Maths/math");
+/* harmony import */ var babylonjs_Misc_observable__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! babylonjs/Misc/observable */ "babylonjs/Misc/observable");
 /* harmony import */ var babylonjs_Misc_observable__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(babylonjs_Misc_observable__WEBPACK_IMPORTED_MODULE_1__);
 /* harmony import */ var _control__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./control */ "./2D/controls/control.ts");
 /* harmony import */ var _stackPanel__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./stackPanel */ "./2D/controls/stackPanel.ts");
@@ -8876,7 +8876,7 @@ var Rectangle = /** @class */ (function (_super) {
 __webpack_require__.r(__webpack_exports__);
 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ScrollViewer", function() { return ScrollViewer; });
 /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "../../node_modules/tslib/tslib.es6.js");
-/* harmony import */ var babylonjs_Events_pointerEvents__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! babylonjs/Events/pointerEvents */ "babylonjs/Maths/math");
+/* harmony import */ var babylonjs_Events_pointerEvents__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! babylonjs/Events/pointerEvents */ "babylonjs/Misc/observable");
 /* harmony import */ var babylonjs_Events_pointerEvents__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(babylonjs_Events_pointerEvents__WEBPACK_IMPORTED_MODULE_1__);
 /* harmony import */ var _rectangle__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../rectangle */ "./2D/controls/rectangle.ts");
 /* harmony import */ var _grid__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../grid */ "./2D/controls/grid.ts");
@@ -9967,7 +9967,7 @@ var SelectionPanel = /** @class */ (function (_super) {
 __webpack_require__.r(__webpack_exports__);
 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "BaseSlider", function() { return BaseSlider; });
 /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "../../node_modules/tslib/tslib.es6.js");
-/* harmony import */ var babylonjs_Misc_observable__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! babylonjs/Misc/observable */ "babylonjs/Maths/math");
+/* harmony import */ var babylonjs_Misc_observable__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! babylonjs/Misc/observable */ "babylonjs/Misc/observable");
 /* harmony import */ var babylonjs_Misc_observable__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(babylonjs_Misc_observable__WEBPACK_IMPORTED_MODULE_1__);
 /* harmony import */ var _control__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../control */ "./2D/controls/control.ts");
 /* harmony import */ var _valueAndUnit__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../valueAndUnit */ "./2D/valueAndUnit.ts");
@@ -10862,7 +10862,7 @@ var Slider = /** @class */ (function (_super) {
 __webpack_require__.r(__webpack_exports__);
 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "StackPanel", function() { return StackPanel; });
 /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "../../node_modules/tslib/tslib.es6.js");
-/* harmony import */ var babylonjs_Misc_tools__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! babylonjs/Misc/tools */ "babylonjs/Maths/math");
+/* harmony import */ var babylonjs_Misc_tools__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! babylonjs/Misc/tools */ "babylonjs/Misc/observable");
 /* harmony import */ var babylonjs_Misc_tools__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(babylonjs_Misc_tools__WEBPACK_IMPORTED_MODULE_1__);
 /* harmony import */ var _container__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./container */ "./2D/controls/container.ts");
 /* harmony import */ var _control__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./control */ "./2D/controls/control.ts");
@@ -11120,7 +11120,7 @@ __webpack_require__.r(__webpack_exports__);
 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TextWrapping", function() { return TextWrapping; });
 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TextBlock", function() { return TextBlock; });
 /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "../../node_modules/tslib/tslib.es6.js");
-/* harmony import */ var babylonjs_Misc_observable__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! babylonjs/Misc/observable */ "babylonjs/Maths/math");
+/* harmony import */ var babylonjs_Misc_observable__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! babylonjs/Misc/observable */ "babylonjs/Misc/observable");
 /* harmony import */ var babylonjs_Misc_observable__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(babylonjs_Misc_observable__WEBPACK_IMPORTED_MODULE_1__);
 /* harmony import */ var _valueAndUnit__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../valueAndUnit */ "./2D/valueAndUnit.ts");
 /* harmony import */ var _control__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./control */ "./2D/controls/control.ts");
@@ -11560,7 +11560,7 @@ __webpack_require__.r(__webpack_exports__);
 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "KeyPropertySet", function() { return KeyPropertySet; });
 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "VirtualKeyboard", function() { return VirtualKeyboard; });
 /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "../../node_modules/tslib/tslib.es6.js");
-/* harmony import */ var babylonjs_Misc_observable__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! babylonjs/Misc/observable */ "babylonjs/Maths/math");
+/* harmony import */ var babylonjs_Misc_observable__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! babylonjs/Misc/observable */ "babylonjs/Misc/observable");
 /* harmony import */ var babylonjs_Misc_observable__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(babylonjs_Misc_observable__WEBPACK_IMPORTED_MODULE_1__);
 /* harmony import */ var _stackPanel__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./stackPanel */ "./2D/controls/stackPanel.ts");
 /* harmony import */ var _button__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./button */ "./2D/controls/button.ts");
@@ -11935,7 +11935,7 @@ __webpack_require__.r(__webpack_exports__);
 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Vector2WithInfo", function() { return Vector2WithInfo; });
 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Matrix2D", function() { return Matrix2D; });
 /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "../../node_modules/tslib/tslib.es6.js");
-/* harmony import */ var babylonjs_Maths_math__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! babylonjs/Maths/math */ "babylonjs/Maths/math");
+/* harmony import */ var babylonjs_Maths_math__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! babylonjs/Maths/math */ "babylonjs/Misc/observable");
 /* harmony import */ var babylonjs_Maths_math__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(babylonjs_Maths_math__WEBPACK_IMPORTED_MODULE_1__);
 
 
@@ -12159,7 +12159,7 @@ var Matrix2D = /** @class */ (function () {
 "use strict";
 __webpack_require__.r(__webpack_exports__);
 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Measure", function() { return Measure; });
-/* harmony import */ var babylonjs_Maths_math__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! babylonjs/Maths/math */ "babylonjs/Maths/math");
+/* harmony import */ var babylonjs_Maths_math__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! babylonjs/Maths/math */ "babylonjs/Misc/observable");
 /* harmony import */ var babylonjs_Maths_math__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(babylonjs_Maths_math__WEBPACK_IMPORTED_MODULE_0__);
 
 
@@ -12292,7 +12292,7 @@ var Measure = /** @class */ (function () {
 "use strict";
 __webpack_require__.r(__webpack_exports__);
 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MultiLinePoint", function() { return MultiLinePoint; });
-/* harmony import */ var babylonjs_Maths_math__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! babylonjs/Maths/math */ "babylonjs/Maths/math");
+/* harmony import */ var babylonjs_Maths_math__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! babylonjs/Maths/math */ "babylonjs/Misc/observable");
 /* harmony import */ var babylonjs_Maths_math__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(babylonjs_Maths_math__WEBPACK_IMPORTED_MODULE_0__);
 /* harmony import */ var _valueAndUnit__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./valueAndUnit */ "./2D/valueAndUnit.ts");
 
@@ -12435,7 +12435,7 @@ var MultiLinePoint = /** @class */ (function () {
 "use strict";
 __webpack_require__.r(__webpack_exports__);
 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Style", function() { return Style; });
-/* harmony import */ var babylonjs_Misc_observable__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! babylonjs/Misc/observable */ "babylonjs/Maths/math");
+/* harmony import */ var babylonjs_Misc_observable__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! babylonjs/Misc/observable */ "babylonjs/Misc/observable");
 /* harmony import */ var babylonjs_Misc_observable__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(babylonjs_Misc_observable__WEBPACK_IMPORTED_MODULE_0__);
 /* harmony import */ var _valueAndUnit__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./valueAndUnit */ "./2D/valueAndUnit.ts");
 
@@ -12742,7 +12742,7 @@ var ValueAndUnit = /** @class */ (function () {
 __webpack_require__.r(__webpack_exports__);
 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "AbstractButton3D", function() { return AbstractButton3D; });
 /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "../../node_modules/tslib/tslib.es6.js");
-/* harmony import */ var babylonjs_Meshes_transformNode__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! babylonjs/Meshes/transformNode */ "babylonjs/Maths/math");
+/* harmony import */ var babylonjs_Meshes_transformNode__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! babylonjs/Meshes/transformNode */ "babylonjs/Misc/observable");
 /* harmony import */ var babylonjs_Meshes_transformNode__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(babylonjs_Meshes_transformNode__WEBPACK_IMPORTED_MODULE_1__);
 /* harmony import */ var _control3D__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./control3D */ "./3D/controls/control3D.ts");
 
@@ -12785,7 +12785,7 @@ var AbstractButton3D = /** @class */ (function (_super) {
 __webpack_require__.r(__webpack_exports__);
 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Button3D", function() { return Button3D; });
 /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "../../node_modules/tslib/tslib.es6.js");
-/* harmony import */ var babylonjs_Maths_math__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! babylonjs/Maths/math */ "babylonjs/Maths/math");
+/* harmony import */ var babylonjs_Maths_math__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! babylonjs/Maths/math */ "babylonjs/Misc/observable");
 /* harmony import */ var babylonjs_Maths_math__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(babylonjs_Maths_math__WEBPACK_IMPORTED_MODULE_1__);
 /* harmony import */ var _abstractButton3D__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./abstractButton3D */ "./3D/controls/abstractButton3D.ts");
 /* harmony import */ var _2D_advancedDynamicTexture__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../2D/advancedDynamicTexture */ "./2D/advancedDynamicTexture.ts");
@@ -12962,7 +12962,7 @@ var Button3D = /** @class */ (function (_super) {
 __webpack_require__.r(__webpack_exports__);
 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Container3D", function() { return Container3D; });
 /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "../../node_modules/tslib/tslib.es6.js");
-/* harmony import */ var babylonjs_Meshes_transformNode__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! babylonjs/Meshes/transformNode */ "babylonjs/Maths/math");
+/* harmony import */ var babylonjs_Meshes_transformNode__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! babylonjs/Meshes/transformNode */ "babylonjs/Misc/observable");
 /* harmony import */ var babylonjs_Meshes_transformNode__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(babylonjs_Meshes_transformNode__WEBPACK_IMPORTED_MODULE_1__);
 /* harmony import */ var _control3D__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./control3D */ "./3D/controls/control3D.ts");
 
@@ -13119,7 +13119,7 @@ var Container3D = /** @class */ (function (_super) {
 "use strict";
 __webpack_require__.r(__webpack_exports__);
 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Control3D", function() { return Control3D; });
-/* harmony import */ var babylonjs_Misc_observable__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! babylonjs/Misc/observable */ "babylonjs/Maths/math");
+/* harmony import */ var babylonjs_Misc_observable__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! babylonjs/Misc/observable */ "babylonjs/Misc/observable");
 /* harmony import */ var babylonjs_Misc_observable__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(babylonjs_Misc_observable__WEBPACK_IMPORTED_MODULE_0__);
 /* harmony import */ var _vector3WithInfo__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../vector3WithInfo */ "./3D/vector3WithInfo.ts");
 
@@ -13513,7 +13513,7 @@ var Control3D = /** @class */ (function () {
 __webpack_require__.r(__webpack_exports__);
 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CylinderPanel", function() { return CylinderPanel; });
 /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "../../node_modules/tslib/tslib.es6.js");
-/* harmony import */ var babylonjs_Misc_tools__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! babylonjs/Misc/tools */ "babylonjs/Maths/math");
+/* harmony import */ var babylonjs_Misc_tools__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! babylonjs/Misc/tools */ "babylonjs/Misc/observable");
 /* harmony import */ var babylonjs_Misc_tools__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(babylonjs_Misc_tools__WEBPACK_IMPORTED_MODULE_1__);
 /* harmony import */ var _volumeBasedPanel__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./volumeBasedPanel */ "./3D/controls/volumeBasedPanel.ts");
 /* harmony import */ var _container3D__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./container3D */ "./3D/controls/container3D.ts");
@@ -13598,7 +13598,7 @@ __webpack_require__.r(__webpack_exports__);
 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "HolographicButton", function() { return HolographicButton; });
 /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "../../node_modules/tslib/tslib.es6.js");
 /* harmony import */ var _button3D__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./button3D */ "./3D/controls/button3D.ts");
-/* harmony import */ var babylonjs_Maths_math__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! babylonjs/Maths/math */ "babylonjs/Maths/math");
+/* harmony import */ var babylonjs_Maths_math__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! babylonjs/Maths/math */ "babylonjs/Misc/observable");
 /* harmony import */ var babylonjs_Maths_math__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(babylonjs_Maths_math__WEBPACK_IMPORTED_MODULE_2__);
 /* harmony import */ var _materials_fluentMaterial__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../materials/fluentMaterial */ "./3D/materials/fluentMaterial.ts");
 /* harmony import */ var _2D_controls_stackPanel__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../2D/controls/stackPanel */ "./2D/controls/stackPanel.ts");
@@ -14074,7 +14074,7 @@ var MeshButton3D = /** @class */ (function (_super) {
 __webpack_require__.r(__webpack_exports__);
 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "PlanePanel", function() { return PlanePanel; });
 /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "../../node_modules/tslib/tslib.es6.js");
-/* harmony import */ var babylonjs_Maths_math__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! babylonjs/Maths/math */ "babylonjs/Maths/math");
+/* harmony import */ var babylonjs_Maths_math__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! babylonjs/Maths/math */ "babylonjs/Misc/observable");
 /* harmony import */ var babylonjs_Maths_math__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(babylonjs_Maths_math__WEBPACK_IMPORTED_MODULE_1__);
 /* harmony import */ var _container3D__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./container3D */ "./3D/controls/container3D.ts");
 /* harmony import */ var _volumeBasedPanel__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./volumeBasedPanel */ "./3D/controls/volumeBasedPanel.ts");
@@ -14129,7 +14129,7 @@ var PlanePanel = /** @class */ (function (_super) {
 __webpack_require__.r(__webpack_exports__);
 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ScatterPanel", function() { return ScatterPanel; });
 /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "../../node_modules/tslib/tslib.es6.js");
-/* harmony import */ var babylonjs_Misc_tools__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! babylonjs/Misc/tools */ "babylonjs/Maths/math");
+/* harmony import */ var babylonjs_Misc_tools__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! babylonjs/Misc/tools */ "babylonjs/Misc/observable");
 /* harmony import */ var babylonjs_Misc_tools__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(babylonjs_Misc_tools__WEBPACK_IMPORTED_MODULE_1__);
 /* harmony import */ var _volumeBasedPanel__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./volumeBasedPanel */ "./3D/controls/volumeBasedPanel.ts");
 /* harmony import */ var _container3D__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./container3D */ "./3D/controls/container3D.ts");
@@ -14256,7 +14256,7 @@ var ScatterPanel = /** @class */ (function (_super) {
 __webpack_require__.r(__webpack_exports__);
 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SpherePanel", function() { return SpherePanel; });
 /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "../../node_modules/tslib/tslib.es6.js");
-/* harmony import */ var babylonjs_Misc_tools__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! babylonjs/Misc/tools */ "babylonjs/Maths/math");
+/* harmony import */ var babylonjs_Misc_tools__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! babylonjs/Misc/tools */ "babylonjs/Misc/observable");
 /* harmony import */ var babylonjs_Misc_tools__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(babylonjs_Misc_tools__WEBPACK_IMPORTED_MODULE_1__);
 /* harmony import */ var _volumeBasedPanel__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./volumeBasedPanel */ "./3D/controls/volumeBasedPanel.ts");
 /* harmony import */ var _container3D__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./container3D */ "./3D/controls/container3D.ts");
@@ -14341,7 +14341,7 @@ var SpherePanel = /** @class */ (function (_super) {
 __webpack_require__.r(__webpack_exports__);
 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "StackPanel3D", function() { return StackPanel3D; });
 /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "../../node_modules/tslib/tslib.es6.js");
-/* harmony import */ var babylonjs_Misc_tools__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! babylonjs/Misc/tools */ "babylonjs/Maths/math");
+/* harmony import */ var babylonjs_Misc_tools__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! babylonjs/Misc/tools */ "babylonjs/Misc/observable");
 /* harmony import */ var babylonjs_Misc_tools__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(babylonjs_Misc_tools__WEBPACK_IMPORTED_MODULE_1__);
 /* harmony import */ var _container3D__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./container3D */ "./3D/controls/container3D.ts");
 
@@ -14466,7 +14466,7 @@ var StackPanel3D = /** @class */ (function (_super) {
 __webpack_require__.r(__webpack_exports__);
 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "VolumeBasedPanel", function() { return VolumeBasedPanel; });
 /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "../../node_modules/tslib/tslib.es6.js");
-/* harmony import */ var babylonjs_Misc_tools__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! babylonjs/Misc/tools */ "babylonjs/Maths/math");
+/* harmony import */ var babylonjs_Misc_tools__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! babylonjs/Misc/tools */ "babylonjs/Misc/observable");
 /* harmony import */ var babylonjs_Misc_tools__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(babylonjs_Misc_tools__WEBPACK_IMPORTED_MODULE_1__);
 /* harmony import */ var _container3D__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./container3D */ "./3D/controls/container3D.ts");
 
@@ -14657,7 +14657,7 @@ var VolumeBasedPanel = /** @class */ (function (_super) {
 "use strict";
 __webpack_require__.r(__webpack_exports__);
 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "GUI3DManager", function() { return GUI3DManager; });
-/* harmony import */ var babylonjs_Misc_observable__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! babylonjs/Misc/observable */ "babylonjs/Maths/math");
+/* harmony import */ var babylonjs_Misc_observable__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! babylonjs/Misc/observable */ "babylonjs/Misc/observable");
 /* harmony import */ var babylonjs_Misc_observable__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(babylonjs_Misc_observable__WEBPACK_IMPORTED_MODULE_0__);
 /* harmony import */ var _controls_container3D__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./controls/container3D */ "./3D/controls/container3D.ts");
 
@@ -14924,7 +14924,7 @@ __webpack_require__.r(__webpack_exports__);
 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "FluentMaterialDefines", function() { return FluentMaterialDefines; });
 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "FluentMaterial", function() { return FluentMaterial; });
 /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "../../node_modules/tslib/tslib.es6.js");
-/* harmony import */ var babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! babylonjs/Misc/decorators */ "babylonjs/Maths/math");
+/* harmony import */ var babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! babylonjs/Misc/decorators */ "babylonjs/Misc/observable");
 /* harmony import */ var babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__);
 /* harmony import */ var _shaders_fluent_vertex__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./shaders/fluent.vertex */ "./3D/materials/shaders/fluent.vertex.ts");
 /* harmony import */ var _shaders_fluent_fragment__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./shaders/fluent.fragment */ "./3D/materials/shaders/fluent.fragment.ts");
@@ -15246,7 +15246,7 @@ __webpack_require__.r(__webpack_exports__);
 "use strict";
 __webpack_require__.r(__webpack_exports__);
 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "fluentPixelShader", function() { return fluentPixelShader; });
-/* harmony import */ var babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! babylonjs/Materials/effect */ "babylonjs/Maths/math");
+/* harmony import */ var babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! babylonjs/Materials/effect */ "babylonjs/Misc/observable");
 /* harmony import */ var babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0__);
 
 var name = 'fluentPixelShader';
@@ -15268,7 +15268,7 @@ var fluentPixelShader = { name: name, shader: shader };
 "use strict";
 __webpack_require__.r(__webpack_exports__);
 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "fluentVertexShader", function() { return fluentVertexShader; });
-/* harmony import */ var babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! babylonjs/Materials/effect */ "babylonjs/Maths/math");
+/* harmony import */ var babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! babylonjs/Materials/effect */ "babylonjs/Misc/observable");
 /* harmony import */ var babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0__);
 
 var name = 'fluentVertexShader';
@@ -15291,7 +15291,7 @@ var fluentVertexShader = { name: name, shader: shader };
 __webpack_require__.r(__webpack_exports__);
 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Vector3WithInfo", function() { return Vector3WithInfo; });
 /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "../../node_modules/tslib/tslib.es6.js");
-/* harmony import */ var babylonjs_Maths_math__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! babylonjs/Maths/math */ "babylonjs/Maths/math");
+/* harmony import */ var babylonjs_Maths_math__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! babylonjs/Maths/math */ "babylonjs/Misc/observable");
 /* harmony import */ var babylonjs_Maths_math__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(babylonjs_Maths_math__WEBPACK_IMPORTED_MODULE_1__);
 
 
@@ -15585,14 +15585,14 @@ if (typeof globalObject !== "undefined") {
 
 /***/ }),
 
-/***/ "babylonjs/Maths/math":
+/***/ "babylonjs/Misc/observable":
 /*!****************************************************************************************************!*\
   !*** external {"root":"BABYLON","commonjs":"babylonjs","commonjs2":"babylonjs","amd":"babylonjs"} ***!
   \****************************************************************************************************/
 /*! no static exports found */
 /***/ (function(module, exports) {
 
-module.exports = __WEBPACK_EXTERNAL_MODULE_babylonjs_Maths_math__;
+module.exports = __WEBPACK_EXTERNAL_MODULE_babylonjs_Misc_observable__;
 
 /***/ })
 

File diff suppressed because it is too large
+ 1 - 1
dist/preview release/gui/babylon.gui.js.map


File diff suppressed because it is too large
+ 2 - 2
dist/preview release/inspector/babylon.inspector.bundle.js


+ 6 - 1
dist/preview release/inspector/babylon.inspector.bundle.max.js

@@ -35485,7 +35485,9 @@ var AnimationGridComponent = /** @class */ (function (_super) {
             _this._animations = new Array();
             animatables.forEach(function (animatable) {
                 var _a;
-                (_a = _this._animations).push.apply(_a, animatable.animations);
+                if (animatable.animations) {
+                    (_a = _this._animations).push.apply(_a, animatable.animations);
+                }
             });
             // Extract from and to
             if (_this._animations && _this._animations.length) {
@@ -40675,6 +40677,9 @@ var SceneTreeItemComponent = /** @class */ (function (_super) {
                     break;
                 case 4:
                     manager.boundingBoxGizmoEnabled = true;
+                    if (manager.gizmos.boundingBoxGizmo) {
+                        manager.gizmos.boundingBoxGizmo.fixedDragMeshScreenSize = true;
+                    }
                     break;
             }
             if (this._selectedEntity && this._selectedEntity.getClassName) {

File diff suppressed because it is too large
+ 1 - 1
dist/preview release/inspector/babylon.inspector.bundle.max.js.map


+ 6 - 6
dist/preview release/loaders/babylon.glTF2FileLoader.js

@@ -2333,17 +2333,17 @@ var GLTFLoader = /** @class */ (function () {
             var animationType;
             switch (channel.target.path) {
                 case "translation" /* TRANSLATION */: {
-                    targetPath = "_position";
+                    targetPath = "position";
                     animationType = babylonjs_Misc_deferred__WEBPACK_IMPORTED_MODULE_0__["Animation"].ANIMATIONTYPE_VECTOR3;
                     break;
                 }
                 case "rotation" /* ROTATION */: {
-                    targetPath = "_rotationQuaternion";
+                    targetPath = "rotationQuaternion";
                     animationType = babylonjs_Misc_deferred__WEBPACK_IMPORTED_MODULE_0__["Animation"].ANIMATIONTYPE_QUATERNION;
                     break;
                 }
                 case "scale" /* SCALE */: {
-                    targetPath = "_scaling";
+                    targetPath = "scaling";
                     animationType = babylonjs_Misc_deferred__WEBPACK_IMPORTED_MODULE_0__["Animation"].ANIMATIONTYPE_VECTOR3;
                     break;
                 }
@@ -2359,7 +2359,7 @@ var GLTFLoader = /** @class */ (function () {
             var outputBufferOffset = 0;
             var getNextOutputValue;
             switch (targetPath) {
-                case "_position": {
+                case "position": {
                     getNextOutputValue = function () {
                         var value = babylonjs_Misc_deferred__WEBPACK_IMPORTED_MODULE_0__["Vector3"].FromArray(data.output, outputBufferOffset);
                         outputBufferOffset += 3;
@@ -2367,7 +2367,7 @@ var GLTFLoader = /** @class */ (function () {
                     };
                     break;
                 }
-                case "_rotationQuaternion": {
+                case "rotationQuaternion": {
                     getNextOutputValue = function () {
                         var value = babylonjs_Misc_deferred__WEBPACK_IMPORTED_MODULE_0__["Quaternion"].FromArray(data.output, outputBufferOffset);
                         outputBufferOffset += 4;
@@ -2375,7 +2375,7 @@ var GLTFLoader = /** @class */ (function () {
                     };
                     break;
                 }
-                case "_scaling": {
+                case "scaling": {
                     getNextOutputValue = function () {
                         var value = babylonjs_Misc_deferred__WEBPACK_IMPORTED_MODULE_0__["Vector3"].FromArray(data.output, outputBufferOffset);
                         outputBufferOffset += 3;

File diff suppressed because it is too large
+ 1 - 1
dist/preview release/loaders/babylon.glTF2FileLoader.js.map


File diff suppressed because it is too large
+ 1 - 1
dist/preview release/loaders/babylon.glTF2FileLoader.min.js


+ 6 - 6
dist/preview release/loaders/babylon.glTFFileLoader.js

@@ -4882,17 +4882,17 @@ var GLTFLoader = /** @class */ (function () {
             var animationType;
             switch (channel.target.path) {
                 case "translation" /* TRANSLATION */: {
-                    targetPath = "_position";
+                    targetPath = "position";
                     animationType = babylonjs_Misc_deferred__WEBPACK_IMPORTED_MODULE_0__["Animation"].ANIMATIONTYPE_VECTOR3;
                     break;
                 }
                 case "rotation" /* ROTATION */: {
-                    targetPath = "_rotationQuaternion";
+                    targetPath = "rotationQuaternion";
                     animationType = babylonjs_Misc_deferred__WEBPACK_IMPORTED_MODULE_0__["Animation"].ANIMATIONTYPE_QUATERNION;
                     break;
                 }
                 case "scale" /* SCALE */: {
-                    targetPath = "_scaling";
+                    targetPath = "scaling";
                     animationType = babylonjs_Misc_deferred__WEBPACK_IMPORTED_MODULE_0__["Animation"].ANIMATIONTYPE_VECTOR3;
                     break;
                 }
@@ -4908,7 +4908,7 @@ var GLTFLoader = /** @class */ (function () {
             var outputBufferOffset = 0;
             var getNextOutputValue;
             switch (targetPath) {
-                case "_position": {
+                case "position": {
                     getNextOutputValue = function () {
                         var value = babylonjs_Misc_deferred__WEBPACK_IMPORTED_MODULE_0__["Vector3"].FromArray(data.output, outputBufferOffset);
                         outputBufferOffset += 3;
@@ -4916,7 +4916,7 @@ var GLTFLoader = /** @class */ (function () {
                     };
                     break;
                 }
-                case "_rotationQuaternion": {
+                case "rotationQuaternion": {
                     getNextOutputValue = function () {
                         var value = babylonjs_Misc_deferred__WEBPACK_IMPORTED_MODULE_0__["Quaternion"].FromArray(data.output, outputBufferOffset);
                         outputBufferOffset += 4;
@@ -4924,7 +4924,7 @@ var GLTFLoader = /** @class */ (function () {
                     };
                     break;
                 }
-                case "_scaling": {
+                case "scaling": {
                     getNextOutputValue = function () {
                         var value = babylonjs_Misc_deferred__WEBPACK_IMPORTED_MODULE_0__["Vector3"].FromArray(data.output, outputBufferOffset);
                         outputBufferOffset += 3;

File diff suppressed because it is too large
+ 1 - 1
dist/preview release/loaders/babylon.glTFFileLoader.js.map


File diff suppressed because it is too large
+ 1 - 1
dist/preview release/loaders/babylon.glTFFileLoader.min.js


+ 6 - 6
dist/preview release/loaders/babylonjs.loaders.js

@@ -6214,17 +6214,17 @@ var GLTFLoader = /** @class */ (function () {
             var animationType;
             switch (channel.target.path) {
                 case "translation" /* TRANSLATION */: {
-                    targetPath = "_position";
+                    targetPath = "position";
                     animationType = babylonjs_Misc_deferred__WEBPACK_IMPORTED_MODULE_0__["Animation"].ANIMATIONTYPE_VECTOR3;
                     break;
                 }
                 case "rotation" /* ROTATION */: {
-                    targetPath = "_rotationQuaternion";
+                    targetPath = "rotationQuaternion";
                     animationType = babylonjs_Misc_deferred__WEBPACK_IMPORTED_MODULE_0__["Animation"].ANIMATIONTYPE_QUATERNION;
                     break;
                 }
                 case "scale" /* SCALE */: {
-                    targetPath = "_scaling";
+                    targetPath = "scaling";
                     animationType = babylonjs_Misc_deferred__WEBPACK_IMPORTED_MODULE_0__["Animation"].ANIMATIONTYPE_VECTOR3;
                     break;
                 }
@@ -6240,7 +6240,7 @@ var GLTFLoader = /** @class */ (function () {
             var outputBufferOffset = 0;
             var getNextOutputValue;
             switch (targetPath) {
-                case "_position": {
+                case "position": {
                     getNextOutputValue = function () {
                         var value = babylonjs_Misc_deferred__WEBPACK_IMPORTED_MODULE_0__["Vector3"].FromArray(data.output, outputBufferOffset);
                         outputBufferOffset += 3;
@@ -6248,7 +6248,7 @@ var GLTFLoader = /** @class */ (function () {
                     };
                     break;
                 }
-                case "_rotationQuaternion": {
+                case "rotationQuaternion": {
                     getNextOutputValue = function () {
                         var value = babylonjs_Misc_deferred__WEBPACK_IMPORTED_MODULE_0__["Quaternion"].FromArray(data.output, outputBufferOffset);
                         outputBufferOffset += 4;
@@ -6256,7 +6256,7 @@ var GLTFLoader = /** @class */ (function () {
                     };
                     break;
                 }
-                case "_scaling": {
+                case "scaling": {
                     getNextOutputValue = function () {
                         var value = babylonjs_Misc_deferred__WEBPACK_IMPORTED_MODULE_0__["Vector3"].FromArray(data.output, outputBufferOffset);
                         outputBufferOffset += 3;

File diff suppressed because it is too large
+ 1 - 1
dist/preview release/loaders/babylonjs.loaders.js.map


File diff suppressed because it is too large
+ 1 - 1
dist/preview release/loaders/babylonjs.loaders.min.js


+ 1 - 1
dist/preview release/packagesSizeBaseLine.json

@@ -1 +1 @@
-{"engineOnly":307412,"sceneOnly":510766,"minGridMaterial":635530,"minStandardMaterial":758046}
+{"engineOnly":307412,"sceneOnly":510800,"minGridMaterial":635564,"minStandardMaterial":758080}

+ 91 - 85
dist/preview release/viewer/babylon.module.d.ts

@@ -486,7 +486,7 @@ declare module "babylonjs/Maths/math" {
          */
         static FromHexString(hex: string): Color3;
         /**
-         * Creates a new Vector3 from the starting index of the given array
+         * Creates a new Color3 from the starting index of the given array
          * @param array defines the source array
          * @param offset defines an offset in the source array
          * @returns a new Color3 object
@@ -6350,9 +6350,9 @@ declare module "babylonjs/Materials/Textures/internalTexture" {
         /** @hidden */
         _files: Nullable<string[]>;
         /** @hidden */
-        _workingCanvas: HTMLCanvasElement;
+        _workingCanvas: Nullable<HTMLCanvasElement>;
         /** @hidden */
-        _workingContext: CanvasRenderingContext2D;
+        _workingContext: Nullable<CanvasRenderingContext2D>;
         /** @hidden */
         _framebuffer: Nullable<WebGLFramebuffer>;
         /** @hidden */
@@ -6394,11 +6394,11 @@ declare module "babylonjs/Materials/Textures/internalTexture" {
         /** @hidden */
         _depthStencilTextureArray: Nullable<WebGLTexture>;
         /** @hidden */
-        _lodTextureHigh: BaseTexture;
+        _lodTextureHigh: Nullable<BaseTexture>;
         /** @hidden */
-        _lodTextureMid: BaseTexture;
+        _lodTextureMid: Nullable<BaseTexture>;
         /** @hidden */
-        _lodTextureLow: BaseTexture;
+        _lodTextureLow: Nullable<BaseTexture>;
         /** @hidden */
         _isRGBD: boolean;
         /** @hidden */
@@ -7580,7 +7580,7 @@ declare module "babylonjs/Meshes/transformNode" {
          */
         reIntegrateRotationIntoRotationQuaternion: boolean;
         /** @hidden */
-        _poseMatrix: Matrix;
+        _poseMatrix: Nullable<Matrix>;
         /** @hidden */
         _localMatrix: Matrix;
         private _usePivotMatrix;
@@ -18488,7 +18488,7 @@ declare module "babylonjs/Materials/Textures/texture" {
          * List of inspectable custom properties (used by the Inspector)
          * @see https://doc.babylonjs.com/how_to/debug_layer#extensibility
          */
-        inspectableCustomProperties: IInspectable[];
+        inspectableCustomProperties: Nullable<IInspectable[]>;
         private _noMipmap;
         /** @hidden */
         _invertY: boolean;
@@ -18976,7 +18976,7 @@ declare module "babylonjs/Animations/animatable" {
         /**
          * Gets the root Animatable used to synchronize and normalize animations
          */
-        readonly syncRoot: Animatable;
+        readonly syncRoot: Nullable<Animatable>;
         /**
          * Gets the current frame of the first RuntimeAnimation
          * Used to synchronize Animatables
@@ -19423,7 +19423,7 @@ declare module "babylonjs/Bones/skeleton" {
         /**
          * Clone the current skeleton
          * @param name defines the name of the new skeleton
-         * @param id defines the id of the enw skeleton
+         * @param id defines the id of the new skeleton
          * @returns the new skeleton
          */
         clone(name: string, id: string): Skeleton;
@@ -22246,15 +22246,15 @@ declare module "babylonjs/Materials/material" {
         /**
          * Callback triggered when the material is compiled
          */
-        onCompiled: (effect: Effect) => void;
+        onCompiled: Nullable<(effect: Effect) => void>;
         /**
          * Callback triggered when an error occurs
          */
-        onError: (effect: Effect, errors: string) => void;
+        onError: Nullable<(effect: Effect, errors: string) => void>;
         /**
          * Callback triggered to get the render target textures
          */
-        getRenderTargetTextures: () => SmartArray<RenderTargetTexture>;
+        getRenderTargetTextures: Nullable<() => SmartArray<RenderTargetTexture>>;
         /**
          * Gets a boolean indicating that current material needs to register RTT
          */
@@ -22270,7 +22270,7 @@ declare module "babylonjs/Materials/material" {
         /**
          * Stores the animations for the material
          */
-        animations: Array<Animation>;
+        animations: Nullable<Array<Animation>>;
         /**
         * An event triggered when the material is disposed
         */
@@ -22730,7 +22730,7 @@ declare module "babylonjs/Meshes/subMesh" {
         /** @hidden */
         _trianglePlanes: Plane[];
         /** @hidden */
-        _lastColliderTransformMatrix: Matrix;
+        _lastColliderTransformMatrix: Nullable<Matrix>;
         /** @hidden */
         _renderId: number;
         /** @hidden */
@@ -24582,7 +24582,7 @@ declare module "babylonjs/Meshes/abstractMesh" {
         /** @hidden */
         _isActive: boolean;
         /** @hidden */
-        _renderingGroup: RenderingGroup;
+        _renderingGroup: Nullable<RenderingGroup>;
         /**
          * Gets or sets mesh visibility between 0 and 1 (default is 1)
          */
@@ -24734,7 +24734,7 @@ declare module "babylonjs/Meshes/abstractMesh" {
         /** @hidden */
         readonly _positions: Nullable<Vector3[]>;
         /** @hidden */
-        _waitingActions: any;
+        _waitingActions: Nullable<any>;
         /** @hidden */
         _waitingFreezeWorldMatrix: Nullable<boolean>;
         private _skeleton;
@@ -24960,16 +24960,6 @@ declare module "babylonjs/Meshes/abstractMesh" {
          */
         calcRotatePOV(flipBack: number, twirlClockwise: number, tiltRight: number): Vector3;
         /**
-         * Return the minimum and maximum world vectors of the entire hierarchy under current mesh
-         * @param includeDescendants Include bounding info from descendants as well (true by default)
-         * @param predicate defines a callback function that can be customize to filter what meshes should be included in the list used to compute the bounding vectors
-         * @returns the new bounding vectors
-         */
-        getHierarchyBoundingVectors(includeDescendants?: boolean, predicate?: Nullable<(abstractMesh: AbstractMesh) => boolean>): {
-            min: Vector3;
-            max: Vector3;
-        };
-        /**
          * This method recomputes and sets a new BoundingInfo to the mesh unless it is locked.
          * This means the mesh underlying bounding box and sphere are recomputed.
          * @param applySkeleton defines whether to apply the skeleton before computing the bounding info
@@ -25025,7 +25015,7 @@ declare module "babylonjs/Meshes/abstractMesh" {
          * Gets Collider object used to compute collisions (not physics)
          * @see http://doc.babylonjs.com/babylon101/cameras,_mesh_collisions_and_gravity
          */
-        readonly collider: Collider;
+        readonly collider: Nullable<Collider>;
         /**
          * Move the mesh using collision engine
          * @see http://doc.babylonjs.com/babylon101/cameras,_mesh_collisions_and_gravity
@@ -25409,7 +25399,7 @@ declare module "babylonjs/Actions/abstractActionManager" {
 declare module "babylonjs/node" {
     import { Scene } from "babylonjs/scene";
     import { Nullable } from "babylonjs/types";
-    import { Matrix } from "babylonjs/Maths/math";
+    import { Matrix, Vector3 } from "babylonjs/Maths/math";
     import { Engine } from "babylonjs/Engines/engine";
     import { IBehaviorAware, Behavior } from "babylonjs/Behaviors/behavior";
     import { Observable } from "babylonjs/Misc/observable";
@@ -25491,7 +25481,7 @@ declare module "babylonjs/node" {
         /**
          * Callback raised when the node is ready to be used
          */
-        onReady: (node: Node) => void;
+        onReady: Nullable<(node: Node) => void>;
         private _isEnabled;
         private _isParentEnabled;
         private _isReady;
@@ -25737,6 +25727,16 @@ declare module "babylonjs/node" {
          * @param scene defines the hosting scene
          */
         static ParseAnimationRanges(node: Node, parsedNode: any, scene: Scene): void;
+        /**
+     * Return the minimum and maximum world vectors of the entire hierarchy under current node
+     * @param includeDescendants Include bounding info from descendants as well (true by default)
+     * @param predicate defines a callback function that can be customize to filter what meshes should be included in the list used to compute the bounding vectors
+     * @returns the new bounding vectors
+     */
+        getHierarchyBoundingVectors(includeDescendants?: boolean, predicate?: Nullable<(abstractMesh: AbstractMesh) => boolean>): {
+            min: Vector3;
+            max: Vector3;
+        };
     }
 }
 declare module "babylonjs/Animations/animation" {
@@ -28803,7 +28803,7 @@ declare module "babylonjs/Engines/engine" {
          * @param indexParameters defines an object containing the index values to use to compile shaders (like the maximum number of simultaneous lights)
          * @returns the new Effect
          */
-        createEffect(baseName: any, attributesNamesOrOptions: string[] | EffectCreationOptions, uniformsNamesOrEngine: string[] | Engine, samplers?: string[], defines?: string, fallbacks?: EffectFallbacks, onCompiled?: (effect: Effect) => void, onError?: (effect: Effect, errors: string) => void, indexParameters?: any): Effect;
+        createEffect(baseName: any, attributesNamesOrOptions: string[] | EffectCreationOptions, uniformsNamesOrEngine: string[] | Engine, samplers?: string[], defines?: string, fallbacks?: EffectFallbacks, onCompiled?: Nullable<(effect: Effect) => void>, onError?: Nullable<(effect: Effect, errors: string) => void>, indexParameters?: any): Effect;
         private _compileShader;
         private _compileRawShader;
         /**
@@ -31354,7 +31354,7 @@ declare module "babylonjs/Misc/tools" {
         /**
          * Array of animations
          */
-        animations: Array<Animation>;
+        animations: Nullable<Array<Animation>>;
     }
     /** Interface used by value gradients (color, factor, ...) */
     export interface IValueGradient {
@@ -43832,6 +43832,9 @@ declare module "babylonjs/Gizmos/boundingBoxGizmo" {
          * Relative bounding box pivot used when scaling the attached mesh. When null object with scale from the opposite corner. 0.5,0.5,0.5 for center and 0.5,0,0.5 for bottom (Default: null)
          */
         scalePivot: Nullable<Vector3>;
+        /**
+         * Mesh used as a pivot to rotate the attached mesh
+         */
         private _anchorMesh;
         private _existingMeshScale;
         private _dragMesh;
@@ -46576,11 +46579,11 @@ declare module "babylonjs/Materials/PBR/pbrBaseMaterial" {
         /**
          * AKA Diffuse Texture in standard nomenclature.
          */
-        protected _albedoTexture: BaseTexture;
+        protected _albedoTexture: Nullable<BaseTexture>;
         /**
          * AKA Occlusion Texture in other nomenclature.
          */
-        protected _ambientTexture: BaseTexture;
+        protected _ambientTexture: Nullable<BaseTexture>;
         /**
          * AKA Occlusion Texture Intensity in other nomenclature.
          */
@@ -46594,23 +46597,23 @@ declare module "babylonjs/Materials/PBR/pbrBaseMaterial" {
         /**
          * Stores the alpha values in a texture.
          */
-        protected _opacityTexture: BaseTexture;
+        protected _opacityTexture: Nullable<BaseTexture>;
         /**
          * Stores the reflection values in a texture.
          */
-        protected _reflectionTexture: BaseTexture;
+        protected _reflectionTexture: Nullable<BaseTexture>;
         /**
          * Stores the emissive values in a texture.
          */
-        protected _emissiveTexture: BaseTexture;
+        protected _emissiveTexture: Nullable<BaseTexture>;
         /**
          * AKA Specular texture in other nomenclature.
          */
-        protected _reflectivityTexture: BaseTexture;
+        protected _reflectivityTexture: Nullable<BaseTexture>;
         /**
          * Used to switch from specular/glossiness to metallic/roughness workflow.
          */
-        protected _metallicTexture: BaseTexture;
+        protected _metallicTexture: Nullable<BaseTexture>;
         /**
          * Specifies the metallic scalar of the metallic/roughness workflow.
          * Can also be used to scale the metalness values of the metallic texture.
@@ -46625,15 +46628,15 @@ declare module "babylonjs/Materials/PBR/pbrBaseMaterial" {
          * Used to enable roughness/glossiness fetch from a separate channel depending on the current mode.
          * Gray Scale represents roughness in metallic mode and glossiness in specular mode.
          */
-        protected _microSurfaceTexture: BaseTexture;
+        protected _microSurfaceTexture: Nullable<BaseTexture>;
         /**
          * Stores surface normal data used to displace a mesh in a texture.
          */
-        protected _bumpTexture: BaseTexture;
+        protected _bumpTexture: Nullable<BaseTexture>;
         /**
          * Stores the pre-calculated light information of a mesh in a texture.
          */
-        protected _lightmapTexture: BaseTexture;
+        protected _lightmapTexture: Nullable<BaseTexture>;
         /**
          * The color of a material in ambient lighting.
          */
@@ -46936,7 +46939,7 @@ declare module "babylonjs/Materials/PBR/pbrBaseMaterial" {
         /**
          * Gets the texture used for the alpha test.
          */
-        getAlphaTestTexture(): BaseTexture;
+        getAlphaTestTexture(): Nullable<BaseTexture>;
         /**
          * Specifies that the submesh is ready to be used.
          * @param mesh - BJS mesh.
@@ -59973,7 +59976,7 @@ declare module BABYLON {
          */
         static FromHexString(hex: string): Color3;
         /**
-         * Creates a new Vector3 from the starting index of the given array
+         * Creates a new Color3 from the starting index of the given array
          * @param array defines the source array
          * @param offset defines an offset in the source array
          * @returns a new Color3 object
@@ -65814,9 +65817,9 @@ declare module BABYLON {
         /** @hidden */
         _files: Nullable<string[]>;
         /** @hidden */
-        _workingCanvas: HTMLCanvasElement;
+        _workingCanvas: Nullable<HTMLCanvasElement>;
         /** @hidden */
-        _workingContext: CanvasRenderingContext2D;
+        _workingContext: Nullable<CanvasRenderingContext2D>;
         /** @hidden */
         _framebuffer: Nullable<WebGLFramebuffer>;
         /** @hidden */
@@ -65858,11 +65861,11 @@ declare module BABYLON {
         /** @hidden */
         _depthStencilTextureArray: Nullable<WebGLTexture>;
         /** @hidden */
-        _lodTextureHigh: BaseTexture;
+        _lodTextureHigh: Nullable<BaseTexture>;
         /** @hidden */
-        _lodTextureMid: BaseTexture;
+        _lodTextureMid: Nullable<BaseTexture>;
         /** @hidden */
-        _lodTextureLow: BaseTexture;
+        _lodTextureLow: Nullable<BaseTexture>;
         /** @hidden */
         _isRGBD: boolean;
         /** @hidden */
@@ -67014,7 +67017,7 @@ declare module BABYLON {
          */
         reIntegrateRotationIntoRotationQuaternion: boolean;
         /** @hidden */
-        _poseMatrix: Matrix;
+        _poseMatrix: Nullable<Matrix>;
         /** @hidden */
         _localMatrix: Matrix;
         private _usePivotMatrix;
@@ -77498,7 +77501,7 @@ declare module BABYLON {
          * List of inspectable custom properties (used by the Inspector)
          * @see https://doc.babylonjs.com/how_to/debug_layer#extensibility
          */
-        inspectableCustomProperties: IInspectable[];
+        inspectableCustomProperties: Nullable<IInspectable[]>;
         private _noMipmap;
         /** @hidden */
         _invertY: boolean;
@@ -77974,7 +77977,7 @@ declare module BABYLON {
         /**
          * Gets the root Animatable used to synchronize and normalize animations
          */
-        readonly syncRoot: Animatable;
+        readonly syncRoot: Nullable<Animatable>;
         /**
          * Gets the current frame of the first RuntimeAnimation
          * Used to synchronize Animatables
@@ -78404,7 +78407,7 @@ declare module BABYLON {
         /**
          * Clone the current skeleton
          * @param name defines the name of the new skeleton
-         * @param id defines the id of the enw skeleton
+         * @param id defines the id of the new skeleton
          * @returns the new skeleton
          */
         clone(name: string, id: string): Skeleton;
@@ -81158,15 +81161,15 @@ declare module BABYLON {
         /**
          * Callback triggered when the material is compiled
          */
-        onCompiled: (effect: Effect) => void;
+        onCompiled: Nullable<(effect: Effect) => void>;
         /**
          * Callback triggered when an error occurs
          */
-        onError: (effect: Effect, errors: string) => void;
+        onError: Nullable<(effect: Effect, errors: string) => void>;
         /**
          * Callback triggered to get the render target textures
          */
-        getRenderTargetTextures: () => SmartArray<RenderTargetTexture>;
+        getRenderTargetTextures: Nullable<() => SmartArray<RenderTargetTexture>>;
         /**
          * Gets a boolean indicating that current material needs to register RTT
          */
@@ -81182,7 +81185,7 @@ declare module BABYLON {
         /**
          * Stores the animations for the material
          */
-        animations: Array<Animation>;
+        animations: Nullable<Array<Animation>>;
         /**
         * An event triggered when the material is disposed
         */
@@ -81629,7 +81632,7 @@ declare module BABYLON {
         /** @hidden */
         _trianglePlanes: Plane[];
         /** @hidden */
-        _lastColliderTransformMatrix: Matrix;
+        _lastColliderTransformMatrix: Nullable<Matrix>;
         /** @hidden */
         _renderId: number;
         /** @hidden */
@@ -83433,7 +83436,7 @@ declare module BABYLON {
         /** @hidden */
         _isActive: boolean;
         /** @hidden */
-        _renderingGroup: RenderingGroup;
+        _renderingGroup: Nullable<RenderingGroup>;
         /**
          * Gets or sets mesh visibility between 0 and 1 (default is 1)
          */
@@ -83585,7 +83588,7 @@ declare module BABYLON {
         /** @hidden */
         readonly _positions: Nullable<Vector3[]>;
         /** @hidden */
-        _waitingActions: any;
+        _waitingActions: Nullable<any>;
         /** @hidden */
         _waitingFreezeWorldMatrix: Nullable<boolean>;
         private _skeleton;
@@ -83811,16 +83814,6 @@ declare module BABYLON {
          */
         calcRotatePOV(flipBack: number, twirlClockwise: number, tiltRight: number): Vector3;
         /**
-         * Return the minimum and maximum world vectors of the entire hierarchy under current mesh
-         * @param includeDescendants Include bounding info from descendants as well (true by default)
-         * @param predicate defines a callback function that can be customize to filter what meshes should be included in the list used to compute the bounding vectors
-         * @returns the new bounding vectors
-         */
-        getHierarchyBoundingVectors(includeDescendants?: boolean, predicate?: Nullable<(abstractMesh: AbstractMesh) => boolean>): {
-            min: Vector3;
-            max: Vector3;
-        };
-        /**
          * This method recomputes and sets a new BoundingInfo to the mesh unless it is locked.
          * This means the mesh underlying bounding box and sphere are recomputed.
          * @param applySkeleton defines whether to apply the skeleton before computing the bounding info
@@ -83876,7 +83869,7 @@ declare module BABYLON {
          * Gets Collider object used to compute collisions (not physics)
          * @see http://doc.babylonjs.com/babylon101/cameras,_mesh_collisions_and_gravity
          */
-        readonly collider: Collider;
+        readonly collider: Nullable<Collider>;
         /**
          * Move the mesh using collision engine
          * @see http://doc.babylonjs.com/babylon101/cameras,_mesh_collisions_and_gravity
@@ -84320,7 +84313,7 @@ declare module BABYLON {
         /**
          * Callback raised when the node is ready to be used
          */
-        onReady: (node: Node) => void;
+        onReady: Nullable<(node: Node) => void>;
         private _isEnabled;
         private _isParentEnabled;
         private _isReady;
@@ -84566,6 +84559,16 @@ declare module BABYLON {
          * @param scene defines the hosting scene
          */
         static ParseAnimationRanges(node: Node, parsedNode: any, scene: Scene): void;
+        /**
+     * Return the minimum and maximum world vectors of the entire hierarchy under current node
+     * @param includeDescendants Include bounding info from descendants as well (true by default)
+     * @param predicate defines a callback function that can be customize to filter what meshes should be included in the list used to compute the bounding vectors
+     * @returns the new bounding vectors
+     */
+        getHierarchyBoundingVectors(includeDescendants?: boolean, predicate?: Nullable<(abstractMesh: AbstractMesh) => boolean>): {
+            min: Vector3;
+            max: Vector3;
+        };
     }
 }
 declare module BABYLON {
@@ -87570,7 +87573,7 @@ declare module BABYLON {
          * @param indexParameters defines an object containing the index values to use to compile shaders (like the maximum number of simultaneous lights)
          * @returns the new Effect
          */
-        createEffect(baseName: any, attributesNamesOrOptions: string[] | EffectCreationOptions, uniformsNamesOrEngine: string[] | Engine, samplers?: string[], defines?: string, fallbacks?: EffectFallbacks, onCompiled?: (effect: Effect) => void, onError?: (effect: Effect, errors: string) => void, indexParameters?: any): Effect;
+        createEffect(baseName: any, attributesNamesOrOptions: string[] | EffectCreationOptions, uniformsNamesOrEngine: string[] | Engine, samplers?: string[], defines?: string, fallbacks?: EffectFallbacks, onCompiled?: Nullable<(effect: Effect) => void>, onError?: Nullable<(effect: Effect, errors: string) => void>, indexParameters?: any): Effect;
         private _compileShader;
         private _compileRawShader;
         /**
@@ -90076,7 +90079,7 @@ declare module BABYLON {
         /**
          * Array of animations
          */
-        animations: Array<Animation>;
+        animations: Nullable<Array<Animation>>;
     }
     /** Interface used by value gradients (color, factor, ...) */
     export interface IValueGradient {
@@ -101748,6 +101751,9 @@ declare module BABYLON {
          * Relative bounding box pivot used when scaling the attached mesh. When null object with scale from the opposite corner. 0.5,0.5,0.5 for center and 0.5,0,0.5 for bottom (Default: null)
          */
         scalePivot: Nullable<Vector3>;
+        /**
+         * Mesh used as a pivot to rotate the attached mesh
+         */
         private _anchorMesh;
         private _existingMeshScale;
         private _dragMesh;
@@ -104253,11 +104259,11 @@ declare module BABYLON {
         /**
          * AKA Diffuse Texture in standard nomenclature.
          */
-        protected _albedoTexture: BaseTexture;
+        protected _albedoTexture: Nullable<BaseTexture>;
         /**
          * AKA Occlusion Texture in other nomenclature.
          */
-        protected _ambientTexture: BaseTexture;
+        protected _ambientTexture: Nullable<BaseTexture>;
         /**
          * AKA Occlusion Texture Intensity in other nomenclature.
          */
@@ -104271,23 +104277,23 @@ declare module BABYLON {
         /**
          * Stores the alpha values in a texture.
          */
-        protected _opacityTexture: BaseTexture;
+        protected _opacityTexture: Nullable<BaseTexture>;
         /**
          * Stores the reflection values in a texture.
          */
-        protected _reflectionTexture: BaseTexture;
+        protected _reflectionTexture: Nullable<BaseTexture>;
         /**
          * Stores the emissive values in a texture.
          */
-        protected _emissiveTexture: BaseTexture;
+        protected _emissiveTexture: Nullable<BaseTexture>;
         /**
          * AKA Specular texture in other nomenclature.
          */
-        protected _reflectivityTexture: BaseTexture;
+        protected _reflectivityTexture: Nullable<BaseTexture>;
         /**
          * Used to switch from specular/glossiness to metallic/roughness workflow.
          */
-        protected _metallicTexture: BaseTexture;
+        protected _metallicTexture: Nullable<BaseTexture>;
         /**
          * Specifies the metallic scalar of the metallic/roughness workflow.
          * Can also be used to scale the metalness values of the metallic texture.
@@ -104302,15 +104308,15 @@ declare module BABYLON {
          * Used to enable roughness/glossiness fetch from a separate channel depending on the current mode.
          * Gray Scale represents roughness in metallic mode and glossiness in specular mode.
          */
-        protected _microSurfaceTexture: BaseTexture;
+        protected _microSurfaceTexture: Nullable<BaseTexture>;
         /**
          * Stores surface normal data used to displace a mesh in a texture.
          */
-        protected _bumpTexture: BaseTexture;
+        protected _bumpTexture: Nullable<BaseTexture>;
         /**
          * Stores the pre-calculated light information of a mesh in a texture.
          */
-        protected _lightmapTexture: BaseTexture;
+        protected _lightmapTexture: Nullable<BaseTexture>;
         /**
          * The color of a material in ambient lighting.
          */
@@ -104613,7 +104619,7 @@ declare module BABYLON {
         /**
          * Gets the texture used for the alpha test.
          */
-        getAlphaTestTexture(): BaseTexture;
+        getAlphaTestTexture(): Nullable<BaseTexture>;
         /**
          * Specifies that the submesh is ready to be used.
          * @param mesh - BJS mesh.

File diff suppressed because it is too large
+ 312 - 312
dist/preview release/viewer/babylon.viewer.js


File diff suppressed because it is too large
+ 3 - 3
dist/preview release/viewer/babylon.viewer.max.js


+ 1 - 1
dist/preview release/what's new.md

@@ -210,7 +210,7 @@
 - CannonJS ignores connectedPivot joint parameter ([TrevorDev](https://github.com/TrevorDev))
 - Fix case sensitive paths ([mrdunk](https://github.com))
 - Fix more case sensitive paths ([mrdunk](https://github.com))
-- Attaching a BoundingBoxGizmo on a child should not remove its parent ([TrevorDev](https://github.com/TrevorDev))
+- Attaching a BoundingBoxGizmo on a child node should not remove its parent ([TrevorDev](https://github.com/TrevorDev))
 - AmmoJS fix include issue caused after modules update and use world contact point to be consistent with Oimo and Cannon ([TrevorDev](https://github.com/TrevorDev))
 - Warn of motor with maxForce in Oimo plugin and set default force to be consistent with others, cannonJS support no impostor, cannonJS cylinder axis, ammoJS wake up impostor when apply force/impulse ([TrevorDev](https://github.com/TrevorDev))
 - Utility layer should render on last active camera ([TrevorDev](https://github.com/TrevorDev))

+ 3 - 1
inspector/src/components/actionTabs/tabs/propertyGrids/animationPropertyGridComponent.tsx

@@ -52,7 +52,9 @@ export class AnimationGridComponent extends React.Component<IAnimationGridCompon
             this._animations = new Array<Animation>();
 
             animatables.forEach((animatable: IAnimatable) => {
-                this._animations!.push(...animatable.animations);
+                if (animatable.animations) {
+                    this._animations!.push(...animatable.animations);
+                }
             });
 
             // Extract from and to

+ 4 - 1
inspector/src/components/sceneExplorer/entities/sceneTreeItemComponent.tsx

@@ -206,6 +206,9 @@ export class SceneTreeItemComponent extends React.Component<ISceneTreeItemCompon
                     break;
                 case 4:
                     manager.boundingBoxGizmoEnabled = true;
+                    if (manager.gizmos.boundingBoxGizmo) {
+                        manager.gizmos.boundingBoxGizmo.fixedDragMeshScreenSize = true;
+                    }
                     break;
             }
 
@@ -256,4 +259,4 @@ export class SceneTreeItemComponent extends React.Component<ISceneTreeItemCompon
             </div>
         );
     }
-}
+}

+ 6 - 6
loaders/src/glTF/2.0/glTFLoader.ts

@@ -1168,17 +1168,17 @@ export class GLTFLoader implements IGLTFLoader {
             let animationType: number;
             switch (channel.target.path) {
                 case AnimationChannelTargetPath.TRANSLATION: {
-                    targetPath = "_position";
+                    targetPath = "position";
                     animationType = Animation.ANIMATIONTYPE_VECTOR3;
                     break;
                 }
                 case AnimationChannelTargetPath.ROTATION: {
-                    targetPath = "_rotationQuaternion";
+                    targetPath = "rotationQuaternion";
                     animationType = Animation.ANIMATIONTYPE_QUATERNION;
                     break;
                 }
                 case AnimationChannelTargetPath.SCALE: {
-                    targetPath = "_scaling";
+                    targetPath = "scaling";
                     animationType = Animation.ANIMATIONTYPE_VECTOR3;
                     break;
                 }
@@ -1195,7 +1195,7 @@ export class GLTFLoader implements IGLTFLoader {
             let outputBufferOffset = 0;
             let getNextOutputValue: () => Vector3 | Quaternion | Array<number>;
             switch (targetPath) {
-                case "_position": {
+                case "position": {
                     getNextOutputValue = () => {
                         const value = Vector3.FromArray(data.output, outputBufferOffset);
                         outputBufferOffset += 3;
@@ -1203,7 +1203,7 @@ export class GLTFLoader implements IGLTFLoader {
                     };
                     break;
                 }
-                case "_rotationQuaternion": {
+                case "rotationQuaternion": {
                     getNextOutputValue = () => {
                         const value = Quaternion.FromArray(data.output, outputBufferOffset);
                         outputBufferOffset += 4;
@@ -1211,7 +1211,7 @@ export class GLTFLoader implements IGLTFLoader {
                     };
                     break;
                 }
-                case "_scaling": {
+                case "scaling": {
                     getNextOutputValue = () => {
                         const value = Vector3.FromArray(data.output, outputBufferOffset);
                         outputBufferOffset += 3;

+ 2 - 2
src/Animations/animatable.ts

@@ -20,7 +20,7 @@ export class Animatable {
     private _scene: Scene;
     private _speedRatio = 1;
     private _weight = -1.0;
-    private _syncRoot: Animatable;
+    private _syncRoot: Nullable<Animatable> = null;
 
     /**
      * Gets or sets a boolean indicating if the animatable must be disposed and removed at the end of the animation.
@@ -46,7 +46,7 @@ export class Animatable {
     /**
      * Gets the root Animatable used to synchronize and normalize animations
      */
-    public get syncRoot(): Animatable {
+    public get syncRoot(): Nullable<Animatable> {
         return this._syncRoot;
     }
 

+ 5 - 5
src/Animations/runtimeAnimation.ts

@@ -1,4 +1,4 @@
-import { DeepImmutable } from "../types";
+import { DeepImmutable, Nullable } from "../types";
 import { Quaternion, Vector3, Vector2, Size, Color3, Matrix } from "../Maths/math";
 import { Animation, _IAnimationState } from "./animation";
 import { AnimationEvent } from "./animationEvent";
@@ -59,7 +59,7 @@ export class RuntimeAnimation {
     /**
      * The original blend value of the runtime animation
      */
-    private _originalBlendValue: any;
+    private _originalBlendValue: Nullable<any> = null;
 
     /**
      * The offsets cache of the runtime animation
@@ -89,7 +89,7 @@ export class RuntimeAnimation {
     /**
      * The current value of the runtime animation
      */
-    private _currentValue: any;
+    private _currentValue: Nullable<any> = null;
 
     /** @hidden */
     public _animationState: _IAnimationState;
@@ -98,8 +98,8 @@ export class RuntimeAnimation {
      * The active target of the runtime animation
      */
     private _activeTargets: any[];
-    private _currentActiveTarget: any;
-    private _directTarget: any;
+    private _currentActiveTarget: Nullable<any> = null;
+    private _directTarget: Nullable<any> = null;
 
     /**
      * The target path of the runtime animation

+ 1 - 1
src/Bones/skeleton.ts

@@ -520,7 +520,7 @@ export class Skeleton implements IAnimatable {
     /**
      * Clone the current skeleton
      * @param name defines the name of the new skeleton
-     * @param id defines the id of the enw skeleton
+     * @param id defines the id of the new skeleton
      * @returns the new skeleton
      */
     public clone(name: string, id: string): Skeleton {

+ 3 - 1
src/Culling/boundingBox.ts

@@ -99,7 +99,9 @@ export class BoundingBox implements ICullable {
         max.addToRef(min, this.center).scaleInPlace(0.5);
         max.subtractToRef(min, this.extendSize).scaleInPlace(0.5);
 
-        this._update(worldMatrix || Matrix.IdentityReadOnly);
+        this._worldMatrix = worldMatrix || Matrix.IdentityReadOnly;
+
+        this._update(this._worldMatrix);
     }
 
     /**

+ 8 - 2
src/Engines/engine.ts

@@ -3365,7 +3365,7 @@ export class Engine {
      * @returns the new Effect
      */
     public createEffect(baseName: any, attributesNamesOrOptions: string[] | EffectCreationOptions, uniformsNamesOrEngine: string[] | Engine, samplers?: string[], defines?: string, fallbacks?: EffectFallbacks,
-        onCompiled?: (effect: Effect) => void, onError?: (effect: Effect, errors: string) => void, indexParameters?: any): Effect {
+        onCompiled?: Nullable<(effect: Effect) => void>, onError?: Nullable<(effect: Effect, errors: string) => void>, indexParameters?: any): Effect {
         var vertex = baseName.vertexElement || baseName.vertex || baseName;
         var fragment = baseName.fragmentElement || baseName.fragment || baseName;
 
@@ -4841,7 +4841,7 @@ export class Engine {
                     texture._workingCanvas.height = texture.height;
                 }
 
-                texture._workingContext.drawImage(video, 0, 0, video.videoWidth, video.videoHeight, 0, 0, texture.width, texture.height);
+                texture._workingContext!.drawImage(video, 0, 0, video.videoWidth, video.videoHeight, 0, 0, texture.width, texture.height);
 
                 this._gl.texImage2D(this._gl.TEXTURE_2D, 0, this._gl.RGBA, this._gl.RGBA, this._gl.UNSIGNED_BYTE, texture._workingCanvas);
             } else {
@@ -7335,6 +7335,12 @@ export class Engine {
                         return this._gl.RGB8UI;
                     case Engine.TEXTUREFORMAT_RGBA_INTEGER:
                         return this._gl.RGBA8UI;
+                    case Engine.TEXTUREFORMAT_ALPHA:
+                        return this._gl.ALPHA;
+                    case Engine.TEXTUREFORMAT_LUMINANCE:
+                        return this._gl.LUMINANCE;
+                    case Engine.TEXTUREFORMAT_LUMINANCE_ALPHA:
+                        return this._gl.LUMINANCE_ALPHA;
                     default:
                         return this._gl.RGBA8;
                 }

+ 7 - 0
src/Gizmos/boundingBoxGizmo.ts

@@ -85,7 +85,12 @@ export class BoundingBoxGizmo extends Gizmo {
      * Relative bounding box pivot used when scaling the attached mesh. When null object with scale from the opposite corner. 0.5,0.5,0.5 for center and 0.5,0,0.5 for bottom (Default: null)
      */
     public scalePivot: Nullable<Vector3> = null;
+
+    /**
+     * Mesh used as a pivot to rotate the attached mesh
+     */
     private _anchorMesh: AbstractMesh;
+
     private _existingMeshScale = new Vector3();
 
     // Dragging
@@ -416,6 +421,8 @@ export class BoundingBoxGizmo extends Gizmo {
             boundingMinMax.max.subtractToRef(boundingMinMax.min, this._boundingDimensions);
 
             // Update gizmo to match bounding box scaling and rotation
+            // The position set here is the offset from the origin for the boundingbox when the attached mesh is at the origin
+            // The position of the gizmo is then set to the attachedMesh in gizmo._update
             this._lineBoundingBox.scaling.copyFrom(this._boundingDimensions);
             this._lineBoundingBox.position.set((boundingMinMax.max.x + boundingMinMax.min.x) / 2, (boundingMinMax.max.y + boundingMinMax.min.y) / 2, (boundingMinMax.max.z + boundingMinMax.min.z) / 2);
             this._rotateSpheresParent.position.copyFrom(this._lineBoundingBox.position);

+ 16 - 16
src/Materials/PBR/pbrBaseMaterial.ts

@@ -333,12 +333,12 @@ export abstract class PBRBaseMaterial extends PushMaterial {
     /**
      * AKA Diffuse Texture in standard nomenclature.
      */
-    protected _albedoTexture: BaseTexture;
+    protected _albedoTexture: Nullable<BaseTexture> = null;
 
     /**
      * AKA Occlusion Texture in other nomenclature.
      */
-    protected _ambientTexture: BaseTexture;
+    protected _ambientTexture: Nullable<BaseTexture> = null;
 
     /**
      * AKA Occlusion Texture Intensity in other nomenclature.
@@ -355,55 +355,55 @@ export abstract class PBRBaseMaterial extends PushMaterial {
     /**
      * Stores the alpha values in a texture.
      */
-    protected _opacityTexture: BaseTexture;
+    protected _opacityTexture: Nullable<BaseTexture> = null;
 
     /**
      * Stores the reflection values in a texture.
      */
-    protected _reflectionTexture: BaseTexture;
+    protected _reflectionTexture: Nullable<BaseTexture> = null;
 
     /**
      * Stores the emissive values in a texture.
      */
-    protected _emissiveTexture: BaseTexture;
+    protected _emissiveTexture: Nullable<BaseTexture> = null;
 
     /**
      * AKA Specular texture in other nomenclature.
      */
-    protected _reflectivityTexture: BaseTexture;
+    protected _reflectivityTexture: Nullable<BaseTexture> = null;
 
     /**
      * Used to switch from specular/glossiness to metallic/roughness workflow.
      */
-    protected _metallicTexture: BaseTexture;
+    protected _metallicTexture: Nullable<BaseTexture> = null;
 
     /**
      * Specifies the metallic scalar of the metallic/roughness workflow.
      * Can also be used to scale the metalness values of the metallic texture.
      */
-    protected _metallic: Nullable<number>;
+    protected _metallic: Nullable<number> = null;
 
     /**
      * Specifies the roughness scalar of the metallic/roughness workflow.
      * Can also be used to scale the roughness values of the metallic texture.
      */
-    protected _roughness: Nullable<number>;
+    protected _roughness: Nullable<number> = null;
 
     /**
      * Used to enable roughness/glossiness fetch from a separate channel depending on the current mode.
      * Gray Scale represents roughness in metallic mode and glossiness in specular mode.
      */
-    protected _microSurfaceTexture: BaseTexture;
+    protected _microSurfaceTexture: Nullable<BaseTexture> = null;
 
     /**
      * Stores surface normal data used to displace a mesh in a texture.
      */
-    protected _bumpTexture: BaseTexture;
+    protected _bumpTexture: Nullable<BaseTexture> = null;
 
     /**
      * Stores the pre-calculated light information of a mesh in a texture.
      */
-    protected _lightmapTexture: BaseTexture;
+    protected _lightmapTexture: Nullable<BaseTexture> = null;
 
     /**
      * The color of a material in ambient lighting.
@@ -616,7 +616,7 @@ export abstract class PBRBaseMaterial extends PushMaterial {
     /**
      * Keep track of the image processing observer to allow dispose and replace.
      */
-    private _imageProcessingObserver: Nullable<Observer<ImageProcessingConfiguration>>;
+    private _imageProcessingObserver: Nullable<Observer<ImageProcessingConfiguration>> = null;
 
     /**
      * Attaches a new image processing configuration to the PBR Material.
@@ -661,7 +661,7 @@ export abstract class PBRBaseMaterial extends PushMaterial {
     /**
      * Enables the use of logarithmic depth buffers, which is good for wide depth buffers.
      */
-    private _useLogarithmicDepth: boolean;
+    private _useLogarithmicDepth: boolean = false;
 
     /**
      * If set to true, no lighting calculations will be applied.
@@ -874,7 +874,7 @@ export abstract class PBRBaseMaterial extends PushMaterial {
     /**
      * Gets the texture used for the alpha test.
      */
-    public getAlphaTestTexture(): BaseTexture {
+    public getAlphaTestTexture(): Nullable<BaseTexture> {
         return this._albedoTexture;
     }
 
@@ -1857,7 +1857,7 @@ export abstract class PBRBaseMaterial extends PushMaterial {
             }
 
             // image processing
-            this._imageProcessingConfiguration.bind(this._activeEffect);
+            this._imageProcessingConfiguration!.bind(this._activeEffect);
 
             // Log. depth
             MaterialHelper.BindLogDepth(defines, this._activeEffect, scene);

+ 4 - 4
src/Materials/Textures/baseTexture.ts

@@ -300,7 +300,7 @@ export class BaseTexture implements IAnimatable {
     */
     public onDisposeObservable = new Observable<BaseTexture>();
 
-    private _onDisposeObserver: Nullable<Observer<BaseTexture>>;
+    private _onDisposeObserver: Nullable<Observer<BaseTexture>> = null;
     /**
      * Callback triggered when the texture has been disposed.
      * Kept for back compatibility, you can use the onDisposeObservable instead.
@@ -317,11 +317,11 @@ export class BaseTexture implements IAnimatable {
      */
     public delayLoadState = Constants.DELAYLOADSTATE_NONE;
 
-    private _scene: Nullable<Scene>;
+    private _scene: Nullable<Scene> = null;
 
     /** @hidden */
-    public _texture: Nullable<InternalTexture>;
-    private _uid: Nullable<string>;
+    public _texture: Nullable<InternalTexture> = null;
+    private _uid: Nullable<string> = null;
 
     /**
      * Define if the texture is preventinga material to render or not.

+ 46 - 46
src/Materials/Textures/internalTexture.ts

@@ -77,43 +77,43 @@ export class InternalTexture {
     /**
      * Defines if the texture is ready
      */
-    public isReady: boolean;
+    public isReady: boolean = false;
     /**
      * Defines if the texture is a cube texture
      */
-    public isCube: boolean;
+    public isCube: boolean = false;
     /**
      * Defines if the texture contains 3D data
      */
-    public is3D: boolean;
+    public is3D: boolean = false;
     /**
      * Defines if the texture contains multiview data
      */
-    public isMultiview: boolean;
+    public isMultiview: boolean = false;
     /**
      * Gets the URL used to load this texture
      */
-    public url: string;
+    public url: string = "";
     /**
      * Gets the sampling mode of the texture
      */
-    public samplingMode: number;
+    public samplingMode: number = -1;
     /**
      * Gets a boolean indicating if the texture needs mipmaps generation
      */
-    public generateMipMaps: boolean;
+    public generateMipMaps: boolean = false;
     /**
      * Gets the number of samples used by the texture (WebGL2+ only)
      */
-    public samples: number;
+    public samples: number = 0;
     /**
      * Gets the type of the texture (int, float...)
      */
-    public type: number;
+    public type: number = -1;
     /**
      * Gets the format of the texture (RGB, RGBA...)
      */
-    public format: number;
+    public format: number = -1;
     /**
      * Observable called when the texture is loaded
      */
@@ -121,31 +121,31 @@ export class InternalTexture {
     /**
      * Gets the width of the texture
      */
-    public width: number;
+    public width: number = 0;
     /**
      * Gets the height of the texture
      */
-    public height: number;
+    public height: number = 0;
     /**
      * Gets the depth of the texture
      */
-    public depth: number;
+    public depth: number = 0;
     /**
      * Gets the initial width of the texture (It could be rescaled if the current system does not support non power of two textures)
      */
-    public baseWidth: number;
+    public baseWidth: number = 0;
     /**
      * Gets the initial height of the texture (It could be rescaled if the current system does not support non power of two textures)
      */
-    public baseHeight: number;
+    public baseHeight: number = 0;
     /**
      * Gets the initial depth of the texture (It could be rescaled if the current system does not support non power of two textures)
      */
-    public baseDepth: number;
+    public baseDepth: number = 0;
     /**
      * Gets a boolean indicating if the texture is inverted on Y axis
      */
-    public invertY: boolean;
+    public invertY: boolean = false;
 
     // Private
     /** @hidden */
@@ -155,51 +155,51 @@ export class InternalTexture {
     /** @hidden */
     public _dataSource = InternalTexture.DATASOURCE_UNKNOWN;
     /** @hidden */
-    public _buffer: Nullable<string | ArrayBuffer | HTMLImageElement | Blob>;
+    public _buffer: Nullable<string | ArrayBuffer | HTMLImageElement | Blob> = null;
     /** @hidden */
-    public _bufferView: Nullable<ArrayBufferView>;
+    public _bufferView: Nullable<ArrayBufferView> = null;
     /** @hidden */
-    public _bufferViewArray: Nullable<ArrayBufferView[]>;
+    public _bufferViewArray: Nullable<ArrayBufferView[]> = null;
     /** @hidden */
-    public _bufferViewArrayArray: Nullable<ArrayBufferView[][]>;
+    public _bufferViewArrayArray: Nullable<ArrayBufferView[][]> = null;
     /** @hidden */
-    public _size: number;
+    public _size: number = 0;
     /** @hidden */
-    public _extension: string;
+    public _extension: string = "";
     /** @hidden */
-    public _files: Nullable<string[]>;
+    public _files: Nullable<string[]> = null;
     /** @hidden */
-    public _workingCanvas: HTMLCanvasElement;
+    public _workingCanvas: Nullable<HTMLCanvasElement> = null;
     /** @hidden */
-    public _workingContext: CanvasRenderingContext2D;
+    public _workingContext: Nullable<CanvasRenderingContext2D> = null;
     /** @hidden */
-    public _framebuffer: Nullable<WebGLFramebuffer>;
+    public _framebuffer: Nullable<WebGLFramebuffer> = null;
     /** @hidden */
-    public _depthStencilBuffer: Nullable<WebGLRenderbuffer>;
+    public _depthStencilBuffer: Nullable<WebGLRenderbuffer> = null;
     /** @hidden */
-    public _MSAAFramebuffer: Nullable<WebGLFramebuffer>;
+    public _MSAAFramebuffer: Nullable<WebGLFramebuffer> = null;
     /** @hidden */
-    public _MSAARenderBuffer: Nullable<WebGLRenderbuffer>;
+    public _MSAARenderBuffer: Nullable<WebGLRenderbuffer> = null;
     /** @hidden */
-    public _attachments: Nullable<number[]>;
+    public _attachments: Nullable<number[]> = null;
     /** @hidden */
-    public _cachedCoordinatesMode: Nullable<number>;
+    public _cachedCoordinatesMode: Nullable<number> = null;
     /** @hidden */
-    public _cachedWrapU: Nullable<number>;
+    public _cachedWrapU: Nullable<number> = null;
     /** @hidden */
-    public _cachedWrapV: Nullable<number>;
+    public _cachedWrapV: Nullable<number> = null;
     /** @hidden */
-    public _cachedWrapR: Nullable<number>;
+    public _cachedWrapR: Nullable<number> = null;
     /** @hidden */
-    public _cachedAnisotropicFilteringLevel: Nullable<number>;
+    public _cachedAnisotropicFilteringLevel: Nullable<number> = null;
     /** @hidden */
-    public _isDisabled: boolean;
+    public _isDisabled: boolean = false;
     /** @hidden */
-    public _compression: Nullable<string>;
+    public _compression: Nullable<string> = null;
     /** @hidden */
-    public _generateStencilBuffer: boolean;
+    public _generateStencilBuffer: boolean = false;
     /** @hidden */
-    public _generateDepthBuffer: boolean;
+    public _generateDepthBuffer: boolean = false;
     /** @hidden */
     public _comparisonFunction: number = 0;
     /** @hidden */
@@ -211,24 +211,24 @@ export class InternalTexture {
 
     // Multiview
     /** @hidden */
-    public _colorTextureArray: Nullable<WebGLTexture>;
+    public _colorTextureArray: Nullable<WebGLTexture> = null;
     /** @hidden */
-    public _depthStencilTextureArray: Nullable<WebGLTexture>;
+    public _depthStencilTextureArray: Nullable<WebGLTexture> = null;
 
     // The following three fields helps sharing generated fixed LODs for texture filtering
     // In environment not supporting the textureLOD extension like EDGE. They are for internal use only.
     // They are at the level of the gl texture to benefit from the cache.
     /** @hidden */
-    public _lodTextureHigh: BaseTexture;
+    public _lodTextureHigh: Nullable<BaseTexture> = null;
     /** @hidden */
-    public _lodTextureMid: BaseTexture;
+    public _lodTextureMid: Nullable<BaseTexture> = null;
     /** @hidden */
-    public _lodTextureLow: BaseTexture;
+    public _lodTextureLow: Nullable<BaseTexture> = null;
     /** @hidden */
     public _isRGBD: boolean = false;
 
     /** @hidden */
-    public _webGLTexture: Nullable<WebGLTexture>;
+    public _webGLTexture: Nullable<WebGLTexture> = null;
     /** @hidden */
     public _references: number = 1;
 

+ 39 - 39
src/Materials/Textures/texture.ts

@@ -104,7 +104,7 @@ export class Texture extends BaseTexture {
      * Define the url of the texture.
      */
     @serialize()
-    public url: Nullable<string>;
+    public url: Nullable<string> = null;
 
     /**
      * Define an offset on the texture to offset the u coordinates of the UVs
@@ -184,37 +184,37 @@ export class Texture extends BaseTexture {
      * List of inspectable custom properties (used by the Inspector)
      * @see https://doc.babylonjs.com/how_to/debug_layer#extensibility
      */
-    public inspectableCustomProperties: IInspectable[];
+    public inspectableCustomProperties: Nullable<IInspectable[]> = null;
 
-    private _noMipmap: boolean;
+    private _noMipmap: boolean = false;
     /** @hidden */
-    public _invertY: boolean;
-    private _rowGenerationMatrix: Matrix;
-    private _cachedTextureMatrix: Matrix;
-    private _projectionModeMatrix: Matrix;
-    private _t0: Vector3;
-    private _t1: Vector3;
-    private _t2: Vector3;
-
-    private _cachedUOffset: number;
-    private _cachedVOffset: number;
-    private _cachedUScale: number;
-    private _cachedVScale: number;
-    private _cachedUAng: number;
-    private _cachedVAng: number;
-    private _cachedWAng: number;
-    private _cachedProjectionMatrixId: number;
-    private _cachedCoordinatesMode: number;
+    public _invertY: boolean = false;
+    private _rowGenerationMatrix: Nullable<Matrix> = null;
+    private _cachedTextureMatrix: Nullable<Matrix> = null;
+    private _projectionModeMatrix: Nullable<Matrix> = null;
+    private _t0: Nullable<Vector3> = null;
+    private _t1: Nullable<Vector3> = null;
+    private _t2: Nullable<Vector3> = null;
+
+    private _cachedUOffset: number = -1;
+    private _cachedVOffset: number = -1;
+    private _cachedUScale: number = 0;
+    private _cachedVScale: number = 0;
+    private _cachedUAng: number = -1;
+    private _cachedVAng: number = -1;
+    private _cachedWAng: number = -1;
+    private _cachedProjectionMatrixId: number = -1;
+    private _cachedCoordinatesMode: number = -1;
 
     /** @hidden */
     protected _initialSamplingMode = Texture.BILINEAR_SAMPLINGMODE;
 
     /** @hidden */
-    public _buffer: Nullable<string | ArrayBuffer | HTMLImageElement | Blob>;
-    private _deleteBuffer: boolean;
-    protected _format: Nullable<number>;
-    private _delayedOnLoad: Nullable<() => void>;
-    private _delayedOnError: Nullable<() => void>;
+    public _buffer: Nullable<string | ArrayBuffer | HTMLImageElement | Blob> = null;
+    private _deleteBuffer: boolean = false;
+    protected _format: Nullable<number> = null;
+    private _delayedOnLoad: Nullable<() => void> = null;
+    private _delayedOnError: Nullable<() => void> = null;
 
     /**
      * Observable triggered once the texture has been loaded.
@@ -400,7 +400,7 @@ export class Texture extends BaseTexture {
         y -= this.vRotationCenter * this.vScale;
         z -= this.wRotationCenter;
 
-        Vector3.TransformCoordinatesFromFloatsToRef(x, y, z, this._rowGenerationMatrix, t);
+        Vector3.TransformCoordinatesFromFloatsToRef(x, y, z, this._rowGenerationMatrix!, t);
 
         t.x += this.uRotationCenter * this.uScale + this.uOffset;
         t.y += this.vRotationCenter * this.vScale + this.vOffset;
@@ -420,7 +420,7 @@ export class Texture extends BaseTexture {
             this.uAng === this._cachedUAng &&
             this.vAng === this._cachedVAng &&
             this.wAng === this._cachedWAng) {
-            return this._cachedTextureMatrix;
+            return this._cachedTextureMatrix!;
         }
 
         this._cachedUOffset = this.uOffset;
@@ -439,19 +439,19 @@ export class Texture extends BaseTexture {
             this._t2 = Vector3.Zero();
         }
 
-        Matrix.RotationYawPitchRollToRef(this.vAng, this.uAng, this.wAng, this._rowGenerationMatrix);
+        Matrix.RotationYawPitchRollToRef(this.vAng, this.uAng, this.wAng, this._rowGenerationMatrix!);
 
-        this._prepareRowForTextureGeneration(0, 0, 0, this._t0);
-        this._prepareRowForTextureGeneration(1.0, 0, 0, this._t1);
-        this._prepareRowForTextureGeneration(0, 1.0, 0, this._t2);
+        this._prepareRowForTextureGeneration(0, 0, 0, this._t0!);
+        this._prepareRowForTextureGeneration(1.0, 0, 0, this._t1!);
+        this._prepareRowForTextureGeneration(0, 1.0, 0, this._t2!);
 
-        this._t1.subtractInPlace(this._t0);
-        this._t2.subtractInPlace(this._t0);
+        this._t1!.subtractInPlace(this._t0!);
+        this._t2!.subtractInPlace(this._t0!);
 
         Matrix.FromValuesToRef(
-            this._t1.x, this._t1.y, this._t1.z, 0.0,
-            this._t2.x, this._t2.y, this._t2.z, 0.0,
-            this._t0.x, this._t0.y, this._t0.z, 0.0,
+            this._t1!.x, this._t1!.y, this._t1!.z, 0.0,
+            this._t2!.x, this._t2!.y, this._t2!.z, 0.0,
+            this._t0!.x, this._t0!.y, this._t0!.z, 0.0,
             0.0, 0.0, 0.0, 1.0,
             this._cachedTextureMatrix
         );
@@ -477,7 +477,7 @@ export class Texture extends BaseTexture {
         let scene = this.getScene();
 
         if (!scene) {
-            return this._cachedTextureMatrix;
+            return this._cachedTextureMatrix!;
         }
 
         if (
@@ -488,10 +488,10 @@ export class Texture extends BaseTexture {
             this.coordinatesMode === this._cachedCoordinatesMode) {
             if (this.coordinatesMode === Texture.PROJECTION_MODE) {
                 if (this._cachedProjectionMatrixId === scene.getProjectionMatrix().updateFlag) {
-                    return this._cachedTextureMatrix;
+                    return this._cachedTextureMatrix!;
                 }
             } else {
-                return this._cachedTextureMatrix;
+                return this._cachedTextureMatrix!;
             }
         }
 

+ 11 - 11
src/Materials/material.ts

@@ -213,17 +213,17 @@ export class Material implements IAnimatable {
     /**
      * Callback triggered when the material is compiled
      */
-    public onCompiled: (effect: Effect) => void;
+    public onCompiled: Nullable<(effect: Effect) => void> = null;
 
     /**
      * Callback triggered when an error occurs
      */
-    public onError: (effect: Effect, errors: string) => void;
+    public onError: Nullable<(effect: Effect, errors: string) => void> = null;
 
     /**
      * Callback triggered to get the render target textures
      */
-    public getRenderTargetTextures: () => SmartArray<RenderTargetTexture>;
+    public getRenderTargetTextures: Nullable<() => SmartArray<RenderTargetTexture>> = null;
 
     /**
      * Gets a boolean indicating that current material needs to register RTT
@@ -245,7 +245,7 @@ export class Material implements IAnimatable {
     /**
      * Stores the animations for the material
      */
-    public animations: Array<Animation>;
+    public animations: Nullable<Array<Animation>> = null;
 
     /**
     * An event triggered when the material is disposed
@@ -255,8 +255,8 @@ export class Material implements IAnimatable {
     /**
      * An observer which watches for dispose events
      */
-    private _onDisposeObserver: Nullable<Observer<Material>>;
-    private _onUnBindObservable: Nullable<Observable<Material>>;
+    private _onDisposeObserver: Nullable<Observer<Material>> = null;
+    private _onUnBindObservable: Nullable<Observable<Material>> = null;
 
     /**
      * Called during a dispose event
@@ -284,7 +284,7 @@ export class Material implements IAnimatable {
     /**
      * An observer which watches for bind events
      */
-    private _onBindObserver: Nullable<Observer<AbstractMesh>>;
+    private _onBindObserver: Nullable<Observer<AbstractMesh>> = null;
 
     /**
      * Called during a bind event
@@ -494,7 +494,7 @@ export class Material implements IAnimatable {
      * @hidden
      * Stores the effects for the material
      */
-    public _effect: Nullable<Effect>;
+    public _effect: Nullable<Effect> = null;
 
     /**
      * @hidden
@@ -505,7 +505,7 @@ export class Material implements IAnimatable {
     /**
      * Specifies if uniform buffers should be used
      */
-    private _useUBO: boolean;
+    private _useUBO: boolean = false;
 
     /**
      * Stores a reference to the scene
@@ -520,7 +520,7 @@ export class Material implements IAnimatable {
     /**
      * Specifies if the depth write state should be cached
      */
-    private _cachedDepthWriteState: boolean;
+    private _cachedDepthWriteState: boolean = false;
 
     /**
      * Stores the uniform buffer
@@ -531,7 +531,7 @@ export class Material implements IAnimatable {
     public _indexInSceneMaterialArray = -1;
 
     /** @hidden */
-    public meshMap: Nullable<{ [id: string]: AbstractMesh | undefined }>;
+    public meshMap: Nullable<{ [id: string]: AbstractMesh | undefined }> = null;
 
     /**
      * Creates a material instance

+ 1 - 1
src/Materials/shaderMaterial.ts

@@ -733,7 +733,7 @@ export class ShaderMaterial extends Material {
      */
     public serialize(): any {
         var serializationObject = SerializationHelper.Serialize(this);
-        serializationObject.customType = "ShaderMaterial";
+        serializationObject.customType = "BABYLON.ShaderMaterial";
 
         serializationObject.options = this._options;
         serializationObject.shaderPath = this._shaderPath;

+ 2 - 2
src/Maths/math.ts

@@ -371,7 +371,7 @@ export class Color3 {
     }
 
     /**
-     * Creates a new Vector3 from the starting index of the given array
+     * Creates a new Color3 from the starting index of the given array
      * @param array defines the source array
      * @param offset defines an offset in the source array
      * @returns a new Color3 object
@@ -4386,7 +4386,7 @@ export class Matrix {
      * It will be incremented every time the matrix data change.
      * You can use it to speed the comparison between two versions of the same matrix.
      */
-    public updateFlag: number;
+    public updateFlag: number = -1;
 
     private readonly _m: Float32Array = new Float32Array(16);
 

+ 13 - 71
src/Meshes/abstractMesh.ts

@@ -264,14 +264,14 @@ export class AbstractMesh extends TransformNode implements IDisposable, ICullabl
     public definedFacingForward = true;
 
     /** @hidden */
-    public _occlusionQuery: Nullable<WebGLQuery>;
+    public _occlusionQuery: Nullable<WebGLQuery> = null;
 
     private _visibility = 1.0;
 
     /** @hidden */
     public _isActive = false;
     /** @hidden */
-    public _renderingGroup: RenderingGroup;
+    public _renderingGroup: Nullable<RenderingGroup> = null;
 
     /**
      * Gets or sets mesh visibility between 0 and 1 (default is 1)
@@ -325,7 +325,7 @@ export class AbstractMesh extends TransformNode implements IDisposable, ICullabl
      * @see http://doc.babylonjs.com/resources/transparency_and_how_meshes_are_rendered#rendering-groups
      */
     public renderingGroupId = 0;
-    private _material: Nullable<Material>;
+    private _material: Nullable<Material> = null;
 
     /** Gets or sets current material */
     public get material(): Nullable<Material> {
@@ -518,7 +518,7 @@ export class AbstractMesh extends TransformNode implements IDisposable, ICullabl
      * @see http://doc.babylonjs.com/babylon101/cameras,_mesh_collisions_and_gravity
      */
     public ellipsoidOffset = new Vector3(0, 0, 0);
-    private _collider: Collider;
+    private _collider: Nullable<Collider> = null;
     private _oldPositionForCollisions = new Vector3(0, 0, 0);
     private _diffPositionForCollisions = new Vector3(0, 0, 0);
 
@@ -558,12 +558,12 @@ export class AbstractMesh extends TransformNode implements IDisposable, ICullabl
      */
     public edgesColor = new Color4(1, 0, 0, 1);
     /** @hidden */
-    public _edgesRenderer: Nullable<IEdgesRenderer>;
+    public _edgesRenderer: Nullable<IEdgesRenderer> = null;
 
     /** @hidden */
-    public _masterMesh: Nullable<AbstractMesh>;
+    public _masterMesh: Nullable<AbstractMesh> = null;
     /** @hidden */
-    public _boundingInfo: Nullable<BoundingInfo>;
+    public _boundingInfo: Nullable<BoundingInfo> = null;
     /** @hidden */
     public _renderId = 0;
 
@@ -589,14 +589,14 @@ export class AbstractMesh extends TransformNode implements IDisposable, ICullabl
 
     // Loading properties
     /** @hidden */
-    public _waitingActions: any;
+    public _waitingActions: Nullable<any> = null;
     /** @hidden */
-    public _waitingFreezeWorldMatrix: Nullable<boolean>;
+    public _waitingFreezeWorldMatrix: Nullable<boolean> = null;
 
     // Skeleton
-    private _skeleton: Nullable<Skeleton>;
+    private _skeleton: Nullable<Skeleton> = null;
     /** @hidden */
-    public _bonesTransformMatrices: Nullable<Float32Array>;
+    public _bonesTransformMatrices: Nullable<Float32Array> = null;
 
     /**
      * Gets or sets a skeleton to apply skining transformations
@@ -1130,64 +1130,6 @@ export class AbstractMesh extends TransformNode implements IDisposable, ICullabl
     }
 
     /**
-     * Return the minimum and maximum world vectors of the entire hierarchy under current mesh
-     * @param includeDescendants Include bounding info from descendants as well (true by default)
-     * @param predicate defines a callback function that can be customize to filter what meshes should be included in the list used to compute the bounding vectors
-     * @returns the new bounding vectors
-     */
-    public getHierarchyBoundingVectors(includeDescendants = true, predicate: Nullable<(abstractMesh: AbstractMesh) => boolean> = null): { min: Vector3, max: Vector3 } {
-        // Ensures that all world matrix will be recomputed.
-        this.getScene().incrementRenderId();
-
-        this.computeWorldMatrix(true);
-
-        let min: Vector3;
-        let max: Vector3;
-        let boundingInfo = this.getBoundingInfo();
-
-        if (!this.subMeshes) {
-            min = new Vector3(Number.MAX_VALUE, Number.MAX_VALUE, Number.MAX_VALUE);
-            max = new Vector3(-Number.MAX_VALUE, -Number.MAX_VALUE, -Number.MAX_VALUE);
-        } else {
-            min = boundingInfo.boundingBox.minimumWorld;
-            max = boundingInfo.boundingBox.maximumWorld;
-        }
-
-        if (includeDescendants) {
-            let descendants = this.getDescendants(false);
-
-            for (var descendant of descendants) {
-                let childMesh = <AbstractMesh>descendant;
-                childMesh.computeWorldMatrix(true);
-
-                // Filters meshes based on custom predicate function.
-                if (predicate && !predicate(childMesh)) {
-                    continue;
-                }
-
-                //make sure we have the needed params to get mix and max
-                if (!childMesh.getBoundingInfo || childMesh.getTotalVertices() === 0) {
-                    continue;
-                }
-
-                let childBoundingInfo = childMesh.getBoundingInfo();
-                let boundingBox = childBoundingInfo.boundingBox;
-
-                var minBox = boundingBox.minimumWorld;
-                var maxBox = boundingBox.maximumWorld;
-
-                Tools.CheckExtends(minBox, min, max);
-                Tools.CheckExtends(maxBox, min, max);
-            }
-        }
-
-        return {
-            min: min,
-            max: max
-        };
-    }
-
-    /**
      * This method recomputes and sets a new BoundingInfo to the mesh unless it is locked.
      * This means the mesh underlying bounding box and sphere are recomputed.
      * @param applySkeleton defines whether to apply the skeleton before computing the bounding info
@@ -1396,7 +1338,7 @@ export class AbstractMesh extends TransformNode implements IDisposable, ICullabl
      * Gets Collider object used to compute collisions (not physics)
      * @see http://doc.babylonjs.com/babylon101/cameras,_mesh_collisions_and_gravity
      */
-    public get collider(): Collider {
+    public get collider(): Nullable<Collider> {
         return this._collider;
     }
 
@@ -1446,7 +1388,7 @@ export class AbstractMesh extends TransformNode implements IDisposable, ICullabl
         }
 
         // Transformation
-        if (!subMesh._lastColliderWorldVertices || !subMesh._lastColliderTransformMatrix.equals(transformMatrix)) {
+        if (!subMesh._lastColliderWorldVertices || !subMesh._lastColliderTransformMatrix!.equals(transformMatrix)) {
             subMesh._lastColliderTransformMatrix = transformMatrix.clone();
             subMesh._lastColliderWorldVertices = [];
             subMesh._trianglePlanes = [];

+ 16 - 14
src/Meshes/mesh.ts

@@ -27,6 +27,7 @@ import { SerializationHelper } from "../Misc/decorators";
 import { Logger } from "../Misc/logger";
 import { _TypeStore } from '../Misc/typeStore';
 import { _DevTools } from '../Misc/devTools';
+import { SceneComponentConstants } from "../sceneComponent";
 
 declare type LinesMesh = import("./linesMesh").LinesMesh;
 declare type InstancedMesh = import("./instancedMesh").InstancedMesh;
@@ -241,7 +242,7 @@ export class Mesh extends AbstractMesh implements IGetSetVerticesData {
     public onLODLevelSelection: (distance: number, mesh: Mesh, selectedLevel: Nullable<Mesh>) => void;
 
     // Morph
-    private _morphTargetManager: Nullable<MorphTargetManager>;
+    private _morphTargetManager: Nullable<MorphTargetManager> = null;
 
     /**
      * Gets or sets the morph target manager
@@ -261,10 +262,10 @@ export class Mesh extends AbstractMesh implements IGetSetVerticesData {
 
     // Private
     /** @hidden */
-    public _creationDataStorage: Nullable<_CreationDataStorage>;
+    public _creationDataStorage: Nullable<_CreationDataStorage> = null;
 
     /** @hidden */
-    public _geometry: Nullable<Geometry>;
+    public _geometry: Nullable<Geometry> = null;
     /** @hidden */
     public _delayInfo: Array<string>;
     /** @hidden */
@@ -273,11 +274,11 @@ export class Mesh extends AbstractMesh implements IGetSetVerticesData {
     /** @hidden */
     public _instanceDataStorage = new _InstanceDataStorage();
 
-    private _effectiveMaterial: Material;
+    private _effectiveMaterial: Nullable<Material> = null;
 
     /** @hidden */
-    public _shouldGenerateFlatShading: boolean;
-    private _preActivateId: number;
+    public _shouldGenerateFlatShading: boolean = false;
+    private _preActivateId: number = -1;
 
     // Use by builder only to know what orientation were the mesh build in.
     /** @hidden */
@@ -296,7 +297,7 @@ export class Mesh extends AbstractMesh implements IGetSetVerticesData {
     // Will be used to save a source mesh reference, If any
     private _source: Nullable<Mesh> = null;
     // Will be used to for fast cloned mesh lookup
-    private meshMap: Nullable<{ [id: string]: Mesh | undefined }>;
+    private meshMap: Nullable<{ [id: string]: Mesh | undefined }> = null;
 
     /**
      * Gets the source mesh (the one used to clone this one from)
@@ -2775,13 +2776,14 @@ export class Mesh extends AbstractMesh implements IGetSetVerticesData {
 
         // Physics
         //TODO implement correct serialization for physics impostors.
-
-        let impostor = this.getPhysicsImpostor();
-        if (impostor) {
-            serializationObject.physicsMass = impostor.getParam("mass");
-            serializationObject.physicsFriction = impostor.getParam("friction");
-            serializationObject.physicsRestitution = impostor.getParam("mass");
-            serializationObject.physicsImpostor = impostor.type;
+        if (this.getScene()._getComponent(SceneComponentConstants.NAME_PHYSICSENGINE)) {
+            let impostor = this.getPhysicsImpostor();
+            if (impostor) {
+                serializationObject.physicsMass = impostor.getParam("mass");
+                serializationObject.physicsFriction = impostor.getParam("friction");
+                serializationObject.physicsRestitution = impostor.getParam("mass");
+                serializationObject.physicsImpostor = impostor.type;
+            }
         }
 
         // Metadata

+ 9 - 9
src/Meshes/subMesh.ts

@@ -22,9 +22,9 @@ declare type TrianglePickingPredicate = import("../Culling/ray").TrianglePicking
  */
 export class BaseSubMesh {
     /** @hidden */
-    public _materialDefines: Nullable<MaterialDefines>;
+    public _materialDefines: Nullable<MaterialDefines> = null;
     /** @hidden */
-    public _materialEffect: Nullable<Effect>;
+    public _materialEffect: Nullable<Effect> = null;
 
     /**
      * Gets associated effect
@@ -55,28 +55,28 @@ export class BaseSubMesh {
  */
 export class SubMesh extends BaseSubMesh implements ICullable {
     /** @hidden */
-    public _linesIndexCount: number;
+    public _linesIndexCount: number = 0;
     private _mesh: AbstractMesh;
     private _renderingMesh: Mesh;
     private _boundingInfo: BoundingInfo;
-    private _linesIndexBuffer: Nullable<WebGLBuffer>;
+    private _linesIndexBuffer: Nullable<WebGLBuffer> = null;
     /** @hidden */
-    public _lastColliderWorldVertices: Nullable<Vector3[]>;
+    public _lastColliderWorldVertices: Nullable<Vector3[]> = null;
     /** @hidden */
     public _trianglePlanes: Plane[];
     /** @hidden */
-    public _lastColliderTransformMatrix: Matrix;
+    public _lastColliderTransformMatrix: Nullable<Matrix> = null;
 
     /** @hidden */
     public _renderId = 0;
     /** @hidden */
-    public _alphaIndex: number;
+    public _alphaIndex: number = 0;
     /** @hidden */
-    public _distanceToCamera: number;
+    public _distanceToCamera: number = 0;
     /** @hidden */
     public _id: number;
 
-    private _currentMaterial: Nullable<Material>;
+    private _currentMaterial: Nullable<Material> = null;
 
     /**
      * Add a new submesh to a mesh

+ 10 - 3
src/Meshes/transformNode.ts

@@ -49,12 +49,12 @@ export class TransformNode extends Node {
     private _rotation = Vector3.Zero();
 
     @serializeAsQuaternion("rotationQuaternion")
-    private _rotationQuaternion: Nullable<Quaternion>;
+    private _rotationQuaternion: Nullable<Quaternion> = null;
 
     @serializeAsVector3("scaling")
     protected _scaling = Vector3.One();
     protected _isDirty = false;
-    private _transformToBoneReferal: Nullable<TransformNode>;
+    private _transformToBoneReferal: Nullable<TransformNode> = null;
 
     @serialize("billboardMode")
     private _billboardMode = TransformNode.BILLBOARDMODE_NONE;
@@ -137,7 +137,7 @@ export class TransformNode extends Node {
 
     // Cache
     /** @hidden */
-    public _poseMatrix: Matrix;
+    public _poseMatrix: Nullable<Matrix> = null;
     /** @hidden */
     public _localMatrix = Matrix.Zero();
 
@@ -264,6 +264,10 @@ export class TransformNode extends Node {
      * @returns this TransformNode.
      */
     public updatePoseMatrix(matrix: Matrix): TransformNode {
+        if (!this._poseMatrix) {
+            this._poseMatrix = matrix.clone();
+            return this;
+        }
         this._poseMatrix.copyFrom(matrix);
         return this;
     }
@@ -273,6 +277,9 @@ export class TransformNode extends Node {
      * @returns the pose matrix
      */
     public getPoseMatrix(): Matrix {
+        if (!this._poseMatrix) {
+            this._poseMatrix = Matrix.Identity();
+        }
         return this._poseMatrix;
     }
 

+ 1 - 1
src/Misc/tools.ts

@@ -44,7 +44,7 @@ export interface IAnimatable {
     /**
      * Array of animations
      */
-    animations: Array<Animation>;
+    animations: Nullable<Array<Animation>>;
 }
 
 /** Interface used by value gradients (color, factor, ...) */

+ 68 - 8
src/node.ts

@@ -1,6 +1,6 @@
 import { Scene } from "./scene";
 import { Nullable } from "./types";
-import { Matrix } from "./Maths/math";
+import { Matrix, Vector3 } from "./Maths/math";
 import { Engine } from "./Engines/engine";
 import { IBehaviorAware, Behavior } from "./Behaviors/behavior";
 import { serialize } from "./Misc/decorators";
@@ -9,6 +9,7 @@ import { EngineStore } from "./Engines/engineStore";
 import { _DevTools } from './Misc/devTools';
 import { AbstractActionManager } from './Actions/abstractActionManager';
 import { IInspectable } from './Misc/iInspectable';
+import { Tools } from './Misc/tools';
 
 declare type Animatable = import("./Animations/animatable").Animatable;
 declare type AnimationPropertiesOverride = import("./Animations/animationPropertiesOverride").AnimationPropertiesOverride;
@@ -117,7 +118,7 @@ export class Node implements IBehaviorAware<Node> {
     /**
      * Callback raised when the node is ready to be used
      */
-    public onReady: (node: Node) => void;
+    public onReady: Nullable<(node: Node) => void> = null;
 
     private _isEnabled = true;
     private _isParentEnabled = true;
@@ -129,14 +130,14 @@ export class Node implements IBehaviorAware<Node> {
     public _childUpdateId = -1;
 
     /** @hidden */
-    public _waitingParentId: Nullable<string>;
+    public _waitingParentId: Nullable<string> = null;
     /** @hidden */
     public _scene: Scene;
     /** @hidden */
-    public _cache: any;
+    public _cache: any = {};
 
-    private _parentNode: Nullable<Node>;
-    private _children: Node[];
+    private _parentNode: Nullable<Node> = null;
+    private _children: Nullable<Node[]> = null;
 
     /** @hidden */
     public _worldMatrix = Matrix.Identity();
@@ -252,7 +253,7 @@ export class Node implements IBehaviorAware<Node> {
     */
     public onDisposeObservable = new Observable<Node>();
 
-    private _onDisposeObserver: Nullable<Observer<Node>>;
+    private _onDisposeObserver: Nullable<Observer<Node>> = null;
     /**
      * Sets a callback that will be raised when the node will be disposed
      */
@@ -780,4 +781,63 @@ export class Node implements IBehaviorAware<Node> {
             }
         }
     }
-}
+        /**
+     * Return the minimum and maximum world vectors of the entire hierarchy under current node
+     * @param includeDescendants Include bounding info from descendants as well (true by default)
+     * @param predicate defines a callback function that can be customize to filter what meshes should be included in the list used to compute the bounding vectors
+     * @returns the new bounding vectors
+     */
+    public getHierarchyBoundingVectors(includeDescendants = true, predicate: Nullable<(abstractMesh: AbstractMesh) => boolean> = null): { min: Vector3, max: Vector3 } {
+        // Ensures that all world matrix will be recomputed.
+        this.getScene().incrementRenderId();
+
+        this.computeWorldMatrix(true);
+
+        let min: Vector3;
+        let max: Vector3;
+
+        let thisAbstractMesh = (this as Node as AbstractMesh);
+        if (thisAbstractMesh.getBoundingInfo && thisAbstractMesh.subMeshes) {
+            // If this is an abstract mesh get its bounding info
+            let boundingInfo = thisAbstractMesh.getBoundingInfo();
+            min = boundingInfo.boundingBox.minimumWorld;
+            max = boundingInfo.boundingBox.maximumWorld;
+        } else {
+            min = new Vector3(Number.MAX_VALUE, Number.MAX_VALUE, Number.MAX_VALUE);
+            max = new Vector3(-Number.MAX_VALUE, -Number.MAX_VALUE, -Number.MAX_VALUE);
+        }
+
+        if (includeDescendants) {
+            let descendants = this.getDescendants(false);
+
+            for (var descendant of descendants) {
+                let childMesh = <AbstractMesh>descendant;
+                childMesh.computeWorldMatrix(true);
+
+                // Filters meshes based on custom predicate function.
+                if (predicate && !predicate(childMesh)) {
+                    continue;
+                }
+
+                //make sure we have the needed params to get mix and max
+                if (!childMesh.getBoundingInfo || childMesh.getTotalVertices() === 0) {
+                    continue;
+                }
+
+                let childBoundingInfo = childMesh.getBoundingInfo();
+                let boundingBox = childBoundingInfo.boundingBox;
+
+                var minBox = boundingBox.minimumWorld;
+                var maxBox = boundingBox.maximumWorld;
+
+                Tools.CheckExtends(minBox, min, max);
+                Tools.CheckExtends(maxBox, min, max);
+            }
+        }
+
+        return {
+            min: min,
+            max: max
+        };
+    }
+}

+ 2 - 2
src/scene.ts

@@ -3736,7 +3736,7 @@ export class Scene extends AbstractScene implements IAnimatable {
                     if (this._processedMaterials.indexOf(material) === -1) {
                         this._processedMaterials.push(material);
 
-                        this._renderTargets.concatWithNoDuplicate(material.getRenderTargetTextures());
+                        this._renderTargets.concatWithNoDuplicate(material.getRenderTargetTextures!());
                     }
                 }
 
@@ -3926,7 +3926,7 @@ export class Scene extends AbstractScene implements IAnimatable {
 
             this._totalVertices.addCount(mesh.getTotalVertices(), false);
 
-            if (!mesh.isReady() || !mesh.isEnabled()) {
+            if (!mesh.isReady() || !mesh.isEnabled() || mesh.scaling.lengthSquared() === 0) {
                 continue;
             }
 

BIN
tests/validation/ReferenceImages/gltfAnimationNode.png


BIN
tests/validation/ReferenceImages/gltfAnimationNodeMisc.png


BIN
tests/validation/ReferenceImages/gltfAnimationSkin0.png


BIN
tests/validation/ReferenceImages/gltfAnimationSkin1.png


BIN
tests/validation/ReferenceImages/gltfAnimationSkinType.png


BIN
tests/validation/ReferenceImages/gltfBufferInterleaved.png


BIN
tests/validation/ReferenceImages/gltfMaterial.png


BIN
tests/validation/ReferenceImages/gltfMaterialAlphaBlend.png


BIN
tests/validation/ReferenceImages/gltfMaterialAlphaMask.png


BIN
tests/validation/ReferenceImages/gltfMaterialDoubleSided.png


BIN
tests/validation/ReferenceImages/gltfMaterialDoubleSidedBack.png


BIN
tests/validation/ReferenceImages/gltfMaterialDoubleSidedFront.png


BIN
tests/validation/ReferenceImages/gltfMaterialMetallicRoughness.png


BIN
tests/validation/ReferenceImages/gltfMaterialMetallicRoughness0.png


BIN
tests/validation/ReferenceImages/gltfMaterialMetallicRoughness1.png


BIN
tests/validation/ReferenceImages/gltfMaterialMixed.png


BIN
tests/validation/ReferenceImages/gltfMaterialSpecularGlossiness.png


BIN
tests/validation/ReferenceImages/gltfMaterialSpecularGlossiness0.png


BIN
tests/validation/ReferenceImages/gltfMaterialSpecularGlossiness1.png


BIN
tests/validation/ReferenceImages/gltfMeshPrimitiveAttribute.png


BIN
tests/validation/ReferenceImages/gltfMeshPrimitiveMode.png


BIN
tests/validation/ReferenceImages/gltfMeshPrimitiveMode0.png


BIN
tests/validation/ReferenceImages/gltfMeshPrimitiveMode1.png


BIN
tests/validation/ReferenceImages/gltfMeshPrimitiveVertexColor.png


BIN
tests/validation/ReferenceImages/gltfMeshPrimitives.png


BIN
tests/validation/ReferenceImages/gltfMeshPrimitivesUV.png


BIN
tests/validation/ReferenceImages/gltfMeshPrimitivesUV0.png


BIN
tests/validation/ReferenceImages/gltfMeshPrimitivesUV1.png


BIN
tests/validation/ReferenceImages/gltfNodeAttribute0.png


BIN
tests/validation/ReferenceImages/gltfNodeAttribute1.png


BIN
tests/validation/ReferenceImages/gltfNodeNegativeScale0.png


BIN
tests/validation/ReferenceImages/gltfNodeNegativeScale1.png


BIN
tests/validation/ReferenceImages/gltfPrimitiveAttribute.png


BIN
tests/validation/ReferenceImages/gltfTextureSampler.png


BIN
tests/validation/ReferenceImages/gltfTextureSampler0.png


BIN
tests/validation/ReferenceImages/gltfTextureSampler1.png


BIN
tests/validation/ReferenceImages/nested_BBG.png


+ 133 - 34
tests/validation/config.json

@@ -2,6 +2,11 @@
   "root": "https://rawgit.com/BabylonJS/Website/master",
   "tests": [
     {
+      "title": "Nested BBG",
+      "playgroundId": "#ZG0C8B#0",
+      "referenceImage": "nested_BBG.png"
+    },
+    {
       "title": "Weighted animations",
       "playgroundId": "#LL5BIQ#72",
       "renderCount": 50,
@@ -311,84 +316,178 @@
       "referenceImage": "gltfnormals.png"
     },
     {
+      "title": "GLTF Animation Node",
+      "playgroundId": "#DS8AA7#15",
+      "replace": "__folder__, Animation_Node, __page__, 0",
+      "referenceImage": "gltfAnimationNode.png"
+    },
+    {
+      "title": "GLTF Animation Node Misc",
+      "playgroundId": "#DS8AA7#15",
+      "replace": "__folder__, Animation_NodeMisc, __page__, 0",
+      "referenceImage": "gltfAnimationNodeMisc.png"
+    },
+    {
+      "title": "GLTF Animation Skin (0)",
+      "playgroundId": "#DS8AA7#15",
+      "replace": "__folder__, Animation_Skin, __page__, 0",
+      "referenceImage": "gltfAnimationSkin0.png"
+    },
+    {
+      "title": "GLTF Animation Skin (1)",
+      "playgroundId": "#DS8AA7#15",
+      "replace": "__folder__, Animation_Skin, __page__, 1",
+      "referenceImage": "gltfAnimationSkin1.png"
+    },
+    {
+      "title": "GLTF Animation Skin Type",
+      "playgroundId": "#DS8AA7#15",
+      "replace": "__folder__, Animation_SkinType, __page__, 0",
+      "referenceImage": "gltfAnimationSkinType.png"
+    },
+    {
       "title": "GLTF Buffer Interleaved",
-      "playgroundId": "#a68vz0#3",
+      "playgroundId": "#DS8AA7#15",
+      "replace": "__folder__, Buffer_Interleaved, __page__, 0",
       "referenceImage": "gltfBufferInterleaved.png"
     },
     {
       "title": "GLTF Material",
-      "playgroundId": "#a68vz0#2",
+      "playgroundId": "#DS8AA7#15",
+      "replace": "__folder__, Material, __page__, 0",
       "referenceImage": "gltfMaterial.png"
     },
     {
       "title": "GLTF Material Alpha Blend",
-      "playgroundId": "#a68vz0#4",
+      "playgroundId": "#DS8AA7#15",
+      "replace": "__folder__, Material_AlphaBlend, __page__, 0",
       "referenceImage": "gltfMaterialAlphaBlend.png"
     },
     {
       "title": "GLTF Material Alpha Mask",
-      "playgroundId": "#a68vz0#5",
+      "playgroundId": "#DS8AA7#15",
+      "replace": "__folder__, Material_AlphaMask, __page__, 0",
       "referenceImage": "gltfMaterialAlphaMask.png"
     },
     {
-      "title": "GLTF Material Double Sided",
-      "playgroundId": "#a68vz0#7",
-      "referenceImage": "gltfMaterialDoubleSided.png"
+      "title": "GLTF Material Double Sided (Front)",
+      "playgroundId": "#DS8AA7#15",
+      "replace": "__folder__, Material_DoubleSided, __page__, 0",
+      "referenceImage": "gltfMaterialDoubleSidedFront.png"
     },
     {
       "title": "GLTF Material Double Sided (Back)",
-      "playgroundId": "#a68vz0#6",
+      "playgroundId": "#DS8AA7#15",
+      "replace": "__folder__, Material_DoubleSided, __page__, 0, alpha = Math.PI / 2, alpha = -Math.PI / 2",
       "referenceImage": "gltfMaterialDoubleSidedBack.png"
     },
     {
+      "title": "GLTF Material Metallic Roughness (0)",
+      "playgroundId": "#DS8AA7#15",
+      "replace": "__folder__, Material_MetallicRoughness, __page__, 0",
+      "referenceImage": "gltfMaterialMetallicRoughness0.png"
+    },
+    {
+      "title": "GLTF Material Metallic Roughness (1)",
+      "playgroundId": "#DS8AA7#15",
+      "replace": "__folder__, Material_MetallicRoughness, __page__, 1",
+      "referenceImage": "gltfMaterialMetallicRoughness1.png"
+    },
+    {
       "title": "GLTF Material Mixed",
-      "playgroundId": "#a68vz0#8",
+      "playgroundId": "#DS8AA7#15",
+      "replace": "__folder__, Material_Mixed, __page__, 0",
       "referenceImage": "gltfMaterialMixed.png"
     },
     {
-      "title": "GLTF Mesh Primitives",
-      "playgroundId": "#a68vz0#9",
-      "referenceImage": "gltfMeshPrimitives.png"
+      "title": "GLTF Material Specular Glossiness (0)",
+      "playgroundId": "#DS8AA7#15",
+      "replace": "__folder__, Material_SpecularGlossiness, __page__, 0",
+      "referenceImage": "gltfMaterialSpecularGlossiness0.png"
+    },
+    {
+      "title": "GLTF Material Specular Glossiness (1)",
+      "playgroundId": "#DS8AA7#15",
+      "replace": "__folder__, Material_SpecularGlossiness, __page__, 1",
+      "referenceImage": "gltfMaterialSpecularGlossiness1.png"
+    },
+    {
+      "title": "GLTF Mesh Primitive Attribute",
+      "playgroundId": "#DS8AA7#15",
+      "replace": "__folder__, Mesh_PrimitiveAttribute, __page__, 0",
+      "referenceImage": "gltfMeshPrimitiveAttribute.png"
+    },
+    {
+      "title": "GLTF Mesh Primitive Mode (0)",
+      "playgroundId": "#DS8AA7#15",
+      "replace": "__folder__, Mesh_PrimitiveMode, __page__, 0",
+      "referenceImage": "gltfMeshPrimitiveMode0.png"
     },
     {
-      "title": "GLTF Mesh Primitive Mode",
-      "playgroundId": "#a68vz0#10",
-      "referenceImage": "gltfMeshPrimitiveMode.png"
+      "title": "GLTF Mesh Primitive Mode (1)",
+      "playgroundId": "#DS8AA7#15",
+      "replace": "__folder__, Mesh_PrimitiveMode, __page__, 1",
+      "referenceImage": "gltfMeshPrimitiveMode1.png"
     },
     {
       "title": "GLTF Mesh Primitive Vertex Color",
-      "playgroundId": "#a68vz0#11",
+      "playgroundId": "#DS8AA7#15",
+      "replace": "__folder__, Mesh_PrimitiveVertexColor, __page__, 0",
       "referenceImage": "gltfMeshPrimitiveVertexColor.png"
     },
     {
-      "title": "GLTF Mesh Primitives UV",
-      "playgroundId": "#a68vz0#12",
-      "referenceImage": "gltfMeshPrimitivesUV.png"
+      "title": "GLTF Mesh Primitives",
+      "playgroundId": "#DS8AA7#15",
+      "replace": "__folder__, Mesh_Primitives, __page__, 0",
+      "referenceImage": "gltfMeshPrimitives.png"
+    },
+    {
+      "title": "GLTF Mesh Primitives UV (0)",
+      "playgroundId": "#DS8AA7#15",
+      "replace": "__folder__, Mesh_PrimitivesUV, __page__, 0",
+      "referenceImage": "gltfMeshPrimitivesUV0.png"
+    },
+    {
+      "title": "GLTF Mesh Primitives UV (1)",
+      "playgroundId": "#DS8AA7#15",
+      "replace": "__folder__, Mesh_PrimitivesUV, __page__, 1",
+      "referenceImage": "gltfMeshPrimitivesUV1.png"
+    },
+    {
+      "title": "GLTF Node Attribute (0)",
+      "playgroundId": "#DS8AA7#15",
+      "replace": "__folder__, Node_Attribute, __page__, 0",
+      "referenceImage": "gltfNodeAttribute0.png"
     },
     {
-      "title": "GLTF Primitive Attribute",
-      "playgroundId": "#a68vz0#13",
-      "referenceImage": "gltfPrimitiveAttribute.png"
+      "title": "GLTF Node Attribute (1)",
+      "playgroundId": "#DS8AA7#15",
+      "replace": "__folder__, Node_Attribute, __page__, 1",
+      "referenceImage": "gltfNodeAttribute1.png"
     },
     {
-      "title": "GLTF Metallic Roughness",
-      "playgroundId": "#a68vz0#14",
-      "referenceImage": "gltfMaterialMetallicRoughness.png"
+      "title": "GLTF Node NegativeScale (0)",
+      "playgroundId": "#DS8AA7#15",
+      "replace": "__folder__, Node_NegativeScale, __page__, 0",
+      "referenceImage": "gltfNodeNegativeScale0.png"
     },
     {
-      "title": "GLTF Specular Glossiness",
-      "playgroundId": "#a68vz0#15",
-      "referenceImage": "gltfMaterialSpecularGlossiness.png"
+      "title": "GLTF Node NegativeScale (1)",
+      "playgroundId": "#DS8AA7#15",
+      "replace": "__folder__, Node_NegativeScale, __page__, 1",
+      "referenceImage": "gltfNodeNegativeScale1.png"
     },
     {
-      "title": "GLTF Serializer Texture Transform",
-      "playgroundId": "#S5SWJB#32",
-      "referenceImage": "glTFSerializerTextureTransform.png"
+      "title": "GLTF Texture Sampler (0)",
+      "playgroundId": "#DS8AA7#15",
+      "replace": "__folder__, Texture_Sampler, __page__, 0",
+      "referenceImage": "gltfTextureSampler0.png"
     },
     {
-      "title": "GLTF Texture Sampler",
-      "playgroundId": "#a68vz0#16",
-      "referenceImage": "gltfTextureSampler.png"
+      "title": "GLTF Texture Sampler (1)",
+      "playgroundId": "#DS8AA7#15",
+      "replace": "__folder__, Texture_Sampler, __page__, 1",
+      "referenceImage": "gltfTextureSampler1.png"
     },
     {
       "title": "GLTF Buggy with Draco Mesh Compression",

+ 10 - 0
tests/validation/validation.js

@@ -265,6 +265,16 @@ function runTest(index, done) {
                             code = code.replace(/"textures\//g, "\"" + pgRoot + "/textures/");
                             code = code.replace(/\/scenes\//g, pgRoot + "/scenes/");
                             code = code.replace(/"scenes\//g, "\"" + pgRoot + "/scenes/");
+
+                            if (test.replace) {
+                                var split = test.replace.split(",");
+                                for (var i = 0; i < split.length; i += 2) {
+                                    var source = split[i].trim();
+                                    var destination = split[i + 1].trim();
+                                    code = code.replace(source, destination);
+                                }
+                            }
+
                             currentScene = eval(code + "\r\ncreateScene(engine)");
 
                             if (currentScene.then) {