Forráskód Böngészése

Merge remote-tracking branch 'remotes/origin/master' into maintenance

David Catuhe 6 éve
szülő
commit
b45895fc1a
43 módosított fájl, 990 hozzáadás és 804 törlés
  1. 17 36
      Playground/babylon.d.txt
  2. 5 5
      Playground/scripts/basic scene.js
  3. 25 37
      dist/preview release/babylon.d.ts
  4. 2 2
      dist/preview release/babylon.js
  5. 352 231
      dist/preview release/babylon.max.js
  6. 1 1
      dist/preview release/babylon.max.js.map
  7. 56 75
      dist/preview release/babylon.module.d.ts
  8. 1 1
      dist/preview release/glTF2Interface/package.json
  9. 39 39
      dist/preview release/gui/babylon.gui.js
  10. 1 1
      dist/preview release/gui/babylon.gui.js.map
  11. 2 2
      dist/preview release/gui/package.json
  12. 1 1
      dist/preview release/inspector/babylon.inspector.bundle.js
  13. 12 2
      dist/preview release/inspector/babylon.inspector.bundle.max.js
  14. 1 1
      dist/preview release/inspector/babylon.inspector.bundle.max.js.map
  15. 1 0
      dist/preview release/inspector/babylon.inspector.d.ts
  16. 2 0
      dist/preview release/inspector/babylon.inspector.module.d.ts
  17. 6 6
      dist/preview release/inspector/package.json
  18. 3 3
      dist/preview release/loaders/package.json
  19. 2 2
      dist/preview release/materialsLibrary/package.json
  20. 1 1
      dist/preview release/package.json
  21. 1 1
      dist/preview release/packagesSizeBaseLine.json
  22. 2 2
      dist/preview release/postProcessesLibrary/package.json
  23. 2 2
      dist/preview release/proceduralTexturesLibrary/package.json
  24. 3 3
      dist/preview release/serializers/package.json
  25. 56 75
      dist/preview release/viewer/babylon.module.d.ts
  26. 19 15
      dist/preview release/viewer/babylon.viewer.js
  27. 1 1
      dist/preview release/viewer/babylon.viewer.max.js
  28. 8 8
      dist/preview release/what's new.md
  29. 17 1
      inspector/src/components/actionTabs/tabs/propertyGrids/meshes/meshPropertyGridComponent.tsx
  30. 3 3
      package.json
  31. 2 0
      src/Cameras/Inputs/arcRotateCameraMouseWheelInput.ts
  32. 8 5
      src/Cameras/freeCameraInputsManager.ts
  33. 2 1
      src/Collisions/index.ts
  34. 20 0
      src/Collisions/meshCollisionData.ts
  35. 2 2
      src/Engines/engine.ts
  36. 21 21
      src/Materials/effect.ts
  37. 110 107
      src/Meshes/abstractMesh.ts
  38. 123 103
      src/Meshes/mesh.ts
  39. 1 2
      src/Meshes/transformNode.ts
  40. 4 4
      src/Physics/Plugins/ammoJSPlugin.ts
  41. 3 1
      src/Shaders/pbr.fragment.fx
  42. 50 0
      tests/unit/babylon/src/Mesh/babylon.dictionaryMode.tests.ts
  43. 2 1
      tests/unit/karma.conf.js

+ 17 - 36
Playground/babylon.d.txt

@@ -12205,9 +12205,6 @@ declare module BABYLON {
     export class FreeCameraInputsManager extends CameraInputsManager<FreeCamera> {
         /**
          * @hidden
-         */
keyboardInput: Nullable<FreeCameraKeyboardMoveInput>;
-        /**
-         * @hidden
          */
mouseInput: Nullable<FreeCameraMouseInput>;
         /**
          * Instantiates a new FreeCameraInputsManager.
@@ -12235,6 +12232,10 @@ declare module BABYLON {
          * @returns the current input manager
          */
         addTouch(): FreeCameraInputsManager;
+        /**
+         * Remove all attached input methods from a camera
+         */
+        clear(): void;
     }
 }
 declare module BABYLON {
@@ -20568,10 +20569,7 @@ declare module BABYLON {
          * @returns the default orientation
          * @hidden
          */
private static _GetDefaultSideOrientation(orientation?: number): number;
-        private _onBeforeRenderObservable;
-        private _onBeforeBindObservable;
-        private _onAfterRenderObservable;
-        private _onBeforeDrawObservable;
+        private _internalMeshDataInfo;
         /**
          * An event triggered before rendering the mesh
          */
@@ -20610,13 +20608,11 @@ declare module BABYLON {
          */
         delayLoadingFile: string;
         /** @hidden */
binaryInfo: any;
-        private _LODLevels;
         /**
          * User defined function used to change how LOD level selection is done
          * @see http://doc.babylonjs.com/how_to/how_to_use_lod
          */
         onLODLevelSelection: (distance: number, mesh: Mesh, selectedLevel: Nullable<Mesh>) => void;
-        private _morphTargetManager;
         /**
          * Gets or sets the morph target manager
          * @see http://doc.babylonjs.com/how_to/how_to_use_morphtargets
@@ -20629,17 +20625,11 @@ declare module BABYLON {
         /** @hidden */
instanceDataStorage: _InstanceDataStorage;
         private _effectiveMaterial;
         /** @hidden */
shouldGenerateFlatShading: boolean;
-        private _preActivateId;
         /** @hidden */
originalBuilderSideOrientation: number;
         /**
          * Use this property to change the original side orientation defined at construction time
          */
         overrideMaterialSideOrientation: Nullable<number>;
-        private _areNormalsFrozen;
-        private _sourcePositions;
-        private _sourceNormals;
-        private _source;
-        private meshMap;
         /**
          * Gets the source mesh (the one used to clone this one from)
          */
@@ -20665,7 +20655,7 @@ declare module BABYLON {
          * @returns the string "Mesh".
          */
         getClassName(): string;
-        /** @hidden */
protected readonly _isMesh: boolean;
+        /** @hidden */
protected readonly _isMesh: boolean;
         /**
          * Returns a description of this mesh
          * @param fullDetails define if full details about this mesh must be used
@@ -23824,6 +23814,13 @@ declare module BABYLON {
 }
 declare module BABYLON {
     /**
+     * @hidden
+     */
+    export class _MeshCollisionData {
checkCollisions: boolean;
collisionMask: number;
collisionGroup: number;
collider: Nullable<Collider>;
oldPositionForCollisions: Vector3;
diffPositionForCollisions: Vector3;
onCollideObserver: Nullable<Observer<AbstractMesh>>;
onCollisionPositionChangeObserver: Nullable<Observer<Vector3>>;
+    }
+}
+declare module BABYLON {
+    /**
      * Class used to store all common mesh properties
      */
     export class AbstractMesh extends TransformNode implements IDisposable, ICullable, IGetSetVerticesData {
@@ -23883,7 +23880,7 @@ declare module BABYLON {
         static readonly BILLBOARDMODE_Z: number;
         /** Billboard on all axes */
         static readonly BILLBOARDMODE_ALL: number;
-        private _facetData;
+        private _internalAbstractMeshDataInfo;
         /**
          * The culling strategy to use to check whether the mesh must be rendered or not.
          * This value can be changed at any time and will be used on the next render mesh selection.
@@ -23935,14 +23932,12 @@ declare module BABYLON {
         * An event triggered when this mesh collides with another one
         */
         onCollideObservable: Observable<AbstractMesh>;
-        private _onCollideObserver;
         /** Set a function to call when this mesh collides with another one */
         onCollide: () => void;
         /**
         * An event triggered when the collision's position changes
         */
         onCollisionPositionChangeObservable: Observable<Vector3>;
-        private _onCollisionPositionChangeObserver;
         /** Set a function to call when the collision's position changes */
         onCollisionPositionChange: () => void;
         /**
@@ -23954,7 +23949,6 @@ declare module BABYLON {
          */
         definedFacingForward: boolean;
         /** @hidden */
occlusionQuery: Nullable<WebGLQuery>;
-        private _visibility;
         /** @hidden */
isActive: boolean;
         /** @hidden */
onlyForInstances: boolean;
         /** @hidden */
renderingGroup: Nullable<RenderingGroup>;
@@ -23995,7 +23989,6 @@ declare module BABYLON {
         private _material;
         /** Gets or sets current material */
         material: Nullable<Material>;
-        private _receiveShadows;
         /**
          * Gets or sets a boolean indicating that this mesh can receive realtime shadows
          * @see http://doc.babylonjs.com/babylon101/shadows
@@ -24009,21 +24002,16 @@ declare module BABYLON {
         overlayColor: Color3;
         /** Defines alpha to use when rendering overlay */
         overlayAlpha: number;
-        private _hasVertexAlpha;
         /** Gets or sets a boolean indicating that this mesh contains vertex color data with alpha values */
         hasVertexAlpha: boolean;
-        private _useVertexColors;
         /** Gets or sets a boolean indicating that this mesh needs to use vertex color data to render (if this kind of vertex data is available in the geometry) */
         useVertexColors: boolean;
-        private _computeBonesUsingShaders;
         /**
          * Gets or sets a boolean indicating that bone animations must be computed by the CPU (false by default)
          */
         computeBonesUsingShaders: boolean;
-        private _numBoneInfluencers;
         /** Gets or sets the number of allowed bone influences per vertex (4 by default) */
         numBoneInfluencers: number;
-        private _applyFog;
         /** Gets or sets a boolean indicating that this mesh will allow fog to be rendered on it (true by default) */
         applyFog: boolean;
         /** Gets or sets a boolean indicating that internal octree (if available) can be used to boost submeshes selection (true by default) */
@@ -24032,7 +24020,6 @@ declare module BABYLON {
         useOctreeForPicking: boolean;
         /** Gets or sets a boolean indicating that internal octree (if available) can be used to boost submeshes collision (true by default) */
         useOctreeForCollisions: boolean;
-        private _layerMask;
         /**
          * Gets or sets the current layer mask (default is 0x0FFFFFFF)
          * @see http://doc.babylonjs.com/how_to/layermasks_and_multi-cam_textures
@@ -24051,9 +24038,7 @@ declare module BABYLON {
          * @see http://doc.babylonjs.com/how_to/how_to_use_actions
          */
         actionManager: Nullable<AbstractActionManager>;
-        private _checkCollisions;
-        private _collisionMask;
-        private _collisionGroup;
+        private _meshCollisionData;
         /**
          * Gets or sets the ellipsoid used to impersonate this mesh when using collision engine (default is (0.5, 1, 0.5))
          * @see http://doc.babylonjs.com/babylon101/cameras,_mesh_collisions_and_gravity
@@ -24064,9 +24049,6 @@ declare module BABYLON {
          * @see http://doc.babylonjs.com/babylon101/cameras,_mesh_collisions_and_gravity
          */
         ellipsoidOffset: Vector3;
-        private _collider;
-        private _oldPositionForCollisions;
-        private _diffPositionForCollisions;
         /**
          * Gets or sets a collision mask used to mask collisions (default is -1).
          * A collision between A and B will happen if A.collisionGroup & b.collisionMask !== 0
@@ -24107,7 +24089,6 @@ declare module BABYLON {
             actions: Nullable<any>;
             freezeWorldMatrix: Nullable<boolean>;
         };
-        private _skeleton;
         /** @hidden */
bonesTransformMatrices: Nullable<Float32Array>;
         /**
          * Gets or sets a skeleton to apply skining transformations
@@ -28608,7 +28589,7 @@ declare module BABYLON {
         /**
          * Compiled shader to webGL program.
          * @hidden
-         */
pipelineContext: IPipelineContext;
+         */
pipelineContext: Nullable<IPipelineContext>;
         private _valueCache;
         private static _baseCache;
         /**
@@ -28644,7 +28625,7 @@ declare module BABYLON {
          * The pipeline context for this effect
          * @returns the associated pipeline context
          */
-        getPipelineContext(): IPipelineContext;
+        getPipelineContext(): Nullable<IPipelineContext>;
         /**
          * The set of names of attribute variables for the shader.
          * @returns An array of attribute names.

+ 5 - 5
Playground/scripts/basic scene.js

@@ -13,19 +13,19 @@
     camera.attachControl(canvas, true);
 
     // This creates a light, aiming 0,1,0 - to the sky (non-mesh)
-    var light = new BABYLON.HemisphericLight("light1", new BABYLON.Vector3(0, 1, 0), scene);
+    var light = new BABYLON.HemisphericLight("light", new BABYLON.Vector3(0, 1, 0), scene);
 
     // Default intensity is 1. Let's dim the light a small amount
     light.intensity = 0.7;
 
-    // Our built-in 'sphere' shape. Params: name, subdivs, size, scene
-    var sphere = BABYLON.Mesh.CreateSphere("sphere1", 16, 2, scene);
+    // Our built-in 'sphere' shape.
+    var sphere = BABYLON.MeshBuilder.CreateSphere("sphere", {diameter: 2, segments: 32}, scene);
 
     // Move the sphere upward 1/2 its height
     sphere.position.y = 1;
 
-    // Our built-in 'ground' shape. Params: name, width, depth, subdivs, scene
-    var ground = BABYLON.Mesh.CreateGround("ground1", 6, 6, 2, scene);
+    // Our built-in 'ground' shape.
+    var ground = BABYLON.MeshBuilder.CreateGround("ground", {width: 6, height: 6}, scene);
 
     return scene;
 

+ 25 - 37
dist/preview release/babylon.d.ts

@@ -12376,10 +12376,6 @@ declare module BABYLON {
         /**
          * @hidden
          */
-        _keyboardInput: Nullable<FreeCameraKeyboardMoveInput>;
-        /**
-         * @hidden
-         */
         _mouseInput: Nullable<FreeCameraMouseInput>;
         /**
          * Instantiates a new FreeCameraInputsManager.
@@ -12407,6 +12403,10 @@ declare module BABYLON {
          * @returns the current input manager
          */
         addTouch(): FreeCameraInputsManager;
+        /**
+         * Remove all attached input methods from a camera
+         */
+        clear(): void;
     }
 }
 declare module BABYLON {
@@ -20896,10 +20896,7 @@ declare module BABYLON {
          * @hidden
          */
         static _GetDefaultSideOrientation(orientation?: number): number;
-        private _onBeforeRenderObservable;
-        private _onBeforeBindObservable;
-        private _onAfterRenderObservable;
-        private _onBeforeDrawObservable;
+        private _internalMeshDataInfo;
         /**
          * An event triggered before rendering the mesh
          */
@@ -20939,13 +20936,11 @@ declare module BABYLON {
         delayLoadingFile: string;
         /** @hidden */
         _binaryInfo: any;
-        private _LODLevels;
         /**
          * User defined function used to change how LOD level selection is done
          * @see http://doc.babylonjs.com/how_to/how_to_use_lod
          */
         onLODLevelSelection: (distance: number, mesh: Mesh, selectedLevel: Nullable<Mesh>) => void;
-        private _morphTargetManager;
         /**
          * Gets or sets the morph target manager
          * @see http://doc.babylonjs.com/how_to/how_to_use_morphtargets
@@ -20964,18 +20959,12 @@ declare module BABYLON {
         private _effectiveMaterial;
         /** @hidden */
         _shouldGenerateFlatShading: boolean;
-        private _preActivateId;
         /** @hidden */
         _originalBuilderSideOrientation: number;
         /**
          * Use this property to change the original side orientation defined at construction time
          */
         overrideMaterialSideOrientation: Nullable<number>;
-        private _areNormalsFrozen;
-        private _sourcePositions;
-        private _sourceNormals;
-        private _source;
-        private meshMap;
         /**
          * Gets the source mesh (the one used to clone this one from)
          */
@@ -21002,7 +20991,7 @@ declare module BABYLON {
          */
         getClassName(): string;
         /** @hidden */
-        readonly _isMesh: boolean;
+        readonly _isMesh: boolean;
         /**
          * Returns a description of this mesh
          * @param fullDetails define if full details about this mesh must be used
@@ -24229,6 +24218,21 @@ declare module BABYLON {
 }
 declare module BABYLON {
     /**
+     * @hidden
+     */
+    export class _MeshCollisionData {
+        _checkCollisions: boolean;
+        _collisionMask: number;
+        _collisionGroup: number;
+        _collider: Nullable<Collider>;
+        _oldPositionForCollisions: Vector3;
+        _diffPositionForCollisions: Vector3;
+        _onCollideObserver: Nullable<Observer<AbstractMesh>>;
+        _onCollisionPositionChangeObserver: Nullable<Observer<Vector3>>;
+    }
+}
+declare module BABYLON {
+    /**
      * Class used to store all common mesh properties
      */
     export class AbstractMesh extends TransformNode implements IDisposable, ICullable, IGetSetVerticesData {
@@ -24288,7 +24292,7 @@ declare module BABYLON {
         static readonly BILLBOARDMODE_Z: number;
         /** Billboard on all axes */
         static readonly BILLBOARDMODE_ALL: number;
-        private _facetData;
+        private _internalAbstractMeshDataInfo;
         /**
          * The culling strategy to use to check whether the mesh must be rendered or not.
          * This value can be changed at any time and will be used on the next render mesh selection.
@@ -24341,14 +24345,12 @@ declare module BABYLON {
         * An event triggered when this mesh collides with another one
         */
         onCollideObservable: Observable<AbstractMesh>;
-        private _onCollideObserver;
         /** Set a function to call when this mesh collides with another one */
         onCollide: () => void;
         /**
         * An event triggered when the collision's position changes
         */
         onCollisionPositionChangeObservable: Observable<Vector3>;
-        private _onCollisionPositionChangeObserver;
         /** Set a function to call when the collision's position changes */
         onCollisionPositionChange: () => void;
         /**
@@ -24361,7 +24363,6 @@ declare module BABYLON {
         definedFacingForward: boolean;
         /** @hidden */
         _occlusionQuery: Nullable<WebGLQuery>;
-        private _visibility;
         /** @hidden */
         _isActive: boolean;
         /** @hidden */
@@ -24405,7 +24406,6 @@ declare module BABYLON {
         private _material;
         /** Gets or sets current material */
         material: Nullable<Material>;
-        private _receiveShadows;
         /**
          * Gets or sets a boolean indicating that this mesh can receive realtime shadows
          * @see http://doc.babylonjs.com/babylon101/shadows
@@ -24419,21 +24419,16 @@ declare module BABYLON {
         overlayColor: Color3;
         /** Defines alpha to use when rendering overlay */
         overlayAlpha: number;
-        private _hasVertexAlpha;
         /** Gets or sets a boolean indicating that this mesh contains vertex color data with alpha values */
         hasVertexAlpha: boolean;
-        private _useVertexColors;
         /** Gets or sets a boolean indicating that this mesh needs to use vertex color data to render (if this kind of vertex data is available in the geometry) */
         useVertexColors: boolean;
-        private _computeBonesUsingShaders;
         /**
          * Gets or sets a boolean indicating that bone animations must be computed by the CPU (false by default)
          */
         computeBonesUsingShaders: boolean;
-        private _numBoneInfluencers;
         /** Gets or sets the number of allowed bone influences per vertex (4 by default) */
         numBoneInfluencers: number;
-        private _applyFog;
         /** Gets or sets a boolean indicating that this mesh will allow fog to be rendered on it (true by default) */
         applyFog: boolean;
         /** Gets or sets a boolean indicating that internal octree (if available) can be used to boost submeshes selection (true by default) */
@@ -24442,7 +24437,6 @@ declare module BABYLON {
         useOctreeForPicking: boolean;
         /** Gets or sets a boolean indicating that internal octree (if available) can be used to boost submeshes collision (true by default) */
         useOctreeForCollisions: boolean;
-        private _layerMask;
         /**
          * Gets or sets the current layer mask (default is 0x0FFFFFFF)
          * @see http://doc.babylonjs.com/how_to/layermasks_and_multi-cam_textures
@@ -24461,9 +24455,7 @@ declare module BABYLON {
          * @see http://doc.babylonjs.com/how_to/how_to_use_actions
          */
         actionManager: Nullable<AbstractActionManager>;
-        private _checkCollisions;
-        private _collisionMask;
-        private _collisionGroup;
+        private _meshCollisionData;
         /**
          * Gets or sets the ellipsoid used to impersonate this mesh when using collision engine (default is (0.5, 1, 0.5))
          * @see http://doc.babylonjs.com/babylon101/cameras,_mesh_collisions_and_gravity
@@ -24474,9 +24466,6 @@ declare module BABYLON {
          * @see http://doc.babylonjs.com/babylon101/cameras,_mesh_collisions_and_gravity
          */
         ellipsoidOffset: Vector3;
-        private _collider;
-        private _oldPositionForCollisions;
-        private _diffPositionForCollisions;
         /**
          * Gets or sets a collision mask used to mask collisions (default is -1).
          * A collision between A and B will happen if A.collisionGroup & b.collisionMask !== 0
@@ -24526,7 +24515,6 @@ declare module BABYLON {
             actions: Nullable<any>;
             freezeWorldMatrix: Nullable<boolean>;
         };
-        private _skeleton;
         /** @hidden */
         _bonesTransformMatrices: Nullable<Float32Array>;
         /**
@@ -29146,7 +29134,7 @@ declare module BABYLON {
          * Compiled shader to webGL program.
          * @hidden
          */
-        _pipelineContext: IPipelineContext;
+        _pipelineContext: Nullable<IPipelineContext>;
         private _valueCache;
         private static _baseCache;
         /**
@@ -29182,7 +29170,7 @@ declare module BABYLON {
          * The pipeline context for this effect
          * @returns the associated pipeline context
          */
-        getPipelineContext(): IPipelineContext;
+        getPipelineContext(): Nullable<IPipelineContext>;
         /**
          * The set of names of attribute variables for the shader.
          * @returns An array of attribute names.

A különbségek nem kerülnek megjelenítésre, a fájl túl nagy
+ 2 - 2
dist/preview release/babylon.js


A különbségek nem kerülnek megjelenítésre, a fájl túl nagy
+ 352 - 231
dist/preview release/babylon.max.js


A különbségek nem kerülnek megjelenítésre, a fájl túl nagy
+ 1 - 1
dist/preview release/babylon.max.js.map


+ 56 - 75
dist/preview release/babylon.module.d.ts

@@ -12588,7 +12588,6 @@ declare module "babylonjs/Cameras/Inputs/freeCameraTouchInput" {
 declare module "babylonjs/Cameras/freeCameraInputsManager" {
     import { FreeCamera } from "babylonjs/Cameras/freeCamera";
     import { CameraInputsManager } from "babylonjs/Cameras/cameraInputsManager";
-    import { FreeCameraKeyboardMoveInput } from "babylonjs/Cameras/Inputs/freeCameraKeyboardMoveInput";
     import { FreeCameraMouseInput } from "babylonjs/Cameras/Inputs/freeCameraMouseInput";
     import { Nullable } from "babylonjs/types";
     /**
@@ -12600,10 +12599,6 @@ declare module "babylonjs/Cameras/freeCameraInputsManager" {
         /**
          * @hidden
          */
-        _keyboardInput: Nullable<FreeCameraKeyboardMoveInput>;
-        /**
-         * @hidden
-         */
         _mouseInput: Nullable<FreeCameraMouseInput>;
         /**
          * Instantiates a new FreeCameraInputsManager.
@@ -12631,6 +12626,10 @@ declare module "babylonjs/Cameras/freeCameraInputsManager" {
          * @returns the current input manager
          */
         addTouch(): FreeCameraInputsManager;
+        /**
+         * Remove all attached input methods from a camera
+         */
+        clear(): void;
     }
 }
 declare module "babylonjs/Cameras/freeCamera" {
@@ -21490,10 +21489,7 @@ declare module "babylonjs/Meshes/mesh" {
          * @hidden
          */
         static _GetDefaultSideOrientation(orientation?: number): number;
-        private _onBeforeRenderObservable;
-        private _onBeforeBindObservable;
-        private _onAfterRenderObservable;
-        private _onBeforeDrawObservable;
+        private _internalMeshDataInfo;
         /**
          * An event triggered before rendering the mesh
          */
@@ -21533,13 +21529,11 @@ declare module "babylonjs/Meshes/mesh" {
         delayLoadingFile: string;
         /** @hidden */
         _binaryInfo: any;
-        private _LODLevels;
         /**
          * User defined function used to change how LOD level selection is done
          * @see http://doc.babylonjs.com/how_to/how_to_use_lod
          */
         onLODLevelSelection: (distance: number, mesh: Mesh, selectedLevel: Nullable<Mesh>) => void;
-        private _morphTargetManager;
         /**
          * Gets or sets the morph target manager
          * @see http://doc.babylonjs.com/how_to/how_to_use_morphtargets
@@ -21558,18 +21552,12 @@ declare module "babylonjs/Meshes/mesh" {
         private _effectiveMaterial;
         /** @hidden */
         _shouldGenerateFlatShading: boolean;
-        private _preActivateId;
         /** @hidden */
         _originalBuilderSideOrientation: number;
         /**
          * Use this property to change the original side orientation defined at construction time
          */
         overrideMaterialSideOrientation: Nullable<number>;
-        private _areNormalsFrozen;
-        private _sourcePositions;
-        private _sourceNormals;
-        private _source;
-        private meshMap;
         /**
          * Gets the source mesh (the one used to clone this one from)
          */
@@ -21596,7 +21584,7 @@ declare module "babylonjs/Meshes/mesh" {
          */
         getClassName(): string;
         /** @hidden */
-        readonly _isMesh: boolean;
+        readonly _isMesh: boolean;
         /**
          * Returns a description of this mesh
          * @param fullDetails define if full details about this mesh must be used
@@ -24879,6 +24867,26 @@ declare module "babylonjs/Particles/solidParticle" {
         sqDistance: number;
     }
 }
+declare module "babylonjs/Collisions/meshCollisionData" {
+    import { Collider } from "babylonjs/Collisions/collider";
+    import { Vector3 } from "babylonjs/Maths/math";
+    import { Nullable } from "babylonjs/types";
+    import { Observer } from "babylonjs/Misc/observable";
+    import { AbstractMesh } from "babylonjs/Meshes/abstractMesh";
+    /**
+     * @hidden
+     */
+    export class _MeshCollisionData {
+        _checkCollisions: boolean;
+        _collisionMask: number;
+        _collisionGroup: number;
+        _collider: Nullable<Collider>;
+        _oldPositionForCollisions: Vector3;
+        _diffPositionForCollisions: Vector3;
+        _onCollideObserver: Nullable<Observer<AbstractMesh>>;
+        _onCollisionPositionChangeObserver: Nullable<Observer<Vector3>>;
+    }
+}
 declare module "babylonjs/Meshes/abstractMesh" {
     import { Observable } from "babylonjs/Misc/observable";
     import { Nullable, FloatArray, IndicesArray, DeepImmutable } from "babylonjs/types";
@@ -24961,7 +24969,7 @@ declare module "babylonjs/Meshes/abstractMesh" {
         static readonly BILLBOARDMODE_Z: number;
         /** Billboard on all axes */
         static readonly BILLBOARDMODE_ALL: number;
-        private _facetData;
+        private _internalAbstractMeshDataInfo;
         /**
          * The culling strategy to use to check whether the mesh must be rendered or not.
          * This value can be changed at any time and will be used on the next render mesh selection.
@@ -25014,14 +25022,12 @@ declare module "babylonjs/Meshes/abstractMesh" {
         * An event triggered when this mesh collides with another one
         */
         onCollideObservable: Observable<AbstractMesh>;
-        private _onCollideObserver;
         /** Set a function to call when this mesh collides with another one */
         onCollide: () => void;
         /**
         * An event triggered when the collision's position changes
         */
         onCollisionPositionChangeObservable: Observable<Vector3>;
-        private _onCollisionPositionChangeObserver;
         /** Set a function to call when the collision's position changes */
         onCollisionPositionChange: () => void;
         /**
@@ -25034,7 +25040,6 @@ declare module "babylonjs/Meshes/abstractMesh" {
         definedFacingForward: boolean;
         /** @hidden */
         _occlusionQuery: Nullable<WebGLQuery>;
-        private _visibility;
         /** @hidden */
         _isActive: boolean;
         /** @hidden */
@@ -25078,7 +25083,6 @@ declare module "babylonjs/Meshes/abstractMesh" {
         private _material;
         /** Gets or sets current material */
         material: Nullable<Material>;
-        private _receiveShadows;
         /**
          * Gets or sets a boolean indicating that this mesh can receive realtime shadows
          * @see http://doc.babylonjs.com/babylon101/shadows
@@ -25092,21 +25096,16 @@ declare module "babylonjs/Meshes/abstractMesh" {
         overlayColor: Color3;
         /** Defines alpha to use when rendering overlay */
         overlayAlpha: number;
-        private _hasVertexAlpha;
         /** Gets or sets a boolean indicating that this mesh contains vertex color data with alpha values */
         hasVertexAlpha: boolean;
-        private _useVertexColors;
         /** Gets or sets a boolean indicating that this mesh needs to use vertex color data to render (if this kind of vertex data is available in the geometry) */
         useVertexColors: boolean;
-        private _computeBonesUsingShaders;
         /**
          * Gets or sets a boolean indicating that bone animations must be computed by the CPU (false by default)
          */
         computeBonesUsingShaders: boolean;
-        private _numBoneInfluencers;
         /** Gets or sets the number of allowed bone influences per vertex (4 by default) */
         numBoneInfluencers: number;
-        private _applyFog;
         /** Gets or sets a boolean indicating that this mesh will allow fog to be rendered on it (true by default) */
         applyFog: boolean;
         /** Gets or sets a boolean indicating that internal octree (if available) can be used to boost submeshes selection (true by default) */
@@ -25115,7 +25114,6 @@ declare module "babylonjs/Meshes/abstractMesh" {
         useOctreeForPicking: boolean;
         /** Gets or sets a boolean indicating that internal octree (if available) can be used to boost submeshes collision (true by default) */
         useOctreeForCollisions: boolean;
-        private _layerMask;
         /**
          * Gets or sets the current layer mask (default is 0x0FFFFFFF)
          * @see http://doc.babylonjs.com/how_to/layermasks_and_multi-cam_textures
@@ -25134,9 +25132,7 @@ declare module "babylonjs/Meshes/abstractMesh" {
          * @see http://doc.babylonjs.com/how_to/how_to_use_actions
          */
         actionManager: Nullable<AbstractActionManager>;
-        private _checkCollisions;
-        private _collisionMask;
-        private _collisionGroup;
+        private _meshCollisionData;
         /**
          * Gets or sets the ellipsoid used to impersonate this mesh when using collision engine (default is (0.5, 1, 0.5))
          * @see http://doc.babylonjs.com/babylon101/cameras,_mesh_collisions_and_gravity
@@ -25147,9 +25143,6 @@ declare module "babylonjs/Meshes/abstractMesh" {
          * @see http://doc.babylonjs.com/babylon101/cameras,_mesh_collisions_and_gravity
          */
         ellipsoidOffset: Vector3;
-        private _collider;
-        private _oldPositionForCollisions;
-        private _diffPositionForCollisions;
         /**
          * Gets or sets a collision mask used to mask collisions (default is -1).
          * A collision between A and B will happen if A.collisionGroup & b.collisionMask !== 0
@@ -25199,7 +25192,6 @@ declare module "babylonjs/Meshes/abstractMesh" {
             actions: Nullable<any>;
             freezeWorldMatrix: Nullable<boolean>;
         };
-        private _skeleton;
         /** @hidden */
         _bonesTransformMatrices: Nullable<Float32Array>;
         /**
@@ -29916,7 +29908,7 @@ declare module "babylonjs/Materials/effect" {
          * Compiled shader to webGL program.
          * @hidden
          */
-        _pipelineContext: IPipelineContext;
+        _pipelineContext: Nullable<IPipelineContext>;
         private _valueCache;
         private static _baseCache;
         /**
@@ -29952,7 +29944,7 @@ declare module "babylonjs/Materials/effect" {
          * The pipeline context for this effect
          * @returns the associated pipeline context
          */
-        getPipelineContext(): IPipelineContext;
+        getPipelineContext(): Nullable<IPipelineContext>;
         /**
          * The set of names of attribute variables for the shader.
          * @returns An array of attribute names.
@@ -41731,6 +41723,7 @@ declare module "babylonjs/Collisions/index" {
     export * from "babylonjs/Collisions/collisionCoordinator";
     export * from "babylonjs/Collisions/pickingInfo";
     export * from "babylonjs/Collisions/intersectionInfo";
+    export * from "babylonjs/Collisions/meshCollisionData";
 }
 declare module "babylonjs/Culling/Octrees/octreeBlock" {
     import { SmartArrayNoDuplicate } from "babylonjs/Misc/smartArray";
@@ -72378,10 +72371,6 @@ declare module BABYLON {
         /**
          * @hidden
          */
-        _keyboardInput: Nullable<FreeCameraKeyboardMoveInput>;
-        /**
-         * @hidden
-         */
         _mouseInput: Nullable<FreeCameraMouseInput>;
         /**
          * Instantiates a new FreeCameraInputsManager.
@@ -72409,6 +72398,10 @@ declare module BABYLON {
          * @returns the current input manager
          */
         addTouch(): FreeCameraInputsManager;
+        /**
+         * Remove all attached input methods from a camera
+         */
+        clear(): void;
     }
 }
 declare module BABYLON {
@@ -80898,10 +80891,7 @@ declare module BABYLON {
          * @hidden
          */
         static _GetDefaultSideOrientation(orientation?: number): number;
-        private _onBeforeRenderObservable;
-        private _onBeforeBindObservable;
-        private _onAfterRenderObservable;
-        private _onBeforeDrawObservable;
+        private _internalMeshDataInfo;
         /**
          * An event triggered before rendering the mesh
          */
@@ -80941,13 +80931,11 @@ declare module BABYLON {
         delayLoadingFile: string;
         /** @hidden */
         _binaryInfo: any;
-        private _LODLevels;
         /**
          * User defined function used to change how LOD level selection is done
          * @see http://doc.babylonjs.com/how_to/how_to_use_lod
          */
         onLODLevelSelection: (distance: number, mesh: Mesh, selectedLevel: Nullable<Mesh>) => void;
-        private _morphTargetManager;
         /**
          * Gets or sets the morph target manager
          * @see http://doc.babylonjs.com/how_to/how_to_use_morphtargets
@@ -80966,18 +80954,12 @@ declare module BABYLON {
         private _effectiveMaterial;
         /** @hidden */
         _shouldGenerateFlatShading: boolean;
-        private _preActivateId;
         /** @hidden */
         _originalBuilderSideOrientation: number;
         /**
          * Use this property to change the original side orientation defined at construction time
          */
         overrideMaterialSideOrientation: Nullable<number>;
-        private _areNormalsFrozen;
-        private _sourcePositions;
-        private _sourceNormals;
-        private _source;
-        private meshMap;
         /**
          * Gets the source mesh (the one used to clone this one from)
          */
@@ -81004,7 +80986,7 @@ declare module BABYLON {
          */
         getClassName(): string;
         /** @hidden */
-        readonly _isMesh: boolean;
+        readonly _isMesh: boolean;
         /**
          * Returns a description of this mesh
          * @param fullDetails define if full details about this mesh must be used
@@ -84231,6 +84213,21 @@ declare module BABYLON {
 }
 declare module BABYLON {
     /**
+     * @hidden
+     */
+    export class _MeshCollisionData {
+        _checkCollisions: boolean;
+        _collisionMask: number;
+        _collisionGroup: number;
+        _collider: Nullable<Collider>;
+        _oldPositionForCollisions: Vector3;
+        _diffPositionForCollisions: Vector3;
+        _onCollideObserver: Nullable<Observer<AbstractMesh>>;
+        _onCollisionPositionChangeObserver: Nullable<Observer<Vector3>>;
+    }
+}
+declare module BABYLON {
+    /**
      * Class used to store all common mesh properties
      */
     export class AbstractMesh extends TransformNode implements IDisposable, ICullable, IGetSetVerticesData {
@@ -84290,7 +84287,7 @@ declare module BABYLON {
         static readonly BILLBOARDMODE_Z: number;
         /** Billboard on all axes */
         static readonly BILLBOARDMODE_ALL: number;
-        private _facetData;
+        private _internalAbstractMeshDataInfo;
         /**
          * The culling strategy to use to check whether the mesh must be rendered or not.
          * This value can be changed at any time and will be used on the next render mesh selection.
@@ -84343,14 +84340,12 @@ declare module BABYLON {
         * An event triggered when this mesh collides with another one
         */
         onCollideObservable: Observable<AbstractMesh>;
-        private _onCollideObserver;
         /** Set a function to call when this mesh collides with another one */
         onCollide: () => void;
         /**
         * An event triggered when the collision's position changes
         */
         onCollisionPositionChangeObservable: Observable<Vector3>;
-        private _onCollisionPositionChangeObserver;
         /** Set a function to call when the collision's position changes */
         onCollisionPositionChange: () => void;
         /**
@@ -84363,7 +84358,6 @@ declare module BABYLON {
         definedFacingForward: boolean;
         /** @hidden */
         _occlusionQuery: Nullable<WebGLQuery>;
-        private _visibility;
         /** @hidden */
         _isActive: boolean;
         /** @hidden */
@@ -84407,7 +84401,6 @@ declare module BABYLON {
         private _material;
         /** Gets or sets current material */
         material: Nullable<Material>;
-        private _receiveShadows;
         /**
          * Gets or sets a boolean indicating that this mesh can receive realtime shadows
          * @see http://doc.babylonjs.com/babylon101/shadows
@@ -84421,21 +84414,16 @@ declare module BABYLON {
         overlayColor: Color3;
         /** Defines alpha to use when rendering overlay */
         overlayAlpha: number;
-        private _hasVertexAlpha;
         /** Gets or sets a boolean indicating that this mesh contains vertex color data with alpha values */
         hasVertexAlpha: boolean;
-        private _useVertexColors;
         /** Gets or sets a boolean indicating that this mesh needs to use vertex color data to render (if this kind of vertex data is available in the geometry) */
         useVertexColors: boolean;
-        private _computeBonesUsingShaders;
         /**
          * Gets or sets a boolean indicating that bone animations must be computed by the CPU (false by default)
          */
         computeBonesUsingShaders: boolean;
-        private _numBoneInfluencers;
         /** Gets or sets the number of allowed bone influences per vertex (4 by default) */
         numBoneInfluencers: number;
-        private _applyFog;
         /** Gets or sets a boolean indicating that this mesh will allow fog to be rendered on it (true by default) */
         applyFog: boolean;
         /** Gets or sets a boolean indicating that internal octree (if available) can be used to boost submeshes selection (true by default) */
@@ -84444,7 +84432,6 @@ declare module BABYLON {
         useOctreeForPicking: boolean;
         /** Gets or sets a boolean indicating that internal octree (if available) can be used to boost submeshes collision (true by default) */
         useOctreeForCollisions: boolean;
-        private _layerMask;
         /**
          * Gets or sets the current layer mask (default is 0x0FFFFFFF)
          * @see http://doc.babylonjs.com/how_to/layermasks_and_multi-cam_textures
@@ -84463,9 +84450,7 @@ declare module BABYLON {
          * @see http://doc.babylonjs.com/how_to/how_to_use_actions
          */
         actionManager: Nullable<AbstractActionManager>;
-        private _checkCollisions;
-        private _collisionMask;
-        private _collisionGroup;
+        private _meshCollisionData;
         /**
          * Gets or sets the ellipsoid used to impersonate this mesh when using collision engine (default is (0.5, 1, 0.5))
          * @see http://doc.babylonjs.com/babylon101/cameras,_mesh_collisions_and_gravity
@@ -84476,9 +84461,6 @@ declare module BABYLON {
          * @see http://doc.babylonjs.com/babylon101/cameras,_mesh_collisions_and_gravity
          */
         ellipsoidOffset: Vector3;
-        private _collider;
-        private _oldPositionForCollisions;
-        private _diffPositionForCollisions;
         /**
          * Gets or sets a collision mask used to mask collisions (default is -1).
          * A collision between A and B will happen if A.collisionGroup & b.collisionMask !== 0
@@ -84528,7 +84510,6 @@ declare module BABYLON {
             actions: Nullable<any>;
             freezeWorldMatrix: Nullable<boolean>;
         };
-        private _skeleton;
         /** @hidden */
         _bonesTransformMatrices: Nullable<Float32Array>;
         /**
@@ -89148,7 +89129,7 @@ declare module BABYLON {
          * Compiled shader to webGL program.
          * @hidden
          */
-        _pipelineContext: IPipelineContext;
+        _pipelineContext: Nullable<IPipelineContext>;
         private _valueCache;
         private static _baseCache;
         /**
@@ -89184,7 +89165,7 @@ declare module BABYLON {
          * The pipeline context for this effect
          * @returns the associated pipeline context
          */
-        getPipelineContext(): IPipelineContext;
+        getPipelineContext(): Nullable<IPipelineContext>;
         /**
          * The set of names of attribute variables for the shader.
          * @returns An array of attribute names.

+ 1 - 1
dist/preview release/glTF2Interface/package.json

@@ -1,7 +1,7 @@
 {
     "name": "babylonjs-gltf2interface",
     "description": "A typescript declaration of babylon's gltf2 inteface.",
-    "version": "4.0.0-rc.0",
+    "version": "4.0.0-rc.1",
     "repository": {
         "type": "git",
         "url": "https://github.com/BabylonJS/Babylon.js.git"

+ 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");
@@ -3253,7 +3253,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");
@@ -3658,7 +3658,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");
@@ -6218,7 +6218,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");
 
@@ -6993,7 +6993,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");
@@ -8002,7 +8002,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");
@@ -8270,7 +8270,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");
@@ -8537,7 +8537,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");
@@ -8882,7 +8882,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");
@@ -9973,7 +9973,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");
@@ -10874,7 +10874,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");
@@ -11132,7 +11132,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");
@@ -11572,7 +11572,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");
@@ -11953,7 +11953,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__);
 
 
@@ -12177,7 +12177,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__);
 
 
@@ -12310,7 +12310,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");
 
@@ -12453,7 +12453,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");
 
@@ -12760,7 +12760,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");
 
@@ -12803,7 +12803,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");
@@ -12980,7 +12980,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");
 
@@ -13137,7 +13137,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");
 
@@ -13543,7 +13543,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");
@@ -13628,7 +13628,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");
@@ -14104,7 +14104,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");
@@ -14159,7 +14159,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");
@@ -14286,7 +14286,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");
@@ -14371,7 +14371,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");
 
@@ -14496,7 +14496,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");
 
@@ -14687,7 +14687,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");
 
@@ -14954,7 +14954,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");
@@ -15276,7 +15276,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';
@@ -15298,7 +15298,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';
@@ -15321,7 +15321,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__);
 
 
@@ -15615,14 +15615,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__;
 
 /***/ })
 

A különbségek nem kerülnek megjelenítésre, a fájl túl nagy
+ 1 - 1
dist/preview release/gui/babylon.gui.js.map


+ 2 - 2
dist/preview release/gui/package.json

@@ -4,7 +4,7 @@
     },
     "name": "babylonjs-gui",
     "description": "The Babylon.js GUI library is an extension you can use to generate interactive user interface. It is build on top of the DynamicTexture.",
-    "version": "4.0.0-rc.0",
+    "version": "4.0.0-rc.1",
     "repository": {
         "type": "git",
         "url": "https://github.com/BabylonJS/Babylon.js.git"
@@ -28,7 +28,7 @@
     ],
     "license": "Apache-2.0",
     "dependencies": {
-        "babylonjs": "4.0.0-rc.0"
+        "babylonjs": "4.0.0-rc.1"
     },
     "engines": {
         "node": "*"

A különbségek nem kerülnek megjelenítésre, a fájl túl nagy
+ 1 - 1
dist/preview release/inspector/babylon.inspector.bundle.js


+ 12 - 2
dist/preview release/inspector/babylon.inspector.bundle.max.js

@@ -38086,6 +38086,13 @@ var MeshPropertyGridComponent = /** @class */ (function (_super) {
         var mesh = this.props.mesh;
         this.props.onSelectionChangedObservable.notifyObservers(mesh.material);
     };
+    MeshPropertyGridComponent.prototype.onSourceMeshLink = function () {
+        if (!this.props.onSelectionChangedObservable) {
+            return;
+        }
+        var instanceMesh = this.props.mesh;
+        this.props.onSelectionChangedObservable.notifyObservers(instanceMesh.sourceMesh);
+    };
     MeshPropertyGridComponent.prototype.convertPhysicsTypeToString = function () {
         var mesh = this.props.mesh;
         switch (mesh.physicsImpostor.type) {
@@ -38134,7 +38141,9 @@ var MeshPropertyGridComponent = /** @class */ (function (_super) {
                 react__WEBPACK_IMPORTED_MODULE_1__["createElement"](_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_5__["CheckBoxLineComponent"], { label: "IsEnabled", isSelected: function () { return mesh.isEnabled(); }, onSelect: function (value) { return mesh.setEnabled(value); } }),
                 react__WEBPACK_IMPORTED_MODULE_1__["createElement"](_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_5__["CheckBoxLineComponent"], { label: "IsPickable", target: mesh, propertyName: "isPickable", onPropertyChangedObservable: this.props.onPropertyChangedObservable }),
                 mesh.material &&
-                    react__WEBPACK_IMPORTED_MODULE_1__["createElement"](_lines_textLineComponent__WEBPACK_IMPORTED_MODULE_4__["TextLineComponent"], { label: "Material", value: mesh.material.name, onLink: function () { return _this.onMaterialLink(); } })),
+                    react__WEBPACK_IMPORTED_MODULE_1__["createElement"](_lines_textLineComponent__WEBPACK_IMPORTED_MODULE_4__["TextLineComponent"], { label: "Material", value: mesh.material.name, onLink: function () { return _this.onMaterialLink(); } }),
+                mesh.isAnInstance &&
+                    react__WEBPACK_IMPORTED_MODULE_1__["createElement"](_lines_textLineComponent__WEBPACK_IMPORTED_MODULE_4__["TextLineComponent"], { label: "Source", value: mesh.sourceMesh.name, onLink: function () { return _this.onSourceMeshLink(); } })),
             react__WEBPACK_IMPORTED_MODULE_1__["createElement"](_lineContainerComponent__WEBPACK_IMPORTED_MODULE_3__["LineContainerComponent"], { globalState: this.props.globalState, title: "TRANSFORMS" },
                 react__WEBPACK_IMPORTED_MODULE_1__["createElement"](_lines_vector3LineComponent__WEBPACK_IMPORTED_MODULE_6__["Vector3LineComponent"], { label: "Position", target: mesh, propertyName: "position", onPropertyChangedObservable: this.props.onPropertyChangedObservable }),
                 !mesh.rotationQuaternion &&
@@ -38143,7 +38152,8 @@ var MeshPropertyGridComponent = /** @class */ (function (_super) {
                     react__WEBPACK_IMPORTED_MODULE_1__["createElement"](_lines_quaternionLineComponent__WEBPACK_IMPORTED_MODULE_8__["QuaternionLineComponent"], { label: "Rotation", target: mesh, propertyName: "rotationQuaternion", onPropertyChangedObservable: this.props.onPropertyChangedObservable }),
                 react__WEBPACK_IMPORTED_MODULE_1__["createElement"](_lines_vector3LineComponent__WEBPACK_IMPORTED_MODULE_6__["Vector3LineComponent"], { label: "Scaling", target: mesh, propertyName: "scaling", onPropertyChangedObservable: this.props.onPropertyChangedObservable })),
             react__WEBPACK_IMPORTED_MODULE_1__["createElement"](_lineContainerComponent__WEBPACK_IMPORTED_MODULE_3__["LineContainerComponent"], { globalState: this.props.globalState, title: "DISPLAY", closed: true },
-                react__WEBPACK_IMPORTED_MODULE_1__["createElement"](_lines_sliderLineComponent__WEBPACK_IMPORTED_MODULE_7__["SliderLineComponent"], { label: "Visibility", target: mesh, propertyName: "visibility", minimum: 0, maximum: 1, step: 0.01, onPropertyChangedObservable: this.props.onPropertyChangedObservable }),
+                !mesh.isAnInstance &&
+                    react__WEBPACK_IMPORTED_MODULE_1__["createElement"](_lines_sliderLineComponent__WEBPACK_IMPORTED_MODULE_7__["SliderLineComponent"], { label: "Visibility", target: mesh, propertyName: "visibility", minimum: 0, maximum: 1, step: 0.01, onPropertyChangedObservable: this.props.onPropertyChangedObservable }),
                 react__WEBPACK_IMPORTED_MODULE_1__["createElement"](_lines_floatLineComponent__WEBPACK_IMPORTED_MODULE_9__["FloatLineComponent"], { lockObject: this.props.lockObject, label: "Alpha index", target: mesh, propertyName: "alphaIndex", onPropertyChangedObservable: this.props.onPropertyChangedObservable }),
                 react__WEBPACK_IMPORTED_MODULE_1__["createElement"](_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_5__["CheckBoxLineComponent"], { label: "Receive shadows", target: mesh, propertyName: "receiveShadows", onPropertyChangedObservable: this.props.onPropertyChangedObservable }),
                 mesh.isVerticesDataPresent(babylonjs_Misc_tools__WEBPACK_IMPORTED_MODULE_2__["VertexBuffer"].ColorKind) &&

A különbségek nem kerülnek megjelenítésre, a fájl túl nagy
+ 1 - 1
dist/preview release/inspector/babylon.inspector.bundle.max.js.map


+ 1 - 0
dist/preview release/inspector/babylon.inspector.d.ts

@@ -716,6 +716,7 @@ declare module INSPECTOR {
         renderNormalVectors(): void;
         displayNormals(): void;
         onMaterialLink(): void;
+        onSourceMeshLink(): void;
         convertPhysicsTypeToString(): string;
         render(): JSX.Element;
     }

+ 2 - 0
dist/preview release/inspector/babylon.inspector.module.d.ts

@@ -882,6 +882,7 @@ declare module "babylonjs-inspector/components/actionTabs/tabs/propertyGrids/mes
         renderNormalVectors(): void;
         displayNormals(): void;
         onMaterialLink(): void;
+        onSourceMeshLink(): void;
         convertPhysicsTypeToString(): string;
         render(): JSX.Element;
     }
@@ -2906,6 +2907,7 @@ declare module INSPECTOR {
         renderNormalVectors(): void;
         displayNormals(): void;
         onMaterialLink(): void;
+        onSourceMeshLink(): void;
         convertPhysicsTypeToString(): string;
         render(): JSX.Element;
     }

+ 6 - 6
dist/preview release/inspector/package.json

@@ -4,7 +4,7 @@
     },
     "name": "babylonjs-inspector",
     "description": "The Babylon.js inspector.",
-    "version": "4.0.0-rc.0",
+    "version": "4.0.0-rc.1",
     "repository": {
         "type": "git",
         "url": "https://github.com/BabylonJS/Babylon.js.git"
@@ -31,11 +31,11 @@
     "dependencies": {
         "@types/react": "~16.7.3",
         "@types/react-dom": "~16.0.9",
-        "babylonjs": "4.0.0-rc.0",
-        "babylonjs-gui": "4.0.0-rc.0",
-        "babylonjs-loaders": "4.0.0-rc.0",
-        "babylonjs-serializers": "4.0.0-rc.0",
-        "babylonjs-gltf2interface": "4.0.0-rc.0"
+        "babylonjs": "4.0.0-rc.1",
+        "babylonjs-gui": "4.0.0-rc.1",
+        "babylonjs-loaders": "4.0.0-rc.1",
+        "babylonjs-serializers": "4.0.0-rc.1",
+        "babylonjs-gltf2interface": "4.0.0-rc.1"
     },
     "engines": {
         "node": "*"

+ 3 - 3
dist/preview release/loaders/package.json

@@ -4,7 +4,7 @@
     },
     "name": "babylonjs-loaders",
     "description": "The Babylon.js file loaders library is an extension you can use to load different 3D file types into a Babylon scene.",
-    "version": "4.0.0-rc.0",
+    "version": "4.0.0-rc.1",
     "repository": {
         "type": "git",
         "url": "https://github.com/BabylonJS/Babylon.js.git"
@@ -28,8 +28,8 @@
     ],
     "license": "Apache-2.0",
     "dependencies": {
-        "babylonjs-gltf2interface": "4.0.0-rc.0",
-        "babylonjs": "4.0.0-rc.0"
+        "babylonjs-gltf2interface": "4.0.0-rc.1",
+        "babylonjs": "4.0.0-rc.1"
     },
     "engines": {
         "node": "*"

+ 2 - 2
dist/preview release/materialsLibrary/package.json

@@ -4,7 +4,7 @@
     },
     "name": "babylonjs-materials",
     "description": "The Babylon.js materials library is a collection of advanced materials to be used in a Babylon.js scene.",
-    "version": "4.0.0-rc.0",
+    "version": "4.0.0-rc.1",
     "repository": {
         "type": "git",
         "url": "https://github.com/BabylonJS/Babylon.js.git"
@@ -28,7 +28,7 @@
     ],
     "license": "Apache-2.0",
     "dependencies": {
-        "babylonjs": "4.0.0-rc.0"
+        "babylonjs": "4.0.0-rc.1"
     },
     "engines": {
         "node": "*"

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

@@ -9,7 +9,7 @@
     ],
     "name": "babylonjs",
     "description": "Babylon.js is a JavaScript 3D engine based on webgl.",
-    "version": "4.0.0-rc.0",
+    "version": "4.0.0-rc.1",
     "repository": {
         "type": "git",
         "url": "https://github.com/BabylonJS/Babylon.js.git"

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

@@ -1 +1 @@
-{"engineOnly":289483,"sceneOnly":496691,"minGridMaterial":621883,"minStandardMaterial":746642}
+{"engineOnly":289856,"sceneOnly":499041,"minGridMaterial":625526,"minStandardMaterial":750285}

+ 2 - 2
dist/preview release/postProcessesLibrary/package.json

@@ -4,7 +4,7 @@
     },
     "name": "babylonjs-post-process",
     "description": "The Babylon.js materials library is a collection of advanced materials to be used in a Babylon.js scene.",
-    "version": "4.0.0-rc.0",
+    "version": "4.0.0-rc.1",
     "repository": {
         "type": "git",
         "url": "https://github.com/BabylonJS/Babylon.js.git"
@@ -28,7 +28,7 @@
     ],
     "license": "Apache-2.0",
     "dependencies": {
-        "babylonjs": "4.0.0-rc.0"
+        "babylonjs": "4.0.0-rc.1"
     },
     "engines": {
         "node": "*"

+ 2 - 2
dist/preview release/proceduralTexturesLibrary/package.json

@@ -4,7 +4,7 @@
     },
     "name": "babylonjs-procedural-textures",
     "description": "The Babylon.js materials library is a collection of advanced materials to be used in a Babylon.js scene.",
-    "version": "4.0.0-rc.0",
+    "version": "4.0.0-rc.1",
     "repository": {
         "type": "git",
         "url": "https://github.com/BabylonJS/Babylon.js.git"
@@ -28,7 +28,7 @@
     ],
     "license": "Apache-2.0",
     "dependencies": {
-        "babylonjs": "4.0.0-rc.0"
+        "babylonjs": "4.0.0-rc.1"
     },
     "engines": {
         "node": "*"

+ 3 - 3
dist/preview release/serializers/package.json

@@ -4,7 +4,7 @@
     },
     "name": "babylonjs-serializers",
     "description": "The Babylon.js serializers library is an extension you can use to serialize Babylon scenes.",
-    "version": "4.0.0-rc.0",
+    "version": "4.0.0-rc.1",
     "repository": {
         "type": "git",
         "url": "https://github.com/BabylonJS/Babylon.js.git"
@@ -28,8 +28,8 @@
     ],
     "license": "Apache-2.0",
     "dependencies": {
-        "babylonjs": "4.0.0-rc.0",
-        "babylonjs-gltf2interface": "4.0.0-rc.0"
+        "babylonjs": "4.0.0-rc.1",
+        "babylonjs-gltf2interface": "4.0.0-rc.1"
     },
     "engines": {
         "node": "*"

+ 56 - 75
dist/preview release/viewer/babylon.module.d.ts

@@ -12588,7 +12588,6 @@ declare module "babylonjs/Cameras/Inputs/freeCameraTouchInput" {
 declare module "babylonjs/Cameras/freeCameraInputsManager" {
     import { FreeCamera } from "babylonjs/Cameras/freeCamera";
     import { CameraInputsManager } from "babylonjs/Cameras/cameraInputsManager";
-    import { FreeCameraKeyboardMoveInput } from "babylonjs/Cameras/Inputs/freeCameraKeyboardMoveInput";
     import { FreeCameraMouseInput } from "babylonjs/Cameras/Inputs/freeCameraMouseInput";
     import { Nullable } from "babylonjs/types";
     /**
@@ -12600,10 +12599,6 @@ declare module "babylonjs/Cameras/freeCameraInputsManager" {
         /**
          * @hidden
          */
-        _keyboardInput: Nullable<FreeCameraKeyboardMoveInput>;
-        /**
-         * @hidden
-         */
         _mouseInput: Nullable<FreeCameraMouseInput>;
         /**
          * Instantiates a new FreeCameraInputsManager.
@@ -12631,6 +12626,10 @@ declare module "babylonjs/Cameras/freeCameraInputsManager" {
          * @returns the current input manager
          */
         addTouch(): FreeCameraInputsManager;
+        /**
+         * Remove all attached input methods from a camera
+         */
+        clear(): void;
     }
 }
 declare module "babylonjs/Cameras/freeCamera" {
@@ -21490,10 +21489,7 @@ declare module "babylonjs/Meshes/mesh" {
          * @hidden
          */
         static _GetDefaultSideOrientation(orientation?: number): number;
-        private _onBeforeRenderObservable;
-        private _onBeforeBindObservable;
-        private _onAfterRenderObservable;
-        private _onBeforeDrawObservable;
+        private _internalMeshDataInfo;
         /**
          * An event triggered before rendering the mesh
          */
@@ -21533,13 +21529,11 @@ declare module "babylonjs/Meshes/mesh" {
         delayLoadingFile: string;
         /** @hidden */
         _binaryInfo: any;
-        private _LODLevels;
         /**
          * User defined function used to change how LOD level selection is done
          * @see http://doc.babylonjs.com/how_to/how_to_use_lod
          */
         onLODLevelSelection: (distance: number, mesh: Mesh, selectedLevel: Nullable<Mesh>) => void;
-        private _morphTargetManager;
         /**
          * Gets or sets the morph target manager
          * @see http://doc.babylonjs.com/how_to/how_to_use_morphtargets
@@ -21558,18 +21552,12 @@ declare module "babylonjs/Meshes/mesh" {
         private _effectiveMaterial;
         /** @hidden */
         _shouldGenerateFlatShading: boolean;
-        private _preActivateId;
         /** @hidden */
         _originalBuilderSideOrientation: number;
         /**
          * Use this property to change the original side orientation defined at construction time
          */
         overrideMaterialSideOrientation: Nullable<number>;
-        private _areNormalsFrozen;
-        private _sourcePositions;
-        private _sourceNormals;
-        private _source;
-        private meshMap;
         /**
          * Gets the source mesh (the one used to clone this one from)
          */
@@ -21596,7 +21584,7 @@ declare module "babylonjs/Meshes/mesh" {
          */
         getClassName(): string;
         /** @hidden */
-        readonly _isMesh: boolean;
+        readonly _isMesh: boolean;
         /**
          * Returns a description of this mesh
          * @param fullDetails define if full details about this mesh must be used
@@ -24879,6 +24867,26 @@ declare module "babylonjs/Particles/solidParticle" {
         sqDistance: number;
     }
 }
+declare module "babylonjs/Collisions/meshCollisionData" {
+    import { Collider } from "babylonjs/Collisions/collider";
+    import { Vector3 } from "babylonjs/Maths/math";
+    import { Nullable } from "babylonjs/types";
+    import { Observer } from "babylonjs/Misc/observable";
+    import { AbstractMesh } from "babylonjs/Meshes/abstractMesh";
+    /**
+     * @hidden
+     */
+    export class _MeshCollisionData {
+        _checkCollisions: boolean;
+        _collisionMask: number;
+        _collisionGroup: number;
+        _collider: Nullable<Collider>;
+        _oldPositionForCollisions: Vector3;
+        _diffPositionForCollisions: Vector3;
+        _onCollideObserver: Nullable<Observer<AbstractMesh>>;
+        _onCollisionPositionChangeObserver: Nullable<Observer<Vector3>>;
+    }
+}
 declare module "babylonjs/Meshes/abstractMesh" {
     import { Observable } from "babylonjs/Misc/observable";
     import { Nullable, FloatArray, IndicesArray, DeepImmutable } from "babylonjs/types";
@@ -24961,7 +24969,7 @@ declare module "babylonjs/Meshes/abstractMesh" {
         static readonly BILLBOARDMODE_Z: number;
         /** Billboard on all axes */
         static readonly BILLBOARDMODE_ALL: number;
-        private _facetData;
+        private _internalAbstractMeshDataInfo;
         /**
          * The culling strategy to use to check whether the mesh must be rendered or not.
          * This value can be changed at any time and will be used on the next render mesh selection.
@@ -25014,14 +25022,12 @@ declare module "babylonjs/Meshes/abstractMesh" {
         * An event triggered when this mesh collides with another one
         */
         onCollideObservable: Observable<AbstractMesh>;
-        private _onCollideObserver;
         /** Set a function to call when this mesh collides with another one */
         onCollide: () => void;
         /**
         * An event triggered when the collision's position changes
         */
         onCollisionPositionChangeObservable: Observable<Vector3>;
-        private _onCollisionPositionChangeObserver;
         /** Set a function to call when the collision's position changes */
         onCollisionPositionChange: () => void;
         /**
@@ -25034,7 +25040,6 @@ declare module "babylonjs/Meshes/abstractMesh" {
         definedFacingForward: boolean;
         /** @hidden */
         _occlusionQuery: Nullable<WebGLQuery>;
-        private _visibility;
         /** @hidden */
         _isActive: boolean;
         /** @hidden */
@@ -25078,7 +25083,6 @@ declare module "babylonjs/Meshes/abstractMesh" {
         private _material;
         /** Gets or sets current material */
         material: Nullable<Material>;
-        private _receiveShadows;
         /**
          * Gets or sets a boolean indicating that this mesh can receive realtime shadows
          * @see http://doc.babylonjs.com/babylon101/shadows
@@ -25092,21 +25096,16 @@ declare module "babylonjs/Meshes/abstractMesh" {
         overlayColor: Color3;
         /** Defines alpha to use when rendering overlay */
         overlayAlpha: number;
-        private _hasVertexAlpha;
         /** Gets or sets a boolean indicating that this mesh contains vertex color data with alpha values */
         hasVertexAlpha: boolean;
-        private _useVertexColors;
         /** Gets or sets a boolean indicating that this mesh needs to use vertex color data to render (if this kind of vertex data is available in the geometry) */
         useVertexColors: boolean;
-        private _computeBonesUsingShaders;
         /**
          * Gets or sets a boolean indicating that bone animations must be computed by the CPU (false by default)
          */
         computeBonesUsingShaders: boolean;
-        private _numBoneInfluencers;
         /** Gets or sets the number of allowed bone influences per vertex (4 by default) */
         numBoneInfluencers: number;
-        private _applyFog;
         /** Gets or sets a boolean indicating that this mesh will allow fog to be rendered on it (true by default) */
         applyFog: boolean;
         /** Gets or sets a boolean indicating that internal octree (if available) can be used to boost submeshes selection (true by default) */
@@ -25115,7 +25114,6 @@ declare module "babylonjs/Meshes/abstractMesh" {
         useOctreeForPicking: boolean;
         /** Gets or sets a boolean indicating that internal octree (if available) can be used to boost submeshes collision (true by default) */
         useOctreeForCollisions: boolean;
-        private _layerMask;
         /**
          * Gets or sets the current layer mask (default is 0x0FFFFFFF)
          * @see http://doc.babylonjs.com/how_to/layermasks_and_multi-cam_textures
@@ -25134,9 +25132,7 @@ declare module "babylonjs/Meshes/abstractMesh" {
          * @see http://doc.babylonjs.com/how_to/how_to_use_actions
          */
         actionManager: Nullable<AbstractActionManager>;
-        private _checkCollisions;
-        private _collisionMask;
-        private _collisionGroup;
+        private _meshCollisionData;
         /**
          * Gets or sets the ellipsoid used to impersonate this mesh when using collision engine (default is (0.5, 1, 0.5))
          * @see http://doc.babylonjs.com/babylon101/cameras,_mesh_collisions_and_gravity
@@ -25147,9 +25143,6 @@ declare module "babylonjs/Meshes/abstractMesh" {
          * @see http://doc.babylonjs.com/babylon101/cameras,_mesh_collisions_and_gravity
          */
         ellipsoidOffset: Vector3;
-        private _collider;
-        private _oldPositionForCollisions;
-        private _diffPositionForCollisions;
         /**
          * Gets or sets a collision mask used to mask collisions (default is -1).
          * A collision between A and B will happen if A.collisionGroup & b.collisionMask !== 0
@@ -25199,7 +25192,6 @@ declare module "babylonjs/Meshes/abstractMesh" {
             actions: Nullable<any>;
             freezeWorldMatrix: Nullable<boolean>;
         };
-        private _skeleton;
         /** @hidden */
         _bonesTransformMatrices: Nullable<Float32Array>;
         /**
@@ -29916,7 +29908,7 @@ declare module "babylonjs/Materials/effect" {
          * Compiled shader to webGL program.
          * @hidden
          */
-        _pipelineContext: IPipelineContext;
+        _pipelineContext: Nullable<IPipelineContext>;
         private _valueCache;
         private static _baseCache;
         /**
@@ -29952,7 +29944,7 @@ declare module "babylonjs/Materials/effect" {
          * The pipeline context for this effect
          * @returns the associated pipeline context
          */
-        getPipelineContext(): IPipelineContext;
+        getPipelineContext(): Nullable<IPipelineContext>;
         /**
          * The set of names of attribute variables for the shader.
          * @returns An array of attribute names.
@@ -41731,6 +41723,7 @@ declare module "babylonjs/Collisions/index" {
     export * from "babylonjs/Collisions/collisionCoordinator";
     export * from "babylonjs/Collisions/pickingInfo";
     export * from "babylonjs/Collisions/intersectionInfo";
+    export * from "babylonjs/Collisions/meshCollisionData";
 }
 declare module "babylonjs/Culling/Octrees/octreeBlock" {
     import { SmartArrayNoDuplicate } from "babylonjs/Misc/smartArray";
@@ -72378,10 +72371,6 @@ declare module BABYLON {
         /**
          * @hidden
          */
-        _keyboardInput: Nullable<FreeCameraKeyboardMoveInput>;
-        /**
-         * @hidden
-         */
         _mouseInput: Nullable<FreeCameraMouseInput>;
         /**
          * Instantiates a new FreeCameraInputsManager.
@@ -72409,6 +72398,10 @@ declare module BABYLON {
          * @returns the current input manager
          */
         addTouch(): FreeCameraInputsManager;
+        /**
+         * Remove all attached input methods from a camera
+         */
+        clear(): void;
     }
 }
 declare module BABYLON {
@@ -80898,10 +80891,7 @@ declare module BABYLON {
          * @hidden
          */
         static _GetDefaultSideOrientation(orientation?: number): number;
-        private _onBeforeRenderObservable;
-        private _onBeforeBindObservable;
-        private _onAfterRenderObservable;
-        private _onBeforeDrawObservable;
+        private _internalMeshDataInfo;
         /**
          * An event triggered before rendering the mesh
          */
@@ -80941,13 +80931,11 @@ declare module BABYLON {
         delayLoadingFile: string;
         /** @hidden */
         _binaryInfo: any;
-        private _LODLevels;
         /**
          * User defined function used to change how LOD level selection is done
          * @see http://doc.babylonjs.com/how_to/how_to_use_lod
          */
         onLODLevelSelection: (distance: number, mesh: Mesh, selectedLevel: Nullable<Mesh>) => void;
-        private _morphTargetManager;
         /**
          * Gets or sets the morph target manager
          * @see http://doc.babylonjs.com/how_to/how_to_use_morphtargets
@@ -80966,18 +80954,12 @@ declare module BABYLON {
         private _effectiveMaterial;
         /** @hidden */
         _shouldGenerateFlatShading: boolean;
-        private _preActivateId;
         /** @hidden */
         _originalBuilderSideOrientation: number;
         /**
          * Use this property to change the original side orientation defined at construction time
          */
         overrideMaterialSideOrientation: Nullable<number>;
-        private _areNormalsFrozen;
-        private _sourcePositions;
-        private _sourceNormals;
-        private _source;
-        private meshMap;
         /**
          * Gets the source mesh (the one used to clone this one from)
          */
@@ -81004,7 +80986,7 @@ declare module BABYLON {
          */
         getClassName(): string;
         /** @hidden */
-        readonly _isMesh: boolean;
+        readonly _isMesh: boolean;
         /**
          * Returns a description of this mesh
          * @param fullDetails define if full details about this mesh must be used
@@ -84231,6 +84213,21 @@ declare module BABYLON {
 }
 declare module BABYLON {
     /**
+     * @hidden
+     */
+    export class _MeshCollisionData {
+        _checkCollisions: boolean;
+        _collisionMask: number;
+        _collisionGroup: number;
+        _collider: Nullable<Collider>;
+        _oldPositionForCollisions: Vector3;
+        _diffPositionForCollisions: Vector3;
+        _onCollideObserver: Nullable<Observer<AbstractMesh>>;
+        _onCollisionPositionChangeObserver: Nullable<Observer<Vector3>>;
+    }
+}
+declare module BABYLON {
+    /**
      * Class used to store all common mesh properties
      */
     export class AbstractMesh extends TransformNode implements IDisposable, ICullable, IGetSetVerticesData {
@@ -84290,7 +84287,7 @@ declare module BABYLON {
         static readonly BILLBOARDMODE_Z: number;
         /** Billboard on all axes */
         static readonly BILLBOARDMODE_ALL: number;
-        private _facetData;
+        private _internalAbstractMeshDataInfo;
         /**
          * The culling strategy to use to check whether the mesh must be rendered or not.
          * This value can be changed at any time and will be used on the next render mesh selection.
@@ -84343,14 +84340,12 @@ declare module BABYLON {
         * An event triggered when this mesh collides with another one
         */
         onCollideObservable: Observable<AbstractMesh>;
-        private _onCollideObserver;
         /** Set a function to call when this mesh collides with another one */
         onCollide: () => void;
         /**
         * An event triggered when the collision's position changes
         */
         onCollisionPositionChangeObservable: Observable<Vector3>;
-        private _onCollisionPositionChangeObserver;
         /** Set a function to call when the collision's position changes */
         onCollisionPositionChange: () => void;
         /**
@@ -84363,7 +84358,6 @@ declare module BABYLON {
         definedFacingForward: boolean;
         /** @hidden */
         _occlusionQuery: Nullable<WebGLQuery>;
-        private _visibility;
         /** @hidden */
         _isActive: boolean;
         /** @hidden */
@@ -84407,7 +84401,6 @@ declare module BABYLON {
         private _material;
         /** Gets or sets current material */
         material: Nullable<Material>;
-        private _receiveShadows;
         /**
          * Gets or sets a boolean indicating that this mesh can receive realtime shadows
          * @see http://doc.babylonjs.com/babylon101/shadows
@@ -84421,21 +84414,16 @@ declare module BABYLON {
         overlayColor: Color3;
         /** Defines alpha to use when rendering overlay */
         overlayAlpha: number;
-        private _hasVertexAlpha;
         /** Gets or sets a boolean indicating that this mesh contains vertex color data with alpha values */
         hasVertexAlpha: boolean;
-        private _useVertexColors;
         /** Gets or sets a boolean indicating that this mesh needs to use vertex color data to render (if this kind of vertex data is available in the geometry) */
         useVertexColors: boolean;
-        private _computeBonesUsingShaders;
         /**
          * Gets or sets a boolean indicating that bone animations must be computed by the CPU (false by default)
          */
         computeBonesUsingShaders: boolean;
-        private _numBoneInfluencers;
         /** Gets or sets the number of allowed bone influences per vertex (4 by default) */
         numBoneInfluencers: number;
-        private _applyFog;
         /** Gets or sets a boolean indicating that this mesh will allow fog to be rendered on it (true by default) */
         applyFog: boolean;
         /** Gets or sets a boolean indicating that internal octree (if available) can be used to boost submeshes selection (true by default) */
@@ -84444,7 +84432,6 @@ declare module BABYLON {
         useOctreeForPicking: boolean;
         /** Gets or sets a boolean indicating that internal octree (if available) can be used to boost submeshes collision (true by default) */
         useOctreeForCollisions: boolean;
-        private _layerMask;
         /**
          * Gets or sets the current layer mask (default is 0x0FFFFFFF)
          * @see http://doc.babylonjs.com/how_to/layermasks_and_multi-cam_textures
@@ -84463,9 +84450,7 @@ declare module BABYLON {
          * @see http://doc.babylonjs.com/how_to/how_to_use_actions
          */
         actionManager: Nullable<AbstractActionManager>;
-        private _checkCollisions;
-        private _collisionMask;
-        private _collisionGroup;
+        private _meshCollisionData;
         /**
          * Gets or sets the ellipsoid used to impersonate this mesh when using collision engine (default is (0.5, 1, 0.5))
          * @see http://doc.babylonjs.com/babylon101/cameras,_mesh_collisions_and_gravity
@@ -84476,9 +84461,6 @@ declare module BABYLON {
          * @see http://doc.babylonjs.com/babylon101/cameras,_mesh_collisions_and_gravity
          */
         ellipsoidOffset: Vector3;
-        private _collider;
-        private _oldPositionForCollisions;
-        private _diffPositionForCollisions;
         /**
          * Gets or sets a collision mask used to mask collisions (default is -1).
          * A collision between A and B will happen if A.collisionGroup & b.collisionMask !== 0
@@ -84528,7 +84510,6 @@ declare module BABYLON {
             actions: Nullable<any>;
             freezeWorldMatrix: Nullable<boolean>;
         };
-        private _skeleton;
         /** @hidden */
         _bonesTransformMatrices: Nullable<Float32Array>;
         /**
@@ -89148,7 +89129,7 @@ declare module BABYLON {
          * Compiled shader to webGL program.
          * @hidden
          */
-        _pipelineContext: IPipelineContext;
+        _pipelineContext: Nullable<IPipelineContext>;
         private _valueCache;
         private static _baseCache;
         /**
@@ -89184,7 +89165,7 @@ declare module BABYLON {
          * The pipeline context for this effect
          * @returns the associated pipeline context
          */
-        getPipelineContext(): IPipelineContext;
+        getPipelineContext(): Nullable<IPipelineContext>;
         /**
          * The set of names of attribute variables for the shader.
          * @returns An array of attribute names.

A különbségek nem kerülnek megjelenítésre, a fájl túl nagy
+ 19 - 15
dist/preview release/viewer/babylon.viewer.js


A különbségek nem kerülnek megjelenítésre, a fájl túl nagy
+ 1 - 1
dist/preview release/viewer/babylon.viewer.max.js


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

@@ -30,14 +30,14 @@
 - Added `TrailMesh` class. Credit to furcatomasz ([danjpar](https://github.com/danjpar)) **** NEED DEMO or DOC LINK)
 - Support rendering to a Multiview outputRenderTargetTexture with multiview engine component to improve performance for XR scenarios ([TrevorDev](https://github.com/TrevorDev))
 - PBR:
-  - Added Inspector Debug Mode ([Sebavan](https://github.com/Sebavan)) **** NEED DEMO or DOC LINK)
-  - Added Smith Height Correlated Visibility term to PBR ([Sebavan](https://github.com/Sebavan)) **** NEED DEMO or DOC LINK)
-  - Added energy conservation through Multiscattering BRDF support to PBR ([Sebavan](https://github.com/Sebavan)) **** NEED DEMO or DOC LINK)
-  - Added clear coat support to PBR ([Sebavan](https://github.com/Sebavan)) **** NEED DEMO or DOC LINK)
-  - Added anisotropy support to PBR ([Sebavan](https://github.com/Sebavan)) **** NEED DEMO or DOC LINK)
-  - Added sheen support to PBR ([Sebavan](https://github.com/Sebavan)) **** NEED DEMO or DOC LINK)
-  - Added sub-surface support to PBR ([Sebavan](https://github.com/Sebavan)) **** NEED DEMO or DOC LINK)
-  - Added SH Harmonics support to PBR ([Sebavan](https://github.com/Sebavan)) **** NEED DEMO or DOC LINK)
+  - Added clear coat support to PBR ([Sebavan](https://github.com/Sebavan)) [Documentation](https://doc.babylonjs.com/how_to/physically_based_rendering_master#clear-coat)
+  - Added anisotropy support to PBR [Documentation](https://doc.babylonjs.com/how_to/physically_based_rendering_master#anisotropy)
+  - Added sheen support to PBR ([Sebavan](https://github.com/Sebavan)) [Documentation](https://doc.babylonjs.com/how_to/physically_based_rendering_master#sheen)
+  - Added sub-surface support to PBR ([Sebavan](https://github.com/Sebavan)) [Documentation](https://doc.babylonjs.com/how_to/physically_based_rendering_master#sub-surface)
+  - Added energy conservation through Multiscattering BRDF support to PBR [Documentation](https://doc.babylonjs.com/how_to/physically_based_rendering_master#energy-conservation)
+  - Added Inspector Debug Mode ([Sebavan](https://github.com/Sebavan)) [Documentation](https://doc.babylonjs.com/how_to/physically_based_rendering_master#how-to-debug)
+  - Added Smith Height Correlated Visibility term to PBR ([Sebavan](https://github.com/Sebavan)) [White Paper](http://jcgt.org/published/0003/02/03/)
+  - Added SH Harmonics support to PBR ([Sebavan](https://github.com/Sebavan)) [Documentation](https://doc.babylonjs.com/how_to/physically_based_rendering_master#spherical-harmonics)
 - Added a STL exporter ([pryme8](https://github.com/pryme8))
 
 ## Optimizations

+ 17 - 1
inspector/src/components/actionTabs/tabs/propertyGrids/meshes/meshPropertyGridComponent.tsx

@@ -161,6 +161,15 @@ export class MeshPropertyGridComponent extends React.Component<IMeshPropertyGrid
         this.props.onSelectionChangedObservable.notifyObservers(mesh.material);
     }
 
+    onSourceMeshLink() {
+        if (!this.props.onSelectionChangedObservable) {
+            return;
+        }
+
+        const instanceMesh = this.props.mesh as any;
+        this.props.onSelectionChangedObservable.notifyObservers(instanceMesh.sourceMesh);
+    }
+
     convertPhysicsTypeToString(): string {
         const mesh = this.props.mesh;
         switch (mesh.physicsImpostor!.type) {
@@ -217,6 +226,10 @@ export class MeshPropertyGridComponent extends React.Component<IMeshPropertyGrid
                         mesh.material &&
                         <TextLineComponent label="Material" value={mesh.material.name} onLink={() => this.onMaterialLink()} />
                     }
+                    {
+                        mesh.isAnInstance &&
+                        <TextLineComponent label="Source" value={(mesh as any).sourceMesh.name} onLink={() => this.onSourceMeshLink()} />
+                    }
                 </LineContainerComponent>
                 <LineContainerComponent globalState={this.props.globalState} title="TRANSFORMS">
                     <Vector3LineComponent label="Position" target={mesh} propertyName="position" onPropertyChangedObservable={this.props.onPropertyChangedObservable} />
@@ -231,7 +244,10 @@ export class MeshPropertyGridComponent extends React.Component<IMeshPropertyGrid
                     <Vector3LineComponent label="Scaling" target={mesh} propertyName="scaling" onPropertyChangedObservable={this.props.onPropertyChangedObservable} />
                 </LineContainerComponent>
                 <LineContainerComponent globalState={this.props.globalState} title="DISPLAY" closed={true}>
-                    <SliderLineComponent label="Visibility" target={mesh} propertyName="visibility" minimum={0} maximum={1} step={0.01} onPropertyChangedObservable={this.props.onPropertyChangedObservable} />
+                    {
+                        !mesh.isAnInstance &&
+                        <SliderLineComponent label="Visibility" target={mesh} propertyName="visibility" minimum={0} maximum={1} step={0.01} onPropertyChangedObservable={this.props.onPropertyChangedObservable} />
+                    }
                     <FloatLineComponent lockObject={this.props.lockObject} label="Alpha index" target={mesh} propertyName="alphaIndex" onPropertyChangedObservable={this.props.onPropertyChangedObservable} />
                     <CheckBoxLineComponent label="Receive shadows" target={mesh} propertyName="receiveShadows" onPropertyChangedObservable={this.props.onPropertyChangedObservable} />
                     {

+ 3 - 3
package.json

@@ -9,7 +9,7 @@
     ],
     "name": "babylonjs",
     "description": "Babylon.js is a JavaScript 3D engine based on webgl.",
-    "version": "4.0.0-rc.0",
+    "version": "4.0.0-rc.1",
     "repository": {
         "type": "git",
         "url": "https://github.com/BabylonJS/Babylon.js.git"
@@ -98,7 +98,7 @@
         "tslib": "^1.9.3",
         "tslint": "^5.11.0",
         "typedoc": "^0.14.2",
-        "typescript": "~3.4.1",
+        "typescript": "~3.4.5",
         "webpack": "^4.29.3",
         "webpack-bundle-analyzer": "^3.1.0",
         "webpack-cli": "^3.1.2",
@@ -107,4 +107,4 @@
         "xhr2": "^0.1.4",
         "xmlbuilder": "8.2.2"
     }
-}
+}

+ 2 - 0
src/Cameras/Inputs/arcRotateCameraMouseWheelInput.ts

@@ -4,6 +4,7 @@ import { EventState, Observer } from "../../Misc/observable";
 import { ArcRotateCamera } from "../../Cameras/arcRotateCamera";
 import { ICameraInput, CameraInputTypes } from "../../Cameras/cameraInputsManager";
 import { PointerInfo, PointerEventTypes } from "../../Events/pointerEvents";
+import { Scalar } from '../../Maths/math.scalar';
 
 /**
  * Manage the mouse wheel inputs to control an arc rotate camera.
@@ -67,6 +68,7 @@ export class ArcRotateCameraMouseWheelInput implements ICameraInput<ArcRotateCam
                             estimatedTargetRadius -= targetInertia;
                             targetInertia *= this.camera.inertia;
                         }
+                        estimatedTargetRadius = Scalar.Clamp(estimatedTargetRadius, 0, Number.MAX_VALUE);
                         delta = this.computeDeltaFromMouseWheelLegacyEvent(mouseWheelLegacyEvent, estimatedTargetRadius);
                     }
                 } else {

+ 8 - 5
src/Cameras/freeCameraInputsManager.ts

@@ -14,11 +14,6 @@ export class FreeCameraInputsManager extends CameraInputsManager<FreeCamera> {
     /**
      * @hidden
      */
-    public _keyboardInput: Nullable<FreeCameraKeyboardMoveInput> = null;
-
-    /**
-     * @hidden
-     */
     public _mouseInput: Nullable<FreeCameraMouseInput> = null;
     /**
      * Instantiates a new FreeCameraInputsManager.
@@ -69,4 +64,12 @@ export class FreeCameraInputsManager extends CameraInputsManager<FreeCamera> {
         this.add(new FreeCameraTouchInput());
         return this;
     }
+
+    /**
+     * Remove all attached input methods from a camera
+     */
+    public clear(): void {
+        super.clear();
+        this._mouseInput = null;
+    }
 }

+ 2 - 1
src/Collisions/index.ts

@@ -1,4 +1,5 @@
 export * from "./collider";
 export * from "./collisionCoordinator";
 export * from "./pickingInfo";
-export * from "./intersectionInfo";
+export * from "./intersectionInfo";
+export * from "./meshCollisionData";

+ 20 - 0
src/Collisions/meshCollisionData.ts

@@ -0,0 +1,20 @@
+import { Collider } from './collider';
+import { Vector3 } from '../Maths/math';
+import { Nullable } from '../types';
+import { Observer } from '../Misc/observable';
+
+declare type AbstractMesh = import("../Meshes/abstractMesh").AbstractMesh;
+
+/**
+ * @hidden
+ */
+export class _MeshCollisionData {
+    public _checkCollisions = false;
+    public _collisionMask = -1;
+    public _collisionGroup = -1;
+    public _collider: Nullable<Collider> = null;
+    public _oldPositionForCollisions = new Vector3(0, 0, 0);
+    public _diffPositionForCollisions = new Vector3(0, 0, 0);
+    public _onCollideObserver: Nullable<Observer<AbstractMesh>>;
+    public _onCollisionPositionChangeObserver: Nullable<Observer<Vector3>>;
+}

+ 2 - 2
src/Engines/engine.ts

@@ -491,14 +491,14 @@ export class Engine {
      */
     // Not mixed with Version for tooling purpose.
     public static get NpmPackage(): string {
-        return "babylonjs@4.0.0-rc.0";
+        return "babylonjs@4.0.0-rc.1";
     }
 
     /**
      * Returns the current version of the framework
      */
     public static get Version(): string {
-        return "4.0.0-rc.0";
+        return "4.0.0-rc.1";
     }
 
     /**

+ 21 - 21
src/Materials/effect.ts

@@ -24,7 +24,7 @@ export class EffectFallbacks {
     private _currentRank = 32;
     private _maxRank = -1;
 
-    private _mesh: Nullable<AbstractMesh>;
+    private _mesh: Nullable<AbstractMesh> = null;
 
     /**
      * Removes the fallback from the bound mesh.
@@ -192,23 +192,23 @@ export class Effect implements IDisposable {
     /**
      * Name of the effect.
      */
-    public name: any;
+    public name: any = null;
     /**
      * String container all the define statements that should be set on the shader.
      */
-    public defines: string;
+    public defines: string = "";
     /**
      * Callback that will be called when the shader is compiled.
      */
-    public onCompiled: Nullable<(effect: Effect) => void>;
+    public onCompiled: Nullable<(effect: Effect) => void> = null;
     /**
      * Callback that will be called if an error occurs during shader compilation.
      */
-    public onError: Nullable<(effect: Effect, errors: string) => void>;
+    public onError: Nullable<(effect: Effect, errors: string) => void> = null;
     /**
      * Callback that will be called when effect is bound.
      */
-    public onBind: Nullable<(effect: Effect) => void>;
+    public onBind: Nullable<(effect: Effect) => void> = null;
     /**
      * Unique ID of the effect.
      */
@@ -224,7 +224,7 @@ export class Effect implements IDisposable {
     public onErrorObservable = new Observable<Effect>();
 
     /** @hidden */
-    public _onBindObservable: Nullable<Observable<Effect>>;
+    public _onBindObservable: Nullable<Observable<Effect>> = null;
 
     /**
      * Observable that will be called when effect is bound.
@@ -255,20 +255,20 @@ export class Effect implements IDisposable {
      * Key for the effect.
      * @hidden
      */
-    public _key: string;
+    public _key: string = "";
     private _indexParameters: any;
-    private _fallbacks: Nullable<EffectFallbacks>;
-    private _vertexSourceCode: string;
-    private _fragmentSourceCode: string;
-    private _vertexSourceCodeOverride: string;
-    private _fragmentSourceCodeOverride: string;
-    private _transformFeedbackVaryings: Nullable<string[]>;
+    private _fallbacks: Nullable<EffectFallbacks> = null;
+    private _vertexSourceCode: string = "";
+    private _fragmentSourceCode: string = "";
+    private _vertexSourceCodeOverride: string = "";
+    private _fragmentSourceCodeOverride: string = "";
+    private _transformFeedbackVaryings: Nullable<string[]> = null;
     /**
      * Compiled shader to webGL program.
      * @hidden
      */
-    public _pipelineContext: IPipelineContext;
-    private _valueCache: { [key: string]: any };
+    public _pipelineContext: Nullable<IPipelineContext> = null;
+    private _valueCache: { [key: string]: any } = {};
     private static _baseCache: { [key: number]: DataBuffer } = {};
 
     /**
@@ -405,7 +405,7 @@ export class Effect implements IDisposable {
      * The pipeline context for this effect
      * @returns the associated pipeline context
      */
-    public getPipelineContext(): IPipelineContext {
+    public getPipelineContext(): Nullable<IPipelineContext> {
         return this._pipelineContext;
     }
 
@@ -793,7 +793,7 @@ export class Effect implements IDisposable {
                 scenes[i].markAllMaterialsAsDirty(Constants.MATERIAL_AllDirtyFlag);
             }
 
-            this._pipelineContext._handlesSpectorRebuildCallback(onCompiled);
+            this._pipelineContext!._handlesSpectorRebuildCallback(onCompiled);
         };
         this._fallbacks = null;
         this._prepareEffect();
@@ -831,12 +831,12 @@ export class Effect implements IDisposable {
                     }
                 }
 
-                let uniforms = engine.getUniforms(this._pipelineContext, this._uniformsNames);
+                let uniforms = engine.getUniforms(this._pipelineContext!, this._uniformsNames);
                 uniforms.forEach((uniform, index) => {
                     this._uniforms[this._uniformsNames[index]] = uniform;
                 });
 
-                this._attributes = engine.getAttributes(this._pipelineContext, attributesNames);
+                this._attributes = engine.getAttributes(this._pipelineContext!, attributesNames);
 
                 var index: number;
                 for (index = 0; index < this._samplerList.length; index++) {
@@ -1100,7 +1100,7 @@ export class Effect implements IDisposable {
      * @param index Index to bind.
      */
     public bindUniformBlock(blockName: string, index: number): void {
-        this._engine.bindUniformBlock(this._pipelineContext, blockName, index);
+        this._engine.bindUniformBlock(this._pipelineContext!, blockName, index);
     }
 
     /**

+ 110 - 107
src/Meshes/abstractMesh.ts

@@ -1,5 +1,5 @@
 import { Tools } from "../Misc/tools";
-import { Observer, Observable } from "../Misc/observable";
+import { Observable } from "../Misc/observable";
 import { Nullable, FloatArray, IndicesArray, DeepImmutable } from "../types";
 import { Camera } from "../Cameras/camera";
 import { Scene, IDisposable } from "../scene";
@@ -21,6 +21,7 @@ import { IEdgesRenderer } from "../Rendering/edgesRenderer";
 import { SolidParticle } from "../Particles/solidParticle";
 import { Constants } from "../Engines/constants";
 import { AbstractActionManager } from '../Actions/abstractActionManager';
+import { _MeshCollisionData } from '../Collisions/meshCollisionData';
 
 declare type Ray = import("../Culling/ray").Ray;
 declare type Collider = import("../Collisions/collider").Collider;
@@ -58,6 +59,22 @@ class _FacetDataStorage {
 }
 
 /**
+ * @hidden
+ **/
+class _InternalAbstractMeshDataInfo {
+    public _hasVertexAlpha = false;
+    public _useVertexColors = true;
+    public _numBoneInfluencers = 4;
+    public _applyFog = true;
+    public _receiveShadows = false;
+    public _facetData = new _FacetDataStorage();
+    public _visibility = 1.0;
+    public _skeleton: Nullable<Skeleton> = null;
+    public _layerMask: number = 0x0FFFFFFF;
+    public _computeBonesUsingShaders = true;
+}
+
+/**
  * Class used to store all common mesh properties
  */
 export class AbstractMesh extends TransformNode implements IDisposable, ICullable, IGetSetVerticesData {
@@ -134,7 +151,8 @@ export class AbstractMesh extends TransformNode implements IDisposable, ICullabl
         return TransformNode.BILLBOARDMODE_ALL;
     }
 
-    private _facetData = new _FacetDataStorage();
+    // Internal data
+    private _internalAbstractMeshDataInfo = new _InternalAbstractMeshDataInfo();
 
     /**
      * The culling strategy to use to check whether the mesh must be rendered or not.
@@ -153,17 +171,17 @@ export class AbstractMesh extends TransformNode implements IDisposable, ICullabl
      * @see http://doc.babylonjs.com/how_to/how_to_use_facetdata#what-is-a-mesh-facet
      */
     public get facetNb(): number {
-        return this._facetData.facetNb;
+        return this._internalAbstractMeshDataInfo._facetData.facetNb;
     }
     /**
      * Gets or set the number (integer) of subdivisions per axis in the partioning space
      * @see http://doc.babylonjs.com/how_to/how_to_use_facetdata#tweaking-the-partitioning
      */
     public get partitioningSubdivisions(): number {
-        return this._facetData.partitioningSubdivisions;
+        return this._internalAbstractMeshDataInfo._facetData.partitioningSubdivisions;
     }
     public set partitioningSubdivisions(nb: number) {
-        this._facetData.partitioningSubdivisions = nb;
+        this._internalAbstractMeshDataInfo._facetData.partitioningSubdivisions = nb;
     }
     /**
      * The ratio (float) to apply to the bouding box size to set to the partioning space.
@@ -171,10 +189,10 @@ export class AbstractMesh extends TransformNode implements IDisposable, ICullabl
      * @see http://doc.babylonjs.com/how_to/how_to_use_facetdata#tweaking-the-partitioning
      */
     public get partitioningBBoxRatio(): number {
-        return this._facetData.partitioningBBoxRatio;
+        return this._internalAbstractMeshDataInfo._facetData.partitioningBBoxRatio;
     }
     public set partitioningBBoxRatio(ratio: number) {
-        this._facetData.partitioningBBoxRatio = ratio;
+        this._internalAbstractMeshDataInfo._facetData.partitioningBBoxRatio = ratio;
     }
 
     /**
@@ -184,10 +202,10 @@ export class AbstractMesh extends TransformNode implements IDisposable, ICullabl
      * @see http://doc.babylonjs.com/how_to/how_to_use_facetdata#facet-depth-sort
      */
     public get mustDepthSortFacets(): boolean {
-        return this._facetData.facetDepthSort;
+        return this._internalAbstractMeshDataInfo._facetData.facetDepthSort;
     }
     public set mustDepthSortFacets(sort: boolean) {
-        this._facetData.facetDepthSort = sort;
+        this._internalAbstractMeshDataInfo._facetData.facetDepthSort = sort;
     }
 
     /**
@@ -197,10 +215,10 @@ export class AbstractMesh extends TransformNode implements IDisposable, ICullabl
      * @see http://doc.babylonjs.com/how_to/how_to_use_facetdata#facet-depth-sort
      */
     public get facetDepthSortFrom(): Vector3 {
-        return this._facetData.facetDepthSortFrom;
+        return this._internalAbstractMeshDataInfo._facetData.facetDepthSortFrom;
     }
     public set facetDepthSortFrom(location: Vector3) {
-        this._facetData.facetDepthSortFrom = location;
+        this._internalAbstractMeshDataInfo._facetData.facetDepthSortFrom = location;
     }
 
     /**
@@ -208,7 +226,7 @@ export class AbstractMesh extends TransformNode implements IDisposable, ICullabl
      * @see http://doc.babylonjs.com/how_to/how_to_use_facetdata#what-is-a-mesh-facet
      */
     public get isFacetDataEnabled(): boolean {
-        return this._facetData.facetDataEnabled;
+        return this._internalAbstractMeshDataInfo._facetData.facetDataEnabled;
     }
 
     /** @hidden */
@@ -227,14 +245,12 @@ export class AbstractMesh extends TransformNode implements IDisposable, ICullabl
     */
     public onCollideObservable = new Observable<AbstractMesh>();
 
-    private _onCollideObserver: Nullable<Observer<AbstractMesh>>;
-
     /** Set a function to call when this mesh collides with another one */
     public set onCollide(callback: () => void) {
-        if (this._onCollideObserver) {
-            this.onCollideObservable.remove(this._onCollideObserver);
+        if (this._meshCollisionData._onCollideObserver) {
+            this.onCollideObservable.remove(this._meshCollisionData._onCollideObserver);
         }
-        this._onCollideObserver = this.onCollideObservable.add(callback);
+        this._meshCollisionData._onCollideObserver = this.onCollideObservable.add(callback);
     }
 
     /**
@@ -242,13 +258,12 @@ export class AbstractMesh extends TransformNode implements IDisposable, ICullabl
     */
     public onCollisionPositionChangeObservable = new Observable<Vector3>();
 
-    private _onCollisionPositionChangeObserver: Nullable<Observer<Vector3>>;
     /** Set a function to call when the collision's position changes */
     public set onCollisionPositionChange(callback: () => void) {
-        if (this._onCollisionPositionChangeObserver) {
-            this.onCollisionPositionChangeObservable.remove(this._onCollisionPositionChangeObserver);
+        if (this._meshCollisionData._onCollisionPositionChangeObserver) {
+            this.onCollisionPositionChangeObservable.remove(this._meshCollisionData._onCollisionPositionChangeObserver);
         }
-        this._onCollisionPositionChangeObserver = this.onCollisionPositionChangeObservable.add(callback);
+        this._meshCollisionData._onCollisionPositionChangeObserver = this.onCollisionPositionChangeObservable.add(callback);
     }
 
     /**
@@ -266,8 +281,6 @@ export class AbstractMesh extends TransformNode implements IDisposable, ICullabl
     /** @hidden */
     public _occlusionQuery: Nullable<WebGLQuery> = null;
 
-    private _visibility = 1.0;
-
     /** @hidden */
     public _isActive = false;
 
@@ -281,18 +294,18 @@ export class AbstractMesh extends TransformNode implements IDisposable, ICullabl
      * Gets or sets mesh visibility between 0 and 1 (default is 1)
      */
     public get visibility(): number {
-        return this._visibility;
+        return this._internalAbstractMeshDataInfo._visibility;
     }
 
     /**
      * Gets or sets mesh visibility between 0 and 1 (default is 1)
      */
     public set visibility(value: number) {
-        if (this._visibility === value) {
+        if (this._internalAbstractMeshDataInfo._visibility === value) {
             return;
         }
 
-        this._visibility = value;
+        this._internalAbstractMeshDataInfo._visibility = value;
         this._markSubMeshesAsMiscDirty();
     }
 
@@ -362,21 +375,19 @@ export class AbstractMesh extends TransformNode implements IDisposable, ICullabl
         this._unBindEffect();
     }
 
-    private _receiveShadows = false;
-
     /**
      * Gets or sets a boolean indicating that this mesh can receive realtime shadows
      * @see http://doc.babylonjs.com/babylon101/shadows
      */
     public get receiveShadows(): boolean {
-        return this._receiveShadows;
+        return this._internalAbstractMeshDataInfo._receiveShadows;
     }
     public set receiveShadows(value: boolean) {
-        if (this._receiveShadows === value) {
+        if (this._internalAbstractMeshDataInfo._receiveShadows === value) {
             return;
         }
 
-        this._receiveShadows = value;
+        this._internalAbstractMeshDataInfo._receiveShadows = value;
         this._markSubMeshesAsLightDirty();
     }
 
@@ -390,78 +401,71 @@ export class AbstractMesh extends TransformNode implements IDisposable, ICullabl
     /** Defines alpha to use when rendering overlay */
     public overlayAlpha = 0.5;
 
-    private _hasVertexAlpha = false;
     /** Gets or sets a boolean indicating that this mesh contains vertex color data with alpha values */
     public get hasVertexAlpha(): boolean {
-        return this._hasVertexAlpha;
+        return this._internalAbstractMeshDataInfo._hasVertexAlpha;
     }
     public set hasVertexAlpha(value: boolean) {
-        if (this._hasVertexAlpha === value) {
+        if (this._internalAbstractMeshDataInfo._hasVertexAlpha === value) {
             return;
         }
 
-        this._hasVertexAlpha = value;
+        this._internalAbstractMeshDataInfo._hasVertexAlpha = value;
         this._markSubMeshesAsAttributesDirty();
         this._markSubMeshesAsMiscDirty();
     }
 
-    private _useVertexColors = true;
-
     /** Gets or sets a boolean indicating that this mesh needs to use vertex color data to render (if this kind of vertex data is available in the geometry) */
     public get useVertexColors(): boolean {
-        return this._useVertexColors;
+        return this._internalAbstractMeshDataInfo._useVertexColors;
     }
     public set useVertexColors(value: boolean) {
-        if (this._useVertexColors === value) {
+        if (this._internalAbstractMeshDataInfo._useVertexColors === value) {
             return;
         }
 
-        this._useVertexColors = value;
+        this._internalAbstractMeshDataInfo._useVertexColors = value;
         this._markSubMeshesAsAttributesDirty();
     }
 
-    private _computeBonesUsingShaders = true;
     /**
      * Gets or sets a boolean indicating that bone animations must be computed by the CPU (false by default)
      */
     public get computeBonesUsingShaders(): boolean {
-        return this._computeBonesUsingShaders;
+        return this._internalAbstractMeshDataInfo._computeBonesUsingShaders;
     }
     public set computeBonesUsingShaders(value: boolean) {
-        if (this._computeBonesUsingShaders === value) {
+        if (this._internalAbstractMeshDataInfo._computeBonesUsingShaders === value) {
             return;
         }
 
-        this._computeBonesUsingShaders = value;
+        this._internalAbstractMeshDataInfo._computeBonesUsingShaders = value;
         this._markSubMeshesAsAttributesDirty();
     }
 
-    private _numBoneInfluencers = 4;
     /** Gets or sets the number of allowed bone influences per vertex (4 by default) */
     public get numBoneInfluencers(): number {
-        return this._numBoneInfluencers;
+        return this._internalAbstractMeshDataInfo._numBoneInfluencers;
     }
     public set numBoneInfluencers(value: number) {
-        if (this._numBoneInfluencers === value) {
+        if (this._internalAbstractMeshDataInfo._numBoneInfluencers === value) {
             return;
         }
 
-        this._numBoneInfluencers = value;
+        this._internalAbstractMeshDataInfo._numBoneInfluencers = value;
         this._markSubMeshesAsAttributesDirty();
     }
 
-    private _applyFog = true;
-
     /** Gets or sets a boolean indicating that this mesh will allow fog to be rendered on it (true by default) */
     public get applyFog(): boolean {
-        return this._applyFog;
+        return this._internalAbstractMeshDataInfo._applyFog;
     }
     public set applyFog(value: boolean) {
-        if (this._applyFog === value) {
+        if (this._internalAbstractMeshDataInfo._applyFog === value) {
             return;
         }
 
-        this._applyFog = value;
+        this._internalAbstractMeshDataInfo._applyFog = value;
         this._markSubMeshesAsMiscDirty();
     }
 
@@ -472,22 +476,20 @@ export class AbstractMesh extends TransformNode implements IDisposable, ICullabl
     /** Gets or sets a boolean indicating that internal octree (if available) can be used to boost submeshes collision (true by default) */
     public useOctreeForCollisions = true;
 
-    private _layerMask: number = 0x0FFFFFFF;
-
     /**
      * Gets or sets the current layer mask (default is 0x0FFFFFFF)
      * @see http://doc.babylonjs.com/how_to/layermasks_and_multi-cam_textures
      */
     public get layerMask(): number {
-        return this._layerMask;
+        return this._internalAbstractMeshDataInfo._layerMask;
     }
 
     public set layerMask(value: number) {
-        if (value === this._layerMask) {
+        if (value === this._internalAbstractMeshDataInfo._layerMask) {
             return;
         }
 
-        this._layerMask = value;
+        this._internalAbstractMeshDataInfo._layerMask = value;
         this._resyncLightSources();
     }
 
@@ -508,9 +510,7 @@ export class AbstractMesh extends TransformNode implements IDisposable, ICullabl
     public actionManager: Nullable<AbstractActionManager> = null;
 
     // Collisions
-    private _checkCollisions = false;
-    private _collisionMask = -1;
-    private _collisionGroup = -1;
+    private _meshCollisionData = new _MeshCollisionData();
 
     /**
      * Gets or sets the ellipsoid used to impersonate this mesh when using collision engine (default is (0.5, 1, 0.5))
@@ -522,20 +522,17 @@ 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: Nullable<Collider> = null;
-    private _oldPositionForCollisions = new Vector3(0, 0, 0);
-    private _diffPositionForCollisions = new Vector3(0, 0, 0);
 
     /**
      * Gets or sets a collision mask used to mask collisions (default is -1).
      * A collision between A and B will happen if A.collisionGroup & b.collisionMask !== 0
      */
     public get collisionMask(): number {
-        return this._collisionMask;
+        return this._meshCollisionData._collisionMask;
     }
 
     public set collisionMask(mask: number) {
-        this._collisionMask = !isNaN(mask) ? mask : -1;
+        this._meshCollisionData._collisionMask = !isNaN(mask) ? mask : -1;
     }
 
     /**
@@ -543,11 +540,11 @@ export class AbstractMesh extends TransformNode implements IDisposable, ICullabl
      * A collision between A and B will happen if A.collisionGroup & b.collisionMask !== 0
      */
     public get collisionGroup(): number {
-        return this._collisionGroup;
+        return this._meshCollisionData._collisionGroup;
     }
 
     public set collisionGroup(mask: number) {
-        this._collisionGroup = !isNaN(mask) ? mask : -1;
+        this._meshCollisionData._collisionGroup = !isNaN(mask) ? mask : -1;
     }
 
     // Edges
@@ -608,8 +605,6 @@ export class AbstractMesh extends TransformNode implements IDisposable, ICullabl
             freezeWorldMatrix: null
         };
 
-    // Skeleton
-    private _skeleton: Nullable<Skeleton> = null;
     /** @hidden */
     public _bonesTransformMatrices: Nullable<Float32Array> = null;
 
@@ -618,17 +613,18 @@ export class AbstractMesh extends TransformNode implements IDisposable, ICullabl
      * @see http://doc.babylonjs.com/how_to/how_to_use_bones_and_skeletons
      */
     public set skeleton(value: Nullable<Skeleton>) {
-        if (this._skeleton && this._skeleton.needInitialSkinMatrix) {
-            this._skeleton._unregisterMeshWithPoseMatrix(this);
+        let skeleton = this._internalAbstractMeshDataInfo._skeleton;
+        if (skeleton && skeleton.needInitialSkinMatrix) {
+            skeleton._unregisterMeshWithPoseMatrix(this);
         }
 
         if (value && value.needInitialSkinMatrix) {
             value._registerMeshWithPoseMatrix(this);
         }
 
-        this._skeleton = value;
+        this._internalAbstractMeshDataInfo._skeleton = value;
 
-        if (!this._skeleton) {
+        if (!this._internalAbstractMeshDataInfo._skeleton) {
             this._bonesTransformMatrices = null;
         }
 
@@ -636,7 +632,7 @@ export class AbstractMesh extends TransformNode implements IDisposable, ICullabl
     }
 
     public get skeleton(): Nullable<Skeleton> {
-        return this._skeleton;
+        return this._internalAbstractMeshDataInfo._skeleton;
     }
 
     /**
@@ -675,8 +671,10 @@ export class AbstractMesh extends TransformNode implements IDisposable, ICullabl
     public toString(fullDetails?: boolean): string {
         var ret = "Name: " + this.name + ", isInstance: " + (this.getClassName() !== "InstancedMesh" ? "YES" : "NO");
         ret += ", # of submeshes: " + (this.subMeshes ? this.subMeshes.length : 0);
-        if (this._skeleton) {
-            ret += ", skeleton: " + this._skeleton.name;
+
+        let skeleton = this._internalAbstractMeshDataInfo._skeleton;
+        if (skeleton) {
+            ret += ", skeleton: " + skeleton.name;
         }
         if (fullDetails) {
             ret += ", billboard mode: " + (["NONE", "X", "Y", null, "Z", null, null, "ALL"])[this.billboardMode];
@@ -1359,11 +1357,11 @@ export class AbstractMesh extends TransformNode implements IDisposable, ICullabl
      * @see http://doc.babylonjs.com/babylon101/cameras,_mesh_collisions_and_gravity
      */
     public get checkCollisions(): boolean {
-        return this._checkCollisions;
+        return this._meshCollisionData._checkCollisions;
     }
 
     public set checkCollisions(collisionEnabled: boolean) {
-        this._checkCollisions = collisionEnabled;
+        this._meshCollisionData._checkCollisions = collisionEnabled;
     }
 
     /**
@@ -1371,7 +1369,7 @@ export class AbstractMesh extends TransformNode implements IDisposable, ICullabl
      * @see http://doc.babylonjs.com/babylon101/cameras,_mesh_collisions_and_gravity
      */
     public get collider(): Nullable<Collider> {
-        return this._collider;
+        return this._meshCollisionData._collider;
     }
 
     /**
@@ -1383,24 +1381,24 @@ export class AbstractMesh extends TransformNode implements IDisposable, ICullabl
     public moveWithCollisions(displacement: Vector3): AbstractMesh {
         var globalPosition = this.getAbsolutePosition();
 
-        globalPosition.addToRef(this.ellipsoidOffset, this._oldPositionForCollisions);
+        globalPosition.addToRef(this.ellipsoidOffset, this._meshCollisionData._oldPositionForCollisions);
         let coordinator = this.getScene().collisionCoordinator;
 
-        if (!this._collider) {
-            this._collider = coordinator.createCollider();
+        if (!this._meshCollisionData._collider) {
+            this._meshCollisionData._collider = coordinator.createCollider();
         }
 
-        this._collider._radius = this.ellipsoid;
+        this._meshCollisionData._collider._radius = this.ellipsoid;
 
-        coordinator.getNewPosition(this._oldPositionForCollisions, displacement, this._collider, 3, this, this._onCollisionPositionChange, this.uniqueId);
+        coordinator.getNewPosition(this._meshCollisionData._oldPositionForCollisions, displacement, this._meshCollisionData._collider, 3, this, this._onCollisionPositionChange, this.uniqueId);
         return this;
     }
 
     private _onCollisionPositionChange = (collisionId: number, newPosition: Vector3, collidedMesh: Nullable<AbstractMesh> = null) => {
-        newPosition.subtractToRef(this._oldPositionForCollisions, this._diffPositionForCollisions);
+        newPosition.subtractToRef(this._meshCollisionData._oldPositionForCollisions, this._meshCollisionData._diffPositionForCollisions);
 
-        if (this._diffPositionForCollisions.length() > Engine.CollisionsEpsilon) {
-            this.position.addInPlace(this._diffPositionForCollisions);
+        if (this._meshCollisionData._diffPositionForCollisions.length() > Engine.CollisionsEpsilon) {
+            this.position.addInPlace(this._meshCollisionData._diffPositionForCollisions);
         }
 
         if (collidedMesh) {
@@ -1596,7 +1594,7 @@ export class AbstractMesh extends TransformNode implements IDisposable, ICullabl
         }
 
         // Skeleton
-        this._skeleton = null;
+        this._internalAbstractMeshDataInfo._skeleton = null;
 
         // Intersections in progress
         for (index = 0; index < this._intersectionsInProgress.length; index++) {
@@ -1679,7 +1677,7 @@ export class AbstractMesh extends TransformNode implements IDisposable, ICullabl
         }
 
         // facet data
-        if (this._facetData.facetDataEnabled) {
+        if (this._internalAbstractMeshDataInfo._facetData.facetDataEnabled) {
             this.disableFacetData();
         }
 
@@ -1714,7 +1712,7 @@ export class AbstractMesh extends TransformNode implements IDisposable, ICullabl
     // Facet data
     /** @hidden */
     private _initFacetData(): AbstractMesh {
-        const data = this._facetData;
+        const data = this._internalAbstractMeshDataInfo._facetData;
         if (!data.facetNormals) {
             data.facetNormals = new Array<Vector3>();
         }
@@ -1743,7 +1741,7 @@ export class AbstractMesh extends TransformNode implements IDisposable, ICullabl
      * @see http://doc.babylonjs.com/how_to/how_to_use_facetdata
      */
     public updateFacetData(): AbstractMesh {
-        const data = this._facetData;
+        const data = this._internalAbstractMeshDataInfo._facetData;
         if (!data.facetDataEnabled) {
             this._initFacetData();
         }
@@ -1844,10 +1842,11 @@ export class AbstractMesh extends TransformNode implements IDisposable, ICullabl
      * @see http://doc.babylonjs.com/how_to/how_to_use_facetdata
      */
     public getFacetLocalNormals(): Vector3[] {
-        if (!this._facetData.facetNormals) {
+        let facetData = this._internalAbstractMeshDataInfo._facetData;
+        if (!facetData.facetNormals) {
             this.updateFacetData();
         }
-        return this._facetData.facetNormals;
+        return facetData.facetNormals;
     }
 
     /**
@@ -1857,10 +1856,11 @@ export class AbstractMesh extends TransformNode implements IDisposable, ICullabl
      * @see http://doc.babylonjs.com/how_to/how_to_use_facetdata
      */
     public getFacetLocalPositions(): Vector3[] {
-        if (!this._facetData.facetPositions) {
+        let facetData = this._internalAbstractMeshDataInfo._facetData;
+        if (!facetData.facetPositions) {
             this.updateFacetData();
         }
-        return this._facetData.facetPositions;
+        return facetData.facetPositions;
     }
 
     /**
@@ -1869,10 +1869,12 @@ export class AbstractMesh extends TransformNode implements IDisposable, ICullabl
      * @see http://doc.babylonjs.com/how_to/how_to_use_facetdata
      */
     public getFacetLocalPartitioning(): number[][] {
-        if (!this._facetData.facetPartitioning) {
+        let facetData = this._internalAbstractMeshDataInfo._facetData;
+
+        if (!facetData.facetPartitioning) {
             this.updateFacetData();
         }
-        return this._facetData.facetPartitioning;
+        return facetData.facetPartitioning;
     }
 
     /**
@@ -1938,7 +1940,7 @@ export class AbstractMesh extends TransformNode implements IDisposable, ICullabl
      */
     public getFacetsAtLocalCoordinates(x: number, y: number, z: number): Nullable<number[]> {
         var bInfo = this.getBoundingInfo();
-        const data = this._facetData;
+        const data = this._internalAbstractMeshDataInfo._facetData;
 
         var ox = Math.floor((x - bInfo.minimum.x * data.partitioningBBoxRatio) * data.subDiv.X * data.partitioningBBoxRatio / data.bbSize.x);
         var oy = Math.floor((y - bInfo.minimum.y * data.partitioningBBoxRatio) * data.subDiv.Y * data.partitioningBBoxRatio / data.bbSize.y);
@@ -2047,7 +2049,7 @@ export class AbstractMesh extends TransformNode implements IDisposable, ICullabl
      * @see http://doc.babylonjs.com/how_to/how_to_use_facetdata
      */
     public getFacetDataParameters(): any {
-        return this._facetData.facetParameters;
+        return this._internalAbstractMeshDataInfo._facetData.facetParameters;
     }
 
     /**
@@ -2056,13 +2058,14 @@ export class AbstractMesh extends TransformNode implements IDisposable, ICullabl
      * @see http://doc.babylonjs.com/how_to/how_to_use_facetdata
      */
     public disableFacetData(): AbstractMesh {
-        if (this._facetData.facetDataEnabled) {
-            this._facetData.facetDataEnabled = false;
-            this._facetData.facetPositions = new Array<Vector3>();
-            this._facetData.facetNormals = new Array<Vector3>();
-            this._facetData.facetPartitioning = new Array<number[]>();
-            this._facetData.facetParameters = null;
-            this._facetData.depthSortedIndices = new Uint32Array(0);
+        let facetData = this._internalAbstractMeshDataInfo._facetData;
+        if (facetData.facetDataEnabled) {
+            facetData.facetDataEnabled = false;
+            facetData.facetPositions = new Array<Vector3>();
+            facetData.facetNormals = new Array<Vector3>();
+            facetData.facetPartitioning = new Array<number[]>();
+            facetData.facetParameters = null;
+            facetData.depthSortedIndices = new Uint32Array(0);
         }
         return this;
     }

+ 123 - 103
src/Meshes/mesh.ts

@@ -82,6 +82,32 @@ export class _InstancesBatch {
 }
 
 /**
+ * @hidden
+ **/
+class _InternalMeshDataInfo {
+    // Events
+    public _onBeforeRenderObservable: Nullable<Observable<Mesh>>;
+    public _onBeforeBindObservable: Nullable<Observable<Mesh>>;
+    public _onAfterRenderObservable: Nullable<Observable<Mesh>>;
+    public _onBeforeDrawObservable: Nullable<Observable<Mesh>>;
+
+    public _areNormalsFrozen: boolean = false; // Will be used by ribbons mainly
+    public _sourcePositions: Float32Array; // Will be used to save original positions when using software skinning
+    public _sourceNormals: Float32Array;   // Will be used to save original normals when using software skinning
+
+    // Will be used to save a source mesh reference, If any
+    public _source: Nullable<Mesh> = null;
+    // Will be used to for fast cloned mesh lookup
+    public meshMap: Nullable<{ [id: string]: Mesh | undefined }> = null;
+
+    public _preActivateId: number = -1;
+    public _LODLevels = new Array<MeshLODLevel>();
+
+    // Morph
+    public _morphTargetManager: Nullable<MorphTargetManager> = null;
+}
+
+/**
  * Class used to represent renderable models
  */
 export class Mesh extends AbstractMesh implements IGetSetVerticesData {
@@ -131,54 +157,51 @@ export class Mesh extends AbstractMesh implements IGetSetVerticesData {
         return orientation || Mesh.FRONTSIDE; // works as Mesh.FRONTSIDE is 0
     }
 
-    // Events
-    private _onBeforeRenderObservable: Nullable<Observable<Mesh>>;
-    private _onBeforeBindObservable: Nullable<Observable<Mesh>>;
-    private _onAfterRenderObservable: Nullable<Observable<Mesh>>;
-    private _onBeforeDrawObservable: Nullable<Observable<Mesh>>;
+    // Internal data
+    private _internalMeshDataInfo = new _InternalMeshDataInfo();
 
     /**
      * An event triggered before rendering the mesh
      */
     public get onBeforeRenderObservable(): Observable<Mesh> {
-        if (!this._onBeforeRenderObservable) {
-            this._onBeforeRenderObservable = new Observable<Mesh>();
+        if (!this._internalMeshDataInfo._onBeforeRenderObservable) {
+            this._internalMeshDataInfo._onBeforeRenderObservable = new Observable<Mesh>();
         }
 
-        return this._onBeforeRenderObservable;
+        return this._internalMeshDataInfo._onBeforeRenderObservable;
     }
 
     /**
      * An event triggered before binding the mesh
      */
     public get onBeforeBindObservable(): Observable<Mesh> {
-        if (!this._onBeforeBindObservable) {
-            this._onBeforeBindObservable = new Observable<Mesh>();
+        if (!this._internalMeshDataInfo._onBeforeBindObservable) {
+            this._internalMeshDataInfo._onBeforeBindObservable = new Observable<Mesh>();
         }
 
-        return this._onBeforeBindObservable;
+        return this._internalMeshDataInfo._onBeforeBindObservable;
     }
 
     /**
     * An event triggered after rendering the mesh
     */
     public get onAfterRenderObservable(): Observable<Mesh> {
-        if (!this._onAfterRenderObservable) {
-            this._onAfterRenderObservable = new Observable<Mesh>();
+        if (!this._internalMeshDataInfo._onAfterRenderObservable) {
+            this._internalMeshDataInfo._onAfterRenderObservable = new Observable<Mesh>();
         }
 
-        return this._onAfterRenderObservable;
+        return this._internalMeshDataInfo._onAfterRenderObservable;
     }
 
     /**
     * An event triggered before drawing the mesh
     */
     public get onBeforeDrawObservable(): Observable<Mesh> {
-        if (!this._onBeforeDrawObservable) {
-            this._onBeforeDrawObservable = new Observable<Mesh>();
+        if (!this._internalMeshDataInfo._onBeforeDrawObservable) {
+            this._internalMeshDataInfo._onBeforeDrawObservable = new Observable<Mesh>();
         }
 
-        return this._onBeforeDrawObservable;
+        return this._internalMeshDataInfo._onBeforeDrawObservable;
     }
 
     private _onBeforeDrawObserver: Nullable<Observer<Mesh>>;
@@ -216,7 +239,6 @@ export class Mesh extends AbstractMesh implements IGetSetVerticesData {
 
     /** @hidden */
     public _binaryInfo: any;
-    private _LODLevels = new Array<MeshLODLevel>();
 
     /**
      * User defined function used to change how LOD level selection is done
@@ -224,22 +246,19 @@ export class Mesh extends AbstractMesh implements IGetSetVerticesData {
      */
     public onLODLevelSelection: (distance: number, mesh: Mesh, selectedLevel: Nullable<Mesh>) => void;
 
-    // Morph
-    private _morphTargetManager: Nullable<MorphTargetManager> = null;
-
     /**
      * Gets or sets the morph target manager
      * @see http://doc.babylonjs.com/how_to/how_to_use_morphtargets
      */
     public get morphTargetManager(): Nullable<MorphTargetManager> {
-        return this._morphTargetManager;
+        return this._internalMeshDataInfo._morphTargetManager;
     }
 
     public set morphTargetManager(value: Nullable<MorphTargetManager>) {
-        if (this._morphTargetManager === value) {
+        if (this._internalMeshDataInfo._morphTargetManager === value) {
             return;
         }
-        this._morphTargetManager = value;
+        this._internalMeshDataInfo._morphTargetManager = value;
         this._syncGeometryWithMorphTargetManager();
     }
 
@@ -261,7 +280,6 @@ export class Mesh extends AbstractMesh implements IGetSetVerticesData {
 
     /** @hidden */
     public _shouldGenerateFlatShading: boolean = false;
-    private _preActivateId: number = -1;
 
     // Use by builder only to know what orientation were the mesh build in.
     /** @hidden */
@@ -272,21 +290,11 @@ export class Mesh extends AbstractMesh implements IGetSetVerticesData {
      */
     public overrideMaterialSideOrientation: Nullable<number> = null;
 
-    private _areNormalsFrozen: boolean = false; // Will be used by ribbons mainly
-
-    private _sourcePositions: Float32Array; // Will be used to save original positions when using software skinning
-    private _sourceNormals: Float32Array;   // Will be used to save original normals when using software skinning
-
-    // 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 }> = null;
-
     /**
      * Gets the source mesh (the one used to clone this one from)
      */
     public get source(): Nullable<Mesh> {
-        return this._source;
+        return this._internalMeshDataInfo._source;
     }
 
     /**
@@ -335,12 +343,12 @@ export class Mesh extends AbstractMesh implements IGetSetVerticesData {
                 ["_poseMatrix"]);
 
             // Source mesh
-            this._source = source;
+            this._internalMeshDataInfo._source = source;
             if (scene.useClonedMeshhMap) {
-                if (!source.meshMap) {
-                    source.meshMap = {};
+                if (!source._internalMeshDataInfo.meshMap) {
+                    source._internalMeshDataInfo.meshMap = {};
                 }
-                source.meshMap[this.uniqueId] = this;
+                source._internalMeshDataInfo.meshMap[this.uniqueId] = this;
             }
 
             // Construction Params
@@ -349,8 +357,8 @@ export class Mesh extends AbstractMesh implements IGetSetVerticesData {
             this._creationDataStorage = source._creationDataStorage;
 
             // Animation ranges
-            if (this._source._ranges) {
-                const ranges = this._source._ranges;
+            if (source._ranges) {
+                const ranges = source._ranges;
                 for (var name in ranges) {
                     if (!ranges.hasOwnProperty(name)) {
                         continue;
@@ -441,7 +449,9 @@ export class Mesh extends AbstractMesh implements IGetSetVerticesData {
     }
 
     /** @hidden */
-    public readonly _isMesh = true;
+    public get _isMesh() {
+        return true;
+    }
 
     /**
      * Returns a description of this mesh
@@ -488,7 +498,7 @@ export class Mesh extends AbstractMesh implements IGetSetVerticesData {
      * Gets a boolean indicating if this mesh has LOD
      */
     public get hasLODLevels(): boolean {
-        return this._LODLevels.length > 0;
+        return this._internalMeshDataInfo._LODLevels.length > 0;
     }
 
     /**
@@ -496,11 +506,11 @@ export class Mesh extends AbstractMesh implements IGetSetVerticesData {
      * @returns an array of MeshLODLevel
      */
     public getLODLevels(): MeshLODLevel[] {
-        return this._LODLevels;
+        return this._internalMeshDataInfo._LODLevels;
     }
 
     private _sortLODLevels(): void {
-        this._LODLevels.sort((a, b) => {
+        this._internalMeshDataInfo._LODLevels.sort((a, b) => {
             if (a.distance < b.distance) {
                 return 1;
             }
@@ -526,7 +536,7 @@ export class Mesh extends AbstractMesh implements IGetSetVerticesData {
         }
 
         var level = new MeshLODLevel(distance, mesh);
-        this._LODLevels.push(level);
+        this._internalMeshDataInfo._LODLevels.push(level);
 
         if (mesh) {
             mesh._masterMesh = this;
@@ -544,8 +554,9 @@ export class Mesh extends AbstractMesh implements IGetSetVerticesData {
      * @returns a Mesh or `null`
      */
     public getLODLevelAtDistance(distance: number): Nullable<Mesh> {
-        for (var index = 0; index < this._LODLevels.length; index++) {
-            var level = this._LODLevels[index];
+        let internalDataInfo = this._internalMeshDataInfo;
+        for (var index = 0; index < internalDataInfo._LODLevels.length; index++) {
+            var level = internalDataInfo._LODLevels[index];
 
             if (level.distance === distance) {
                 return level.mesh;
@@ -561,10 +572,10 @@ export class Mesh extends AbstractMesh implements IGetSetVerticesData {
      * @return This mesh (for chaining)
      */
     public removeLODLevel(mesh: Mesh): Mesh {
-
-        for (var index = 0; index < this._LODLevels.length; index++) {
-            if (this._LODLevels[index].mesh === mesh) {
-                this._LODLevels.splice(index, 1);
+        let internalDataInfo = this._internalMeshDataInfo;
+        for (var index = 0; index < internalDataInfo._LODLevels.length; index++) {
+            if (internalDataInfo._LODLevels[index].mesh === mesh) {
+                internalDataInfo._LODLevels.splice(index, 1);
                 if (mesh) {
                     mesh._masterMesh = null;
                 }
@@ -583,7 +594,8 @@ export class Mesh extends AbstractMesh implements IGetSetVerticesData {
      * @return This mesh (for chaining)
      */
     public getLOD(camera: Camera, boundingSphere?: BoundingSphere): Nullable<AbstractMesh> {
-        if (!this._LODLevels || this._LODLevels.length === 0) {
+        let internalDataInfo = this._internalMeshDataInfo;
+        if (!internalDataInfo._LODLevels || internalDataInfo._LODLevels.length === 0) {
             return this;
         }
 
@@ -599,15 +611,15 @@ export class Mesh extends AbstractMesh implements IGetSetVerticesData {
 
         var distanceToCamera = bSphere.centerWorld.subtract(camera.globalPosition).length();
 
-        if (this._LODLevels[this._LODLevels.length - 1].distance > distanceToCamera) {
+        if (internalDataInfo._LODLevels[internalDataInfo._LODLevels.length - 1].distance > distanceToCamera) {
             if (this.onLODLevelSelection) {
-                this.onLODLevelSelection(distanceToCamera, this, this._LODLevels[this._LODLevels.length - 1].mesh);
+                this.onLODLevelSelection(distanceToCamera, this, internalDataInfo._LODLevels[internalDataInfo._LODLevels.length - 1].mesh);
             }
             return this;
         }
 
-        for (var index = 0; index < this._LODLevels.length; index++) {
-            var level = this._LODLevels[index];
+        for (var index = 0; index < internalDataInfo._LODLevels.length; index++) {
+            var level = internalDataInfo._LODLevels[index];
 
             if (level.distance < distanceToCamera) {
                 if (level.mesh) {
@@ -878,7 +890,7 @@ export class Mesh extends AbstractMesh implements IGetSetVerticesData {
         }
 
         // LOD
-        for (var lod of this._LODLevels) {
+        for (var lod of this._internalMeshDataInfo._LODLevels) {
             if (lod.mesh && !lod.mesh.isReady(hardwareInstancedRendering)) {
                 return false;
             }
@@ -891,7 +903,7 @@ export class Mesh extends AbstractMesh implements IGetSetVerticesData {
      * Gets a boolean indicating if the normals aren't to be recomputed on next mesh `positions` array update. This property is pertinent only for updatable parametric shapes.
      */
     public get areNormalsFrozen(): boolean {
-        return this._areNormalsFrozen;
+        return this._internalMeshDataInfo._areNormalsFrozen;
     }
 
     /**
@@ -899,7 +911,7 @@ export class Mesh extends AbstractMesh implements IGetSetVerticesData {
      * @returns the current mesh
      */
     public freezeNormals(): Mesh {
-        this._areNormalsFrozen = true;
+        this._internalMeshDataInfo._areNormalsFrozen = true;
         return this;
     }
 
@@ -908,7 +920,7 @@ export class Mesh extends AbstractMesh implements IGetSetVerticesData {
      * @returns the current mesh
      */
     public unfreezeNormals(): Mesh {
-        this._areNormalsFrozen = false;
+        this._internalMeshDataInfo._areNormalsFrozen = false;
         return this;
     }
 
@@ -922,12 +934,13 @@ export class Mesh extends AbstractMesh implements IGetSetVerticesData {
     // Methods
     /** @hidden */
     public _preActivate(): Mesh {
+        let internalDataInfo = this._internalMeshDataInfo;
         var sceneRenderId = this.getScene().getRenderId();
-        if (this._preActivateId === sceneRenderId) {
+        if (internalDataInfo._preActivateId === sceneRenderId) {
             return this;
         }
 
-        this._preActivateId = sceneRenderId;
+        internalDataInfo._preActivateId = sceneRenderId;
         this._instanceDataStorage.visibleInstances = null;
         return this;
     }
@@ -1292,8 +1305,8 @@ export class Mesh extends AbstractMesh implements IGetSetVerticesData {
             return this;
         }
 
-        if (this._onBeforeDrawObservable) {
-            this._onBeforeDrawObservable.notifyObservers(this);
+        if (this._internalMeshDataInfo._onBeforeDrawObservable) {
+            this._internalMeshDataInfo._onBeforeDrawObservable.notifyObservers(this);
         }
 
         let scene = this.getScene();
@@ -1524,8 +1537,8 @@ export class Mesh extends AbstractMesh implements IGetSetVerticesData {
             return this;
         }
 
-        if (this._onBeforeRenderObservable) {
-            this._onBeforeRenderObservable.notifyObservers(this);
+        if (this._internalMeshDataInfo._onBeforeRenderObservable) {
+            this._internalMeshDataInfo._onBeforeRenderObservable.notifyObservers(this);
         }
 
         var engine = scene.getEngine();
@@ -1597,8 +1610,8 @@ export class Mesh extends AbstractMesh implements IGetSetVerticesData {
         // Bind
         var fillMode = scene.forcePointsCloud ? Material.PointFillMode : (scene.forceWireframe ? Material.WireFrameFillMode : this._effectiveMaterial.fillMode);
 
-        if (this._onBeforeBindObservable) {
-            this._onBeforeBindObservable.notifyObservers(this);
+        if (this._internalMeshDataInfo._onBeforeBindObservable) {
+            this._internalMeshDataInfo._onBeforeBindObservable.notifyObservers(this);
         }
 
         if (!hardwareInstancedRendering) { // Binding will be done later because we need to add more info to the VB
@@ -1629,8 +1642,8 @@ export class Mesh extends AbstractMesh implements IGetSetVerticesData {
             step.action(this, subMesh, batch);
         }
 
-        if (this._onAfterRenderObservable) {
-            this._onAfterRenderObservable.notifyObservers(this);
+        if (this._internalMeshDataInfo._onAfterRenderObservable) {
+            this._internalMeshDataInfo._onAfterRenderObservable.notifyObservers(this);
         }
         return this;
     }
@@ -2024,49 +2037,51 @@ export class Mesh extends AbstractMesh implements IGetSetVerticesData {
             this._geometry.releaseForMesh(this, true);
         }
 
-        if (this._onBeforeDrawObservable) {
-            this._onBeforeDrawObservable.clear();
+        let internalDataInfo = this._internalMeshDataInfo;
+
+        if (internalDataInfo._onBeforeDrawObservable) {
+            internalDataInfo._onBeforeDrawObservable.clear();
         }
 
-        if (this._onBeforeBindObservable) {
-            this._onBeforeBindObservable.clear();
+        if (internalDataInfo._onBeforeBindObservable) {
+            internalDataInfo._onBeforeBindObservable.clear();
         }
 
-        if (this._onBeforeRenderObservable) {
-            this._onBeforeRenderObservable.clear();
+        if (internalDataInfo._onBeforeRenderObservable) {
+            internalDataInfo._onBeforeRenderObservable.clear();
         }
 
-        if (this._onAfterRenderObservable) {
-            this._onAfterRenderObservable.clear();
+        if (internalDataInfo._onAfterRenderObservable) {
+            internalDataInfo._onAfterRenderObservable.clear();
         }
 
         // Sources
         if (this._scene.useClonedMeshhMap) {
-            if (this.meshMap) {
-                for (const uniqueId in this.meshMap) {
-                    const mesh = this.meshMap[uniqueId];
+            if (internalDataInfo.meshMap) {
+                for (const uniqueId in internalDataInfo.meshMap) {
+                    const mesh = internalDataInfo.meshMap[uniqueId];
                     if (mesh) {
-                        mesh._source = null;
-                        this.meshMap[uniqueId] = undefined;
+                        mesh._internalMeshDataInfo._source = null;
+                        internalDataInfo.meshMap[uniqueId] = undefined;
                     }
                 }
             }
 
-            if (this._source && this._source.meshMap) {
-                this._source.meshMap[this.uniqueId] = undefined;
+            if (internalDataInfo._source && internalDataInfo._source._internalMeshDataInfo.meshMap) {
+                internalDataInfo._source._internalMeshDataInfo.meshMap[this.uniqueId] = undefined;
             }
         }
         else {
             var meshes = this.getScene().meshes;
             for (const abstractMesh of meshes) {
                 let mesh = abstractMesh as Mesh;
-                if (mesh._source && mesh._source === this) {
-                    mesh._source = null;
+                if (mesh._internalMeshDataInfo && mesh._internalMeshDataInfo._source && mesh._internalMeshDataInfo._source === this) {
+                    mesh._internalMeshDataInfo._source = null;
                 }
             }
         }
 
-        this._source = null;
+        internalDataInfo._source = null;
 
         // Instances
         if (this._instanceDataStorage.instancesBuffer) {
@@ -2842,7 +2857,7 @@ export class Mesh extends AbstractMesh implements IGetSetVerticesData {
 
         this._markSubMeshesAsAttributesDirty();
 
-        let morphTargetManager = this._morphTargetManager;
+        let morphTargetManager = this._internalMeshDataInfo._morphTargetManager;
         if (morphTargetManager && morphTargetManager.vertexCount) {
             if (morphTargetManager.vertexCount !== this.getTotalVertices()) {
                 Logger.Error("Mesh is incompatible with morph targets. Targets and mesh must all have the same vertices count.");
@@ -3599,19 +3614,20 @@ export class Mesh extends AbstractMesh implements IGetSetVerticesData {
      * @returns original positions used for CPU skinning. Useful for integrating Morphing with skeletons in same mesh
      */
     public setPositionsForCPUSkinning(): Float32Array {
-        if (!this._sourcePositions) {
+        let internalDataInfo = this._internalMeshDataInfo;
+        if (!internalDataInfo._sourcePositions) {
             let source = this.getVerticesData(VertexBuffer.PositionKind);
             if (!source) {
-                return this._sourcePositions;
+                return internalDataInfo._sourcePositions;
             }
 
-            this._sourcePositions = new Float32Array(<any>source);
+            internalDataInfo._sourcePositions = new Float32Array(<any>source);
 
             if (!this.isVertexBufferUpdatable(VertexBuffer.PositionKind)) {
                 this.setVerticesData(VertexBuffer.PositionKind, source, true);
             }
         }
-        return this._sourcePositions;
+        return internalDataInfo._sourcePositions;
     }
 
     /**
@@ -3619,20 +3635,22 @@ export class Mesh extends AbstractMesh implements IGetSetVerticesData {
      * @returns original normals used for CPU skinning. Useful for integrating Morphing with skeletons in same mesh.
      */
     public setNormalsForCPUSkinning(): Float32Array {
-        if (!this._sourceNormals) {
+        let internalDataInfo = this._internalMeshDataInfo;
+
+        if (!internalDataInfo._sourceNormals) {
             let source = this.getVerticesData(VertexBuffer.NormalKind);
 
             if (!source) {
-                return this._sourceNormals;
+                return internalDataInfo._sourceNormals;
             }
 
-            this._sourceNormals = new Float32Array(<any>source);
+            internalDataInfo._sourceNormals = new Float32Array(<any>source);
 
             if (!this.isVertexBufferUpdatable(VertexBuffer.NormalKind)) {
                 this.setVerticesData(VertexBuffer.NormalKind, source, true);
             }
         }
-        return this._sourceNormals;
+        return internalDataInfo._sourceNormals;
     }
 
     /**
@@ -3664,13 +3682,15 @@ export class Mesh extends AbstractMesh implements IGetSetVerticesData {
             return this;
         }
 
-        if (!this._sourcePositions) {
+        let internalDataInfo = this._internalMeshDataInfo;
+
+        if (!internalDataInfo._sourcePositions) {
             var submeshes = this.subMeshes.slice();
             this.setPositionsForCPUSkinning();
             this.subMeshes = submeshes;
         }
 
-        if (!this._sourceNormals) {
+        if (!internalDataInfo._sourceNormals) {
             this.setNormalsForCPUSkinning();
         }
 
@@ -3734,10 +3754,10 @@ export class Mesh extends AbstractMesh implements IGetSetVerticesData {
                 }
             }
 
-            Vector3.TransformCoordinatesFromFloatsToRef(this._sourcePositions[index], this._sourcePositions[index + 1], this._sourcePositions[index + 2], finalMatrix, tempVector3);
+            Vector3.TransformCoordinatesFromFloatsToRef(internalDataInfo._sourcePositions[index], internalDataInfo._sourcePositions[index + 1], internalDataInfo._sourcePositions[index + 2], finalMatrix, tempVector3);
             tempVector3.toArray(positionsData, index);
 
-            Vector3.TransformNormalFromFloatsToRef(this._sourceNormals[index], this._sourceNormals[index + 1], this._sourceNormals[index + 2], finalMatrix, tempVector3);
+            Vector3.TransformNormalFromFloatsToRef(internalDataInfo._sourceNormals[index], internalDataInfo._sourceNormals[index + 1], internalDataInfo._sourceNormals[index + 2], finalMatrix, tempVector3);
             tempVector3.toArray(normalsData, index);
 
             finalMatrix.reset();

+ 1 - 2
src/Meshes/transformNode.ts

@@ -912,12 +912,11 @@ export class TransformNode extends Node {
      * @returns the world matrix
      */
     public computeWorldMatrix(force?: boolean): Matrix {
-        let currentRenderId = this.getScene().getRenderId();
-
         if (this._isWorldMatrixFrozen && !this._isDirty) {
             return this._worldMatrix;
         }
 
+        let currentRenderId = this.getScene().getRenderId();
         if (!this._isDirty && !force && this.isSynchronized()) {
             this._currentRenderId = currentRenderId;
             return this._worldMatrix;

+ 4 - 4
src/Physics/Plugins/ammoJSPlugin.ts

@@ -410,7 +410,7 @@ export class AmmoJSPlugin implements IPhysicsEnginePlugin {
                 colShape.setActivationState(AmmoJSPlugin.DISABLE_DEACTIVATION_FLAG);
                 this.world.addSoftBody(colShape, 1, -1);
                 impostor.physicsBody = colShape;
-                impostor._pluginData.toDispose.concat([colShape]);
+                impostor._pluginData.toDispose.push(colShape);
                 this.setBodyPressure(impostor, 0);
                 if (impostor.type === PhysicsImpostor.SoftbodyImpostor) {
                     this.setBodyPressure(impostor, impostor.getParam("pressure"));
@@ -447,7 +447,7 @@ export class AmmoJSPlugin implements IPhysicsEnginePlugin {
 
                 this.world.addRigidBody(body);
                 impostor.physicsBody = body;
-                impostor._pluginData.toDispose.concat([body, rbInfo, myMotionState, startTransform, localInertia, colShape]);
+                impostor._pluginData.toDispose = impostor._pluginData.toDispose.concat([body, rbInfo, myMotionState, startTransform, localInertia, colShape]);
             }
             this.setBodyRestitution(impostor, impostor.getParam("restitution"));
             this.setBodyFriction(impostor, impostor.getParam("friction"));
@@ -915,7 +915,7 @@ export class AmmoJSPlugin implements IPhysicsEnginePlugin {
                     // Only create btBvhTriangleMeshShape impostor is static
                     // See https://pybullet.org/Bullet/phpBB3/viewtopic.php?t=7283
                     var tetraMesh = new Ammo.btTriangleMesh();
-                    impostor._pluginData.toDispose.concat([tetraMesh]);
+                    impostor._pluginData.toDispose.push(tetraMesh);
                     var triangeCount = this._addMeshVerts(tetraMesh, object, object);
                     if (triangeCount == 0) {
                         returnValue = new Ammo.btCompoundShape();
@@ -930,7 +930,7 @@ export class AmmoJSPlugin implements IPhysicsEnginePlugin {
                 var triangeCount = this._addHullVerts(convexMesh, object, object);
                 if (triangeCount == 0) {
                     // Cleanup Unused Convex Hull Shape
-                    impostor._pluginData.toDispose.concat([convexMesh]);
+                    impostor._pluginData.toDispose.push(convexMesh);
                     returnValue = new Ammo.btCompoundShape();
                 } else {
                     returnValue = convexMesh;

+ 3 - 1
src/Shaders/pbr.fragment.fx

@@ -955,7 +955,9 @@ void main(void) {
             // Tint reflectance
             environmentRefraction.rgb *= volumeAlbedo;
         #else
-            // Nothing to change for refraction.
+            // Compute tint from min distance only.
+            vec3 volumeAlbedo = computeColorAtDistanceInMedia(vTintColor.rgb, vTintColor.w);
+            refractionTransmittance *= cocaLambert(volumeAlbedo, vThicknessParam.y);
         #endif
 
         // Decrease Albedo Contribution

+ 50 - 0
tests/unit/babylon/src/Mesh/babylon.dictionaryMode.tests.ts

@@ -0,0 +1,50 @@
+/**
+ * Describes the test suite.
+ */
+describe('Babylon Mesh', () => {
+    let subject: BABYLON.Engine;
+
+    /**
+     * Loads the dependencies.
+     */
+    before(function(done) {
+        this.timeout(180000);
+        (BABYLONDEVTOOLS).Loader
+            .useDist()
+            .testMode()
+            .load(function() {
+                // Force apply promise polyfill for consistent behavior between chrome headless, IE11, and other browsers.
+                BABYLON.PromisePolyfill.Apply(true);
+                done();
+            });
+    });
+
+    /**
+     * Create a new engine subject before each test.
+     */
+    beforeEach(function() {
+        subject = new BABYLON.NullEngine({
+            renderHeight: 256,
+            renderWidth: 256,
+            textureSize: 256,
+            deterministicLockstep: false,
+            lockstepMaxSteps: 1
+        });
+    });
+
+    describe('#Mesh dictionary mode threshold', () => {
+        it('No more than 128 own properties on a mesh', () => {
+            const scene = new BABYLON.Scene(subject);
+            const mesh = BABYLON.Mesh.CreateGround("ground1", 6, 6, 2, scene);
+
+            var count = 0;
+            for (var prop in mesh) {
+                if (mesh.hasOwnProperty(prop)) {
+                    count++;
+                }
+            }
+
+            expect(count).to.lessThan(128);
+        });
+    });
+});

+ 2 - 1
tests/unit/karma.conf.js

@@ -1,4 +1,4 @@
-module.exports = function (config) {
+module.exports = function(config) {
     config.set({
         basePath: '../../',
         captureTimeout: 3e5,
@@ -23,6 +23,7 @@ module.exports = function (config) {
             './tests/unit/babylon/src/Loading/babylon.sceneLoader.tests.js',
             './tests/unit/babylon/src/PostProcess/babylon.postProcess.tests.js',
             './tests/unit/babylon/src/Material/babylon.material.tests.js',
+            './tests/unit/babylon/src/Mesh/babylon.dictionaryMode.tests.js',
             './tests/unit/babylon/src/Mesh/babylon.geometry.tests.js',
             './tests/unit/babylon/src/Mesh/babylon.mesh.vertexData.tests.js',
             './tests/unit/babylon/src/Tools/babylon.promise.tests.js',