David Catuhe 6 年之前
父節點
當前提交
2cc49d2b03

+ 15 - 34
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

+ 23 - 35
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>;
         /**

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


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


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


+ 52 - 71
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>;
         /**
@@ -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>;
         /**

+ 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__;
 
 /***/ })
 

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


+ 52 - 71
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>;
         /**
@@ -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>;
         /**

+ 1 - 15
dist/preview release/viewer/babylon.viewer.d.ts

@@ -951,7 +951,7 @@ declare module BabylonViewer {
       * @param name the name of the custom optimizer configuration
       * @param upgrade set to true if you want to upgrade optimizer and false if you want to degrade
       */
-    export function getCustomOptimizerByName(name: string, upgrade?: boolean): typeof extendedUpgrade;
+    export function getCustomOptimizerByName(name: string, upgrade?: boolean): (sceneManager: SceneManager) => boolean;
     export function registerCustomOptimizer(name: string, optimizer: (sceneManager: SceneManager) => boolean): void;
 }
 declare module BabylonViewer {
@@ -1594,20 +1594,6 @@ declare module BabylonViewer {
     export function addLoaderPlugin(name: string, plugin: ILoaderPlugin): void;
 }
 declare module BabylonViewer {
-    /**
-        * A custom upgrade-oriented function configuration for the scene optimizer.
-        *
-        * @param viewer the viewer to optimize
-        */
-    export function extendedUpgrade(sceneManager: SceneManager): boolean;
-    /**
-        * A custom degrade-oriented function configuration for the scene optimizer.
-        *
-        * @param viewer the viewer to optimize
-        */
-    export function extendedDegrade(sceneManager: SceneManager): boolean;
-}
-declare module BabylonViewer {
     export interface IEnvironmentMapConfiguration {
             /**
                 * Environment map texture path in relative to the asset folder.

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


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


+ 1 - 18
dist/preview release/viewer/babylon.viewer.module.d.ts

@@ -1031,14 +1031,13 @@ declare module 'babylonjs-viewer/templating/viewerTemplatePlugin' {
 }
 
 declare module 'babylonjs-viewer/optimizer/custom' {
-    import { extendedUpgrade } from "babylonjs-viewer/optimizer/custom/extended";
     import { SceneManager } from "babylonjs-viewer/managers/sceneManager";
     /**
       *
       * @param name the name of the custom optimizer configuration
       * @param upgrade set to true if you want to upgrade optimizer and false if you want to degrade
       */
-    export function getCustomOptimizerByName(name: string, upgrade?: boolean): typeof extendedUpgrade;
+    export function getCustomOptimizerByName(name: string, upgrade?: boolean): (sceneManager: SceneManager) => boolean;
     export function registerCustomOptimizer(name: string, optimizer: (sceneManager: SceneManager) => boolean): void;
 }
 
@@ -1738,22 +1737,6 @@ declare module 'babylonjs-viewer/loader/plugins' {
     export function addLoaderPlugin(name: string, plugin: ILoaderPlugin): void;
 }
 
-declare module 'babylonjs-viewer/optimizer/custom/extended' {
-    import { SceneManager } from 'babylonjs-viewer/managers/sceneManager';
-    /**
-        * A custom upgrade-oriented function configuration for the scene optimizer.
-        *
-        * @param viewer the viewer to optimize
-        */
-    export function extendedUpgrade(sceneManager: SceneManager): boolean;
-    /**
-        * A custom degrade-oriented function configuration for the scene optimizer.
-        *
-        * @param viewer the viewer to optimize
-        */
-    export function extendedDegrade(sceneManager: SceneManager): boolean;
-}
-
 declare module 'babylonjs-viewer/configuration/interfaces' {
     export * from 'babylonjs-viewer/configuration/interfaces/cameraConfiguration';
     export * from 'babylonjs-viewer/configuration/interfaces/colorGradingConfiguration';

+ 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>>;
+}

+ 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._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();