Selaa lähdekoodia

remove BABYLON.

Trevor Baron 6 vuotta sitten
vanhempi
commit
0aa1690ef2
65 muutettua tiedostoa jossa 471 lisäystä ja 464 poistoa
  1. 13 11
      src/Cameras/XR/webXRInput.ts
  2. 13 12
      src/Cameras/XR/webXRSessionManager.ts
  3. 1 1
      src/Culling/Octrees/octreeSceneComponent.ts
  4. 1 1
      src/Culling/boundingInfo.ts
  5. 1 1
      src/Debug/debugLayer.ts
  6. 3 3
      src/Debug/skeletonViewer.ts
  7. 22 22
      src/Engine/engine.ts
  8. 5 5
      src/Events/keyboardEvents.ts
  9. 4 4
      src/Events/pointerEvents.ts
  10. 3 3
      src/Gamepad/Controllers/gearVRController.ts
  11. 8 7
      src/Gamepad/Controllers/poseEnabledController.ts
  12. 10 9
      src/Gizmos/axisDragGizmo.ts
  13. 6 6
      src/Gizmos/axisScaleGizmo.ts
  14. 30 29
      src/Gizmos/boundingBoxGizmo.ts
  15. 1 1
      src/Gizmos/gizmo.ts
  16. 7 5
      src/Gizmos/gizmoManager.ts
  17. 8 7
      src/Gizmos/planeRotationGizmo.ts
  18. 4 4
      src/Gizmos/positionGizmo.ts
  19. 4 5
      src/Gizmos/rotationGizmo.ts
  20. 8 10
      src/Gizmos/scaleGizmo.ts
  21. 1 1
      src/Helpers/photoDome.ts
  22. 6 8
      src/Helpers/sceneHelpers.ts
  23. 1 1
      src/Helpers/videoDome.ts
  24. 0 2
      src/Layer/glowLayer.ts
  25. 1 1
      src/Layer/highlightLayer.ts
  26. 3 3
      src/LensFlare/lensFlare.ts
  27. 2 2
      src/LensFlare/lensFlareSystem.ts
  28. 1 3
      src/Lights/light.ts
  29. 2 2
      src/Lights/pointLight.ts
  30. 9 9
      src/Loading/sceneLoader.ts
  31. 1 1
      src/Materials/Textures/cubeTexture.ts
  32. 2 2
      src/Materials/Textures/dynamicTexture.ts
  33. 1 1
      src/Materials/Textures/hdrCubeTexture.ts
  34. 1 1
      src/Materials/Textures/internalTexture.ts
  35. 1 1
      src/Materials/Textures/mirrorTexture.ts
  36. 3 3
      src/Materials/Textures/rawCubeTexture.ts
  37. 1 1
      src/Materials/Textures/rawTexture3D.ts
  38. 1 1
      src/Materials/Textures/refractionTexture.ts
  39. 1 1
      src/Materials/imageProcessingConfiguration.ts
  40. 2 2
      src/Materials/materialHelper.ts
  41. 2 2
      src/Materials/shaderMaterial.ts
  42. 2 2
      src/Math/math.ts
  43. 4 4
      src/Mesh/Compression/dracoCompression.ts
  44. 26 25
      src/Mesh/abstractMesh.ts
  45. 1 1
      src/Mesh/buffer.ts
  46. 21 21
      src/Mesh/csg.ts
  47. 16 16
      src/Mesh/geometry.ts
  48. 24 24
      src/Mesh/instancedMesh.ts
  49. 102 102
      src/Mesh/mesh.ts
  50. 24 24
      src/Mesh/mesh.vertexData.ts
  51. 19 19
      src/Mesh/meshBuilder.ts
  52. 3 3
      src/Mesh/transformNode.ts
  53. 2 2
      src/Particles/particle.ts
  54. 4 4
      src/Particles/particleHelper.ts
  55. 1 1
      src/Particles/particleSystem.ts
  56. 2 1
      src/Particles/particleSystemSet.ts
  57. 1 1
      src/Particles/subEmitter.ts
  58. 3 3
      src/PostProcess/RenderPipeline/Pipelines/defaultRenderingPipeline.ts
  59. 1 1
      src/PostProcess/RenderPipeline/Pipelines/standardRenderingPipeline.ts
  60. 2 1
      src/PostProcess/bloomEffect.ts
  61. 2 1
      src/PostProcess/circleOfConfusionPostProcess.ts
  62. 2 2
      src/PostProcess/depthOfFieldEffect.ts
  63. 2 1
      src/PostProcess/extractHighlightsPostProcess.ts
  64. 12 11
      src/Rendering/utilityLayerRenderer.ts
  65. 1 0
      src/Tools/tools.ts

+ 13 - 11
src/Cameras/XR/webXRInput.ts

@@ -1,7 +1,9 @@
 import { Observer } from "Tools";
 import { Nullable } from "types";
 import { WebXRExperienceHelper } from "Cameras";
-import { IDisposable } from "scene";
+import { IDisposable, Scene } from "scene";
+import { AbstractMesh } from "Mesh";
+import { Matrix, Quaternion } from "Math";
     /**
      * Represents an XR input
      */
@@ -9,19 +11,19 @@ import { IDisposable } from "scene";
         /**
          * Represents the part of the controller that is held. This may not exist if the controller is the head mounted display itself, if thats the case only the pointer from the head will be availible
          */
-        public grip?: BABYLON.AbstractMesh;
+        public grip?: AbstractMesh;
         /**
          * Pointer which can be used to select objects or attach a visible laser to
          */
-        public pointer: BABYLON.AbstractMesh;
+        public pointer: AbstractMesh;
 
         /**
          * Creates the controller
          * @see https://doc.babylonjs.com/how_to/webxr
          * @param scene the scene which the controller should be associated to
          */
-        constructor(scene: BABYLON.Scene) {
-            this.pointer = new BABYLON.AbstractMesh("controllerPointer", scene);
+        constructor(scene: Scene) {
+            this.pointer = new AbstractMesh("controllerPointer", scene);
         }
         /**
          * Disposes of the object
@@ -42,7 +44,7 @@ import { IDisposable } from "scene";
          * XR controllers being tracked
          */
         public controllers: Array<WebXRController> = [];
-        private _tmpMatrix = new BABYLON.Matrix();
+        private _tmpMatrix = new Matrix();
         private _frameObserver: Nullable<Observer<any>>;
 
         /**
@@ -69,25 +71,25 @@ import { IDisposable } from "scene";
                         // Manage the grip if it exists
                         if (inputPose.gripMatrix) {
                             if (!controller.grip) {
-                                controller.grip = new BABYLON.AbstractMesh("controllerGrip", helper.container.getScene());
+                                controller.grip = new AbstractMesh("controllerGrip", helper.container.getScene());
                             }
-                            BABYLON.Matrix.FromFloat32ArrayToRefScaled(inputPose.gripMatrix, 0, 1, this._tmpMatrix);
+                            Matrix.FromFloat32ArrayToRefScaled(inputPose.gripMatrix, 0, 1, this._tmpMatrix);
                             if (!controller.grip.getScene().useRightHandedSystem) {
                                 this._tmpMatrix.toggleModelMatrixHandInPlace();
                             }
                             if (!controller.grip.rotationQuaternion) {
-                                controller.grip.rotationQuaternion = new BABYLON.Quaternion();
+                                controller.grip.rotationQuaternion = new Quaternion();
                             }
                             this._tmpMatrix.decompose(controller.grip.scaling, controller.grip.rotationQuaternion, controller.grip.position);
                         }
 
                         // Manager pointer of controller
-                        BABYLON.Matrix.FromFloat32ArrayToRefScaled(inputPose.targetRay.transformMatrix, 0, 1, this._tmpMatrix);
+                        Matrix.FromFloat32ArrayToRefScaled(inputPose.targetRay.transformMatrix, 0, 1, this._tmpMatrix);
                         if (!controller.pointer.getScene().useRightHandedSystem) {
                             this._tmpMatrix.toggleModelMatrixHandInPlace();
                         }
                         if (!controller.pointer.rotationQuaternion) {
-                            controller.pointer.rotationQuaternion = new BABYLON.Quaternion();
+                            controller.pointer.rotationQuaternion = new Quaternion();
                         }
                         this._tmpMatrix.decompose(controller.pointer.scaling, controller.pointer.rotationQuaternion, controller.pointer.position);
                     }

+ 13 - 12
src/Cameras/XR/webXRSessionManager.ts

@@ -1,8 +1,9 @@
 import { Observable } from "Tools";
 import { Nullable } from "types";
-import { IDisposable } from "scene";
-import { Vector3 } from "Math";
-import { RenderTargetTexture } from "Materials";
+import { IDisposable, Scene } from "scene";
+import { Vector3, Matrix } from "Math";
+import { RenderTargetTexture, InternalTexture } from "Materials";
+import { Ray } from "Culling";
     /**
      * Manages an XRSession
      * @see https://doc.babylonjs.com/how_to/webxr
@@ -11,11 +12,11 @@ import { RenderTargetTexture } from "Materials";
         /**
          * Fires every time a new xrFrame arrives which can be used to update the camera
          */
-        public onXRFrameObservable: Observable<any> = new BABYLON.Observable<any>();
+        public onXRFrameObservable: Observable<any> = new Observable<any>();
         /**
          * Fires when the xr session is ended either by the device or manually done
          */
-        public onXRSessionEnded: Observable<any> = new BABYLON.Observable<any>();
+        public onXRSessionEnded: Observable<any> = new Observable<any>();
 
         /** @hidden */
         public _xrSession: XRSession;
@@ -27,13 +28,13 @@ import { RenderTargetTexture } from "Materials";
         public _currentXRFrame: Nullable<XRFrame>;
         private _xrNavigator: any;
         private _xrDevice: XRDevice;
-        private _tmpMatrix = new BABYLON.Matrix();
+        private _tmpMatrix = new Matrix();
 
         /**
          * Constructs a WebXRSessionManager, this must be initialized within a user action before usage
          * @param scene The scene which the session should be created for
          */
-        constructor(private scene: BABYLON.Scene) {
+        constructor(private scene: Scene) {
 
         }
 
@@ -116,7 +117,7 @@ import { RenderTargetTexture } from "Materials";
          * @param ray ray to cast into the environment
          * @returns Promise which resolves with a collision point in the environment if it exists
          */
-        public environmentPointHitTestAsync(ray: BABYLON.Ray): Promise<Nullable<Vector3>> {
+        public environmentPointHitTestAsync(ray: Ray): Promise<Nullable<Vector3>> {
             return new Promise((res) => {
                 // Compute left handed inputs to request hit test
                 var origin = new Float32Array([ray.origin.x, ray.origin.y, ray.origin.z]);
@@ -130,7 +131,7 @@ import { RenderTargetTexture } from "Materials";
                 this._xrSession.requestHitTest(origin, direction, this._frameOfReference)
                 .then((hits: any) => {
                     if (hits.length > 0) {
-                        BABYLON.Matrix.FromFloat32ArrayToRefScaled(hits[0].hitMatrix, 0, 1.0, this._tmpMatrix);
+                        Matrix.FromFloat32ArrayToRefScaled(hits[0].hitMatrix, 0, 1.0, this._tmpMatrix);
                         var hitPoint = this._tmpMatrix.getTranslation();
                         if (!this.scene.useRightHandedSystem) {
                             hitPoint.z *= -1;
@@ -164,15 +165,15 @@ import { RenderTargetTexture } from "Materials";
          * @param session session to create render target for
          * @param scene scene the new render target should be created for
          */
-        public static _CreateRenderTargetTextureFromSession(session: XRSession, scene: BABYLON.Scene) {
+        public static _CreateRenderTargetTextureFromSession(session: XRSession, scene: Scene) {
             // Create internal texture
-            var internalTexture = new BABYLON.InternalTexture(scene.getEngine(), BABYLON.InternalTexture.DATASOURCE_UNKNOWN, true);
+            var internalTexture = new InternalTexture(scene.getEngine(), InternalTexture.DATASOURCE_UNKNOWN, true);
             internalTexture.width = session.baseLayer.framebufferWidth;
             internalTexture.height = session.baseLayer.framebufferHeight;
             internalTexture._framebuffer = session.baseLayer.framebuffer;
 
              // Create render target texture from the internal texture
-            var renderTargetTexture = new BABYLON.RenderTargetTexture("XR renderTargetTexture", {width: internalTexture.width, height: internalTexture.height}, scene, undefined, undefined, undefined, undefined, undefined, undefined, undefined, undefined, undefined, true);
+            var renderTargetTexture = new RenderTargetTexture("XR renderTargetTexture", {width: internalTexture.width, height: internalTexture.height}, scene, undefined, undefined, undefined, undefined, undefined, undefined, undefined, undefined, undefined, true);
             renderTargetTexture._texture = internalTexture;
 
              return renderTargetTexture;

+ 1 - 1
src/Culling/Octrees/octreeSceneComponent.ts

@@ -188,7 +188,7 @@ import { SceneComponentConstants } from "sceneComponent";
             return this.scene._getDefaultSubMeshCandidates(mesh);
         }
 
-        private _tempRay = new BABYLON.Ray(Vector3.Zero(), new Vector3(1, 1, 1));
+        private _tempRay = new Ray(Vector3.Zero(), new Vector3(1, 1, 1));
         /**
          * Return the list of sub meshes intersecting with a given local ray
          * @param mesh defines the mesh to find the submesh for

+ 1 - 1
src/Culling/boundingInfo.ts

@@ -152,7 +152,7 @@ import { ICullable, BoundingBox, BoundingSphere } from "Culling";
         /**
          * Returns `true` if the bounding info is within the frustum defined by the passed array of planes.
          * @param frustumPlanes defines the frustum to test
-         * @param strategy defines the strategy to use for the culling (default is BABYLON.Scene.CULLINGSTRATEGY_STANDARD)
+         * @param strategy defines the strategy to use for the culling (default is Scene.CULLINGSTRATEGY_STANDARD)
          * @returns true if the bounding info is in the frustum planes
          */
         public isInFrustum(frustumPlanes: Array<Readonly<Plane>>, strategy: number = AbstractMesh.CULLINGSTRATEGY_STANDARD): boolean {

+ 1 - 1
src/Debug/debugLayer.ts

@@ -49,7 +49,7 @@
         /**
          * Observable triggered when a property is changed through the inspector.
          */
-        public onPropertyChangedObservable = new BABYLON.Observable<{ object: any, property: string, value: any, initialValue: any }>();
+        public onPropertyChangedObservable = new Observable<{ object: any, property: string, value: any, initialValue: any }>();
 
         /**
          * Instantiates a new debug layer.

+ 3 - 3
src/Debug/skeletonViewer.ts

@@ -72,7 +72,7 @@ module BABYLON.Debug {
 
             if (x !== 0 || y !== 0 || z !== 0) {
                 var tmat2 = Tmp.Matrix[1];
-                BABYLON.Matrix.IdentityToRef(tmat2);
+                Matrix.IdentityToRef(tmat2);
                 tmat2.setTranslationFromFloats(x, y, z);
                 tmat2.multiplyToRef(tmat, tmat);
             }
@@ -142,10 +142,10 @@ module BABYLON.Debug {
             const targetScene = this.utilityLayerRenderer ? this.utilityLayerRenderer.utilityLayerScene : this._scene;
 
             if (!this._debugMesh) {
-                this._debugMesh = BABYLON.MeshBuilder.CreateLineSystem("", { lines: this._debugLines, updatable: true, instance: null }, targetScene);
+                this._debugMesh = MeshBuilder.CreateLineSystem("", { lines: this._debugLines, updatable: true, instance: null }, targetScene);
                 this._debugMesh.renderingGroupId = this.renderingGroupId;
             } else {
-                BABYLON.MeshBuilder.CreateLineSystem("", { lines: this._debugLines, updatable: true, instance: this._debugMesh }, targetScene);
+                MeshBuilder.CreateLineSystem("", { lines: this._debugLines, updatable: true, instance: this._debugMesh }, targetScene);
             }
             this._debugMesh.position.copyFrom(this.mesh.position);
             this._debugMesh.color = this.color;

+ 22 - 22
src/Engine/engine.ts

@@ -2,7 +2,7 @@ import { Observer, Observable, Tools, ICustomAnimationFrameRequester, PerfCounte
 import { Nullable, FloatArray, DataArray, IndicesArray } from "types";
 import { Camera } from "Cameras";
 import { Scene } from "scene";
-import { Matrix, Color3, Color4, Viewport, Size, Scalar } from "Math";
+import { Matrix, Color3, Color4, Viewport, Size, Scalar, Vector4, SphericalPolynomial } from "Math";
 import { IDisplayChangedEventArgs } from "Engine";
 import { VertexBuffer } from "Mesh";
 import { RenderTargetTexture, Material, IInternalTextureLoader, Texture, UniformBuffer, InternalTexture, Effect, DummyInternalTextureTracker, IMultiRenderTargetOptions, BaseTexture, IInternalTextureTracker, VideoTexture } from "Materials";
@@ -564,7 +564,7 @@ import { _DepthCullingState, _StencilState, _AlphaState } from "States";
         public enableOfflineSupport = false;
 
         /**
-         * Gets or sets a boolean to enable/disable checking manifest if IndexedDB support is enabled (Babylon.js will always consider the database is up to date)
+         * Gets or sets a boolean to enable/disable checking manifest if IndexedDB support is enabled (js will always consider the database is up to date)
          **/
         public disableManifestCheck = false;
 
@@ -2012,7 +2012,7 @@ import { _DepthCullingState, _StencilState, _AlphaState } from "States";
             }
         }
 
-        private _viewportCached = new BABYLON.Vector4(0, 0, 0, 0);
+        private _viewportCached = new Vector4(0, 0, 0, 0);
 
         /** @hidden */
         public _viewport(x: number, y: number, width: number, height: number): void {
@@ -3924,7 +3924,7 @@ import { _DepthCullingState, _StencilState, _AlphaState } from "States";
 
         /**
          * Sets the current alpha mode
-         * @param mode defines the mode to use (one of the BABYLON.Engine.ALPHA_XXX)
+         * @param mode defines the mode to use (one of the Engine.ALPHA_XXX)
          * @param noDepthWriteChange defines if depth writing state should remains unchanged (false by default)
          * @see http://doc.babylonjs.com/resources/transparency_and_how_meshes_are_rendered
          */
@@ -4222,7 +4222,7 @@ import { _DepthCullingState, _StencilState, _AlphaState } from "States";
         }
 
         /**
-         * Usually called from BABYLON.Texture.ts.
+         * Usually called from Texture.ts.
          * Passed information to create a WebGLTexture
          * @param urlArg defines a value which contains one of the following:
          * * A conventional http URL, e.g. 'http://...' or 'file://...'
@@ -4231,14 +4231,14 @@ import { _DepthCullingState, _StencilState, _AlphaState } from "States";
          * @param noMipmap defines a boolean indicating that no mipmaps shall be generated.  Ignored for compressed textures.  They must be in the file
          * @param invertY when true, image is flipped when loaded.  You probably want true. Ignored for compressed textures.  Must be flipped in the file
          * @param scene needed for loading to the correct scene
-         * @param samplingMode mode with should be used sample / access the texture (Default: BABYLON.Texture.TRILINEAR_SAMPLINGMODE)
+         * @param samplingMode mode with should be used sample / access the texture (Default: Texture.TRILINEAR_SAMPLINGMODE)
          * @param onLoad optional callback to be called upon successful completion
          * @param onError optional callback to be called upon failure
          * @param buffer a source of a file previously fetched as either a base64 string, an ArrayBuffer (compressed or image format), HTMLImageElement (image format), or a Blob
          * @param fallback an internal argument in case the function must be called again, due to etc1 not having alpha capabilities
          * @param format internal format.  Default: RGB when extension is '.jpg' else RGBA.  Ignored for compressed textures
          * @param forcedExtension defines the extension to use to pick the right loader
-         * @returns a InternalTexture for assignment back into BABYLON.Texture
+         * @returns a InternalTexture for assignment back into Texture
          */
         public createTexture(urlArg: Nullable<string>, noMipmap: boolean, invertY: boolean, scene: Nullable<Scene>, samplingMode: number = Engine.TEXTURE_TRILINEAR_SAMPLINGMODE,
             onLoad: Nullable<() => void> = null, onError: Nullable<(message: string, exception: any) => void> = null,
@@ -4460,7 +4460,7 @@ import { _DepthCullingState, _StencilState, _AlphaState } from "States";
          * @param format defines the format of the data
          * @param invertY defines if data must be stored with Y axis inverted
          * @param compression defines the compression used (null by default)
-         * @param type defines the type fo the data (BABYLON.Engine.TEXTURETYPE_UNSIGNED_INT by default)
+         * @param type defines the type fo the data (Engine.TEXTURETYPE_UNSIGNED_INT by default)
          */
         public updateRawTexture(texture: Nullable<InternalTexture>, data: Nullable<ArrayBufferView>, format: number, invertY: boolean, compression: Nullable<string> = null, type = Engine.TEXTURETYPE_UNSIGNED_INT): void {
             if (!texture) {
@@ -4508,9 +4508,9 @@ import { _DepthCullingState, _StencilState, _AlphaState } from "States";
          * @param format defines the format of the data
          * @param generateMipMaps defines if the engine should generate the mip levels
          * @param invertY defines if data must be stored with Y axis inverted
-         * @param samplingMode defines the required sampling mode (BABYLON.Texture.NEAREST_SAMPLINGMODE by default)
+         * @param samplingMode defines the required sampling mode (Texture.NEAREST_SAMPLINGMODE by default)
          * @param compression defines the compression used (null by default)
-         * @param type defines the type fo the data (BABYLON.Engine.TEXTURETYPE_UNSIGNED_INT by default)
+         * @param type defines the type fo the data (Engine.TEXTURETYPE_UNSIGNED_INT by default)
          * @returns the raw texture inside an InternalTexture
          */
         public createRawTexture(data: Nullable<ArrayBufferView>, width: number, height: number, format: number, generateMipMaps: boolean, invertY: boolean, samplingMode: number, compression: Nullable<string> = null, type: number = Engine.TEXTURETYPE_UNSIGNED_INT): InternalTexture {
@@ -4580,7 +4580,7 @@ import { _DepthCullingState, _StencilState, _AlphaState } from "States";
          * @param width defines the width of the texture
          * @param height defines the height of the texture
          * @param generateMipMaps defines if the engine should generate the mip levels
-         * @param samplingMode defines the required sampling mode (BABYLON.Texture.NEAREST_SAMPLINGMODE by default)
+         * @param samplingMode defines the required sampling mode (Texture.NEAREST_SAMPLINGMODE by default)
          * @returns the dynamic texture inside an InternalTexture
          */
         public createDynamicTexture(width: number, height: number, generateMipMaps: boolean, samplingMode: number): InternalTexture {
@@ -5573,7 +5573,7 @@ import { _DepthCullingState, _StencilState, _AlphaState } from "States";
 
                 let texture = loadData.texture as InternalTexture;
                 if (!createPolynomials) {
-                    texture._sphericalPolynomial = new BABYLON.SphericalPolynomial();
+                    texture._sphericalPolynomial = new SphericalPolynomial();
                 }
                 else if (loadData.info.sphericalPolynomial) {
                     texture._sphericalPolynomial = loadData.info.sphericalPolynomial;
@@ -5807,7 +5807,7 @@ import { _DepthCullingState, _StencilState, _AlphaState } from "States";
          * @param texture defines the texture to udpdate
          * @param data defines the data to store
          * @param format defines the data format
-         * @param type defines the type fo the data (BABYLON.Engine.TEXTURETYPE_UNSIGNED_INT by default)
+         * @param type defines the type fo the data (Engine.TEXTURETYPE_UNSIGNED_INT by default)
          * @param invertY defines if data must be stored with Y axis inverted
          * @param compression defines the compression used (null by default)
          * @param level defines which level of the texture to update
@@ -5866,10 +5866,10 @@ import { _DepthCullingState, _StencilState, _AlphaState } from "States";
          * @param data defines the array of data to use to create each face
          * @param size defines the size of the textures
          * @param format defines the format of the data
-         * @param type defines the type of the data (like BABYLON.Engine.TEXTURETYPE_UNSIGNED_INT)
+         * @param type defines the type of the data (like Engine.TEXTURETYPE_UNSIGNED_INT)
          * @param generateMipMaps  defines if the engine should generate the mip levels
          * @param invertY defines if data must be stored with Y axis inverted
-         * @param samplingMode defines the required sampling mode (like BABYLON.Texture.NEAREST_SAMPLINGMODE)
+         * @param samplingMode defines the required sampling mode (like Texture.NEAREST_SAMPLINGMODE)
          * @param compression defines the compression used (null by default)
          * @returns the cube texture as an InternalTexture
          */
@@ -5896,20 +5896,20 @@ import { _DepthCullingState, _StencilState, _AlphaState } from "States";
             if (textureType === gl.FLOAT && !this._caps.textureFloatLinearFiltering) {
                 generateMipMaps = false;
                 samplingMode = Engine.TEXTURE_NEAREST_SAMPLINGMODE;
-                BABYLON.Tools.Warn("Float texture filtering is not supported. Mipmap generation and sampling mode are forced to false and TEXTURE_NEAREST_SAMPLINGMODE, respectively.");
+                Tools.Warn("Float texture filtering is not supported. Mipmap generation and sampling mode are forced to false and TEXTURE_NEAREST_SAMPLINGMODE, respectively.");
             }
             else if (textureType === this._gl.HALF_FLOAT_OES && !this._caps.textureHalfFloatLinearFiltering) {
                 generateMipMaps = false;
                 samplingMode = Engine.TEXTURE_NEAREST_SAMPLINGMODE;
-                BABYLON.Tools.Warn("Half float texture filtering is not supported. Mipmap generation and sampling mode are forced to false and TEXTURE_NEAREST_SAMPLINGMODE, respectively.");
+                Tools.Warn("Half float texture filtering is not supported. Mipmap generation and sampling mode are forced to false and TEXTURE_NEAREST_SAMPLINGMODE, respectively.");
             }
             else if (textureType === gl.FLOAT && !this._caps.textureFloatRender) {
                 generateMipMaps = false;
-                BABYLON.Tools.Warn("Render to float textures is not supported. Mipmap generation forced to false.");
+                Tools.Warn("Render to float textures is not supported. Mipmap generation forced to false.");
             }
             else if (textureType === gl.HALF_FLOAT && !this._caps.colorBufferFloat) {
                 generateMipMaps = false;
-                BABYLON.Tools.Warn("Render to half float textures is not supported. Mipmap generation forced to false.");
+                Tools.Warn("Render to half float textures is not supported. Mipmap generation forced to false.");
             }
 
             var width = size;
@@ -5955,13 +5955,13 @@ import { _DepthCullingState, _StencilState, _AlphaState } from "States";
          * @param scene defines the current scene
          * @param size defines the size of the textures
          * @param format defines the format of the data
-         * @param type defines the type fo the data (like BABYLON.Engine.TEXTURETYPE_UNSIGNED_INT)
+         * @param type defines the type fo the data (like Engine.TEXTURETYPE_UNSIGNED_INT)
          * @param noMipmap defines if the engine should avoid generating the mip levels
          * @param callback defines a callback used to extract texture data from loaded data
          * @param mipmapGenerator defines to provide an optional tool to generate mip levels
          * @param onLoad defines a callback called when texture is loaded
          * @param onError defines a callback called if there is an error
-         * @param samplingMode defines the required sampling mode (like BABYLON.Texture.NEAREST_SAMPLINGMODE)
+         * @param samplingMode defines the required sampling mode (like Texture.NEAREST_SAMPLINGMODE)
          * @param invertY defines if data must be stored with Y axis inverted
          * @returns the cube texture as an InternalTexture
          */
@@ -6094,7 +6094,7 @@ import { _DepthCullingState, _StencilState, _AlphaState } from "States";
          * @param format defines the format of the texture
          * @param generateMipMaps defines if the engine must generate mip levels
          * @param invertY defines if data must be stored with Y axis inverted
-         * @param samplingMode defines the required sampling mode (like BABYLON.Texture.NEAREST_SAMPLINGMODE)
+         * @param samplingMode defines the required sampling mode (like Texture.NEAREST_SAMPLINGMODE)
          * @param compression defines the compressed used (can be null)
          * @param textureType defines the compressed used (can be null)
          * @returns a new raw 3D texture (stored in an InternalTexture)

+ 5 - 5
src/Events/keyboardEvents.ts

@@ -19,12 +19,12 @@
         /**
          * Instantiates a new keyboard info.
          * This class is used to store keyboard related info for the onKeyboardObservable event.
-         * @param type Defines the type of event (BABYLON.KeyboardEventTypes)
+         * @param type Defines the type of event (KeyboardEventTypes)
          * @param event Defines the related dom event
          */
         constructor(
             /**
-             * Defines the type of event (BABYLON.KeyboardEventTypes)
+             * Defines the type of event (KeyboardEventTypes)
              */
             public type: number,
             /**
@@ -47,12 +47,12 @@
         /**
          * Instantiates a new keyboard pre info.
          * This class is used to store keyboard related info for the onPreKeyboardObservable event.
-         * @param type Defines the type of event (BABYLON.KeyboardEventTypes)
+         * @param type Defines the type of event (KeyboardEventTypes)
          * @param event Defines the related dom event
          */
         constructor(
             /**
-             * Defines the type of event (BABYLON.KeyboardEventTypes)
+             * Defines the type of event (KeyboardEventTypes)
              */
             public type: number,
             /**
@@ -62,4 +62,4 @@
             super(type, event);
             this.skipOnPointerObservable = false;
         }
-    }
+    }

+ 4 - 4
src/Events/pointerEvents.ts

@@ -44,12 +44,12 @@ import { _DepthCullingState, _StencilState, _AlphaState } from "States";
     export class PointerInfoBase {
         /**
          * Instantiates the base class of pointers info.
-         * @param type Defines the type of event (BABYLON.PointerEventTypes)
+         * @param type Defines the type of event (PointerEventTypes)
          * @param event Defines the related dom event
          */
         constructor(
             /**
-             * Defines the type of event (BABYLON.PointerEventTypes)
+             * Defines the type of event (PointerEventTypes)
              */
             public type: number,
             /**
@@ -81,7 +81,7 @@ import { _DepthCullingState, _StencilState, _AlphaState } from "States";
 
         /**
          * Instantiates a PointerInfoPre to store pointer related info to the onPrePointerObservable event.
-         * @param type Defines the type of event (BABYLON.PointerEventTypes)
+         * @param type Defines the type of event (PointerEventTypes)
          * @param event Defines the related dom event
          * @param localX Defines the local x coordinates of the pointer when the event occured
          * @param localY Defines the local y coordinates of the pointer when the event occured
@@ -100,7 +100,7 @@ import { _DepthCullingState, _StencilState, _AlphaState } from "States";
     export class PointerInfo extends PointerInfoBase {
         /**
          * Instantiates a PointerInfo to store pointer related info to the onPointerObservable event.
-         * @param type Defines the type of event (BABYLON.PointerEventTypes)
+         * @param type Defines the type of event (PointerEventTypes)
          * @param event Defines the related dom event
          * @param pickInfo Defines the picking info associated to the info (if any)\
          */

+ 3 - 3
src/Gamepad/Controllers/gearVRController.ts

@@ -1,7 +1,7 @@
 import { Scene } from "scene";
 import { Vector3 } from "Math";
-import {WebVRController, PoseEnabledControllerType, ExtendedGamepadButton, GamepadButtonChanges} from "Gamepad"
-import { AbstractMesh } from "Mesh";
+import { WebVRController, PoseEnabledControllerType, ExtendedGamepadButton, GamepadButtonChanges } from "Gamepad";
+import { AbstractMesh, Mesh } from "Mesh";
 import { _TimeToken } from "Instrumentation";
 import { SceneLoader } from "Loading";
 import { _DepthCullingState, _StencilState, _AlphaState } from "States";
@@ -48,7 +48,7 @@ import { _DepthCullingState, _StencilState, _AlphaState } from "States";
         public initControllerMesh(scene: Scene, meshLoaded?: (mesh: AbstractMesh) => void) {
             SceneLoader.ImportMesh("", GearVRController.MODEL_BASE_URL, GearVRController.MODEL_FILENAME, scene, (newMeshes) => {
                 // Offset the controller so it will rotate around the users wrist
-                var mesh = new BABYLON.Mesh("", scene);
+                var mesh = new Mesh("", scene);
                 newMeshes[1].parent = mesh;
                 newMeshes[1].position.z = -0.15;
                 this._defaultModel = mesh;

+ 8 - 7
src/Gamepad/Controllers/poseEnabledController.ts

@@ -1,13 +1,14 @@
 import { Observable } from "Tools";
 import { Nullable } from "types";
 import { WebVRFreeCamera, TargetCamera, PoseControlled, DevicePose } from "Cameras";
-import { Quaternion, Matrix, Vector3 } from "Math";
-import {Gamepad, ExtendedGamepadButton, OculusTouchController, WindowsMotionController, ViveController, GearVRController, DaydreamController, GenericController} from "Gamepad"
-import {Node} from "Node";
+import { Quaternion, Matrix, Vector3, Tmp } from "Math";
+import { Gamepad, ExtendedGamepadButton, OculusTouchController, WindowsMotionController, ViveController, GearVRController, DaydreamController, GenericController } from "Gamepad";
+import { Node } from "Node";
 import { AbstractMesh } from "Mesh";
 import { Ray } from "Culling";
 import { _TimeToken } from "Instrumentation";
 import { _DepthCullingState, _StencilState, _AlphaState } from "States";
+import { Engine } from "Engine";
     /**
     * Defines the types of pose enabled controllers that are supported
     */
@@ -224,17 +225,17 @@ import { _DepthCullingState, _StencilState, _AlphaState } from "States";
             var pose: GamepadPose = this.browserGamepad.pose;
             this.updateFromDevice(pose);
 
-            if (!this._trackPosition && BABYLON.Engine.LastCreatedScene && BABYLON.Engine.LastCreatedScene.activeCamera && (<WebVRFreeCamera>BABYLON.Engine.LastCreatedScene.activeCamera).devicePosition) {
-                var camera = <WebVRFreeCamera>BABYLON.Engine.LastCreatedScene.activeCamera;
+            if (!this._trackPosition && Engine.LastCreatedScene && Engine.LastCreatedScene.activeCamera && (<WebVRFreeCamera>Engine.LastCreatedScene.activeCamera).devicePosition) {
+                var camera = <WebVRFreeCamera>Engine.LastCreatedScene.activeCamera;
                 camera._computeDevicePosition();
 
                 this._deviceToWorld.setTranslation(camera.devicePosition);
                 if (camera.deviceRotationQuaternion) {
                     var camera = camera;
-                    camera._deviceRoomRotationQuaternion.toEulerAnglesToRef(BABYLON.Tmp.Vector3[0]);
+                    camera._deviceRoomRotationQuaternion.toEulerAnglesToRef(Tmp.Vector3[0]);
 
                     // Find the radian distance away that the headset is from the controllers rotation
-                    var distanceAway = Math.atan2(Math.sin(BABYLON.Tmp.Vector3[0].y - this._draggedRoomRotation), Math.cos(BABYLON.Tmp.Vector3[0].y - this._draggedRoomRotation));
+                    var distanceAway = Math.atan2(Math.sin(Tmp.Vector3[0].y - this._draggedRoomRotation), Math.cos(Tmp.Vector3[0].y - this._draggedRoomRotation));
                     if (Math.abs(distanceAway) > this._maxRotationDistFromHeadset) {
                         // Only rotate enouph to be within the _maxRotationDistFromHeadset
                         var rotationAmount = distanceAway - (distanceAway < 0 ? -this._maxRotationDistFromHeadset : this._maxRotationDistFromHeadset);

+ 10 - 9
src/Gizmos/axisDragGizmo.ts

@@ -1,13 +1,14 @@
 import { Observer, Observable } from "Tools";
 import { Nullable } from "types";
 import { PointerInfo } from "Events";
-import { Vector3, Color3 } from "Math";
-import { Mesh, AbstractMesh, LinesMesh } from "Mesh";
+import { Vector3, Color3, Matrix } from "Math";
+import { Mesh, AbstractMesh, LinesMesh, MeshBuilder } from "Mesh";
 import { PointerDragBehavior } from "Behaviors";
 import { _TimeToken } from "Instrumentation";
 import { _DepthCullingState, _StencilState, _AlphaState } from "States";
 import { Gizmo } from "Gizmos";
 import { UtilityLayerRenderer } from "Rendering";
+import { StandardMaterial } from "Materials";
     /**
      * Single axis drag gizmo
      */
@@ -36,18 +37,18 @@ import { UtilityLayerRenderer } from "Rendering";
             super(gizmoLayer);
 
             // Create Material
-            var coloredMaterial = new BABYLON.StandardMaterial("", gizmoLayer.utilityLayerScene);
+            var coloredMaterial = new StandardMaterial("", gizmoLayer.utilityLayerScene);
             coloredMaterial.disableLighting = true;
             coloredMaterial.emissiveColor = color;
 
-            var hoverMaterial = new BABYLON.StandardMaterial("", gizmoLayer.utilityLayerScene);
+            var hoverMaterial = new StandardMaterial("", gizmoLayer.utilityLayerScene);
             hoverMaterial.disableLighting = true;
             hoverMaterial.emissiveColor = color.add(new Color3(0.3, 0.3, 0.3));
 
             // Build mesh on root node
-            var arrow = new BABYLON.AbstractMesh("", gizmoLayer.utilityLayerScene);
-            var arrowMesh = BABYLON.MeshBuilder.CreateCylinder("yPosMesh", {diameterTop: 0, height: 1.5, diameterBottom: 0.75, tessellation: 96}, gizmoLayer.utilityLayerScene);
-            var arrowTail = BABYLON.MeshBuilder.CreateLines("yPosMesh", {points: [new Vector3(0, 0, 0), new Vector3(0, 1.1, 0)]}, gizmoLayer.utilityLayerScene);
+            var arrow = new AbstractMesh("", gizmoLayer.utilityLayerScene);
+            var arrowMesh = MeshBuilder.CreateCylinder("yPosMesh", {diameterTop: 0, height: 1.5, diameterBottom: 0.75, tessellation: 96}, gizmoLayer.utilityLayerScene);
+            var arrowTail = MeshBuilder.CreateLines("yPosMesh", {points: [new Vector3(0, 0, 0), new Vector3(0, 1.1, 0)]}, gizmoLayer.utilityLayerScene);
             arrowTail.color = coloredMaterial.emissiveColor;
             arrow.addChild(arrowMesh);
             arrow.addChild(arrowTail);
@@ -73,8 +74,8 @@ import { UtilityLayerRenderer } from "Rendering";
             this.dragBehavior.moveAttached = false;
             this._rootMesh.addBehavior(this.dragBehavior);
 
-            var localDelta = new BABYLON.Vector3();
-            var tmpMatrix = new BABYLON.Matrix();
+            var localDelta = new Vector3();
+            var tmpMatrix = new Matrix();
             this.dragBehavior.onDragObservable.add((event) => {
                 if (this.attachedMesh) {
                     // Convert delta to local translation if it has a parent

+ 6 - 6
src/Gizmos/axisScaleGizmo.ts

@@ -2,7 +2,7 @@ import { Observer, Observable } from "Tools";
 import { Nullable } from "types";
 import { PointerInfo } from "Events";
 import { Vector3, Color3 } from "Math";
-import { Mesh, AbstractMesh, LinesMesh } from "Mesh";
+import { Mesh, AbstractMesh, LinesMesh, MeshBuilder } from "Mesh";
 import { StandardMaterial } from "Materials";
 import { PointerDragBehavior } from "Behaviors";
 import { _TimeToken } from "Instrumentation";
@@ -42,18 +42,18 @@ import { UtilityLayerRenderer } from "Rendering";
             super(gizmoLayer);
 
             // Create Material
-            this._coloredMaterial = new BABYLON.StandardMaterial("", gizmoLayer.utilityLayerScene);
+            this._coloredMaterial = new StandardMaterial("", gizmoLayer.utilityLayerScene);
             this._coloredMaterial.disableLighting = true;
             this._coloredMaterial.emissiveColor = color;
 
-            var hoverMaterial = new BABYLON.StandardMaterial("", gizmoLayer.utilityLayerScene);
+            var hoverMaterial = new StandardMaterial("", gizmoLayer.utilityLayerScene);
             hoverMaterial.disableLighting = true;
             hoverMaterial.emissiveColor = color.add(new Color3(0.3, 0.3, 0.3));
 
             // Build mesh on root node
-            var arrow = new BABYLON.AbstractMesh("", gizmoLayer.utilityLayerScene);
-            var arrowMesh = BABYLON.MeshBuilder.CreateBox("yPosMesh", {size: 0.4}, gizmoLayer.utilityLayerScene);
-            var arrowTail = BABYLON.MeshBuilder.CreateLines("yPosMesh", {points: [new Vector3(0, 0, 0), new Vector3(0, 1.1, 0)]}, gizmoLayer.utilityLayerScene);
+            var arrow = new AbstractMesh("", gizmoLayer.utilityLayerScene);
+            var arrowMesh = MeshBuilder.CreateBox("yPosMesh", {size: 0.4}, gizmoLayer.utilityLayerScene);
+            var arrowTail = MeshBuilder.CreateLines("yPosMesh", {points: [new Vector3(0, 0, 0), new Vector3(0, 1.1, 0)]}, gizmoLayer.utilityLayerScene);
             arrowTail.color = this._coloredMaterial.emissiveColor;
             arrow.addChild(arrowMesh);
             arrow.addChild(arrowTail);

+ 30 - 29
src/Gizmos/boundingBoxGizmo.ts

@@ -3,12 +3,13 @@ import { Nullable } from "types";
 import { PointerInfo } from "Events";
 import { Scene } from "scene";
 import { Quaternion, Matrix, Vector3, Color3 } from "Math";
-import { Mesh, AbstractMesh } from "Mesh";
+import { Mesh, AbstractMesh, MeshBuilder } from "Mesh";
 import { PointerDragBehavior } from "Behaviors";
 import { _TimeToken } from "Instrumentation";
 import { _DepthCullingState, _StencilState, _AlphaState } from "States";
 import { Gizmo } from "Gizmos";
 import { UtilityLayerRenderer } from "Rendering";
+import { StandardMaterial } from "Materials";
     /**
      * Bounding box gizmo
      */
@@ -16,7 +17,7 @@ import { UtilityLayerRenderer } from "Rendering";
         private _lineBoundingBox: AbstractMesh;
         private _rotateSpheresParent: AbstractMesh;
         private _scaleBoxesParent: AbstractMesh;
-        private _boundingDimensions = new BABYLON.Vector3(1, 1, 1);
+        private _boundingDimensions = new Vector3(1, 1, 1);
         private _renderObserver: Nullable<Observer<Scene>> = null;
         private _pointerObserver: Nullable<Observer<PointerInfo>> = null;
         private _scaleDragSpeed = 0.2;
@@ -124,42 +125,42 @@ import { UtilityLayerRenderer } from "Rendering";
 
             this._anchorMesh = new AbstractMesh("anchor", gizmoLayer.utilityLayerScene);
             // Create Materials
-            var coloredMaterial = new BABYLON.StandardMaterial("", gizmoLayer.utilityLayerScene);
+            var coloredMaterial = new StandardMaterial("", gizmoLayer.utilityLayerScene);
             coloredMaterial.disableLighting = true;
             coloredMaterial.emissiveColor = color;
-            var hoverColoredMaterial = new BABYLON.StandardMaterial("", gizmoLayer.utilityLayerScene);
+            var hoverColoredMaterial = new StandardMaterial("", gizmoLayer.utilityLayerScene);
             hoverColoredMaterial.disableLighting = true;
             hoverColoredMaterial.emissiveColor = color.clone().add(new Color3(0.3, 0.3, 0.3));
 
             // Build bounding box out of lines
-            this._lineBoundingBox = new BABYLON.AbstractMesh("", gizmoLayer.utilityLayerScene);
-            this._lineBoundingBox.rotationQuaternion = new BABYLON.Quaternion();
+            this._lineBoundingBox = new AbstractMesh("", gizmoLayer.utilityLayerScene);
+            this._lineBoundingBox.rotationQuaternion = new Quaternion();
             var lines = [];
-            lines.push(BABYLON.MeshBuilder.CreateLines("lines", { points: [new BABYLON.Vector3(0, 0, 0), new BABYLON.Vector3(this._boundingDimensions.x, 0, 0)] }, gizmoLayer.utilityLayerScene));
-            lines.push(BABYLON.MeshBuilder.CreateLines("lines", { points: [new BABYLON.Vector3(0, 0, 0), new BABYLON.Vector3(0, this._boundingDimensions.y, 0)] }, gizmoLayer.utilityLayerScene));
-            lines.push(BABYLON.MeshBuilder.CreateLines("lines", { points: [new BABYLON.Vector3(0, 0, 0), new BABYLON.Vector3(0, 0, this._boundingDimensions.z)] }, gizmoLayer.utilityLayerScene));
-            lines.push(BABYLON.MeshBuilder.CreateLines("lines", { points: [new BABYLON.Vector3(this._boundingDimensions.x, 0, 0), new BABYLON.Vector3(this._boundingDimensions.x, this._boundingDimensions.y, 0)] }, gizmoLayer.utilityLayerScene));
-            lines.push(BABYLON.MeshBuilder.CreateLines("lines", { points: [new BABYLON.Vector3(this._boundingDimensions.x, 0, 0), new BABYLON.Vector3(this._boundingDimensions.x, 0, this._boundingDimensions.z)] }, gizmoLayer.utilityLayerScene));
-            lines.push(BABYLON.MeshBuilder.CreateLines("lines", { points: [new BABYLON.Vector3(0, this._boundingDimensions.y, 0), new BABYLON.Vector3(this._boundingDimensions.x, this._boundingDimensions.y, 0)] }, gizmoLayer.utilityLayerScene));
-            lines.push(BABYLON.MeshBuilder.CreateLines("lines", { points: [new BABYLON.Vector3(0, this._boundingDimensions.y, 0), new BABYLON.Vector3(0, this._boundingDimensions.y, this._boundingDimensions.z)] }, gizmoLayer.utilityLayerScene));
-            lines.push(BABYLON.MeshBuilder.CreateLines("lines", { points: [new BABYLON.Vector3(0, 0, this._boundingDimensions.z), new BABYLON.Vector3(this._boundingDimensions.x, 0, this._boundingDimensions.z)] }, gizmoLayer.utilityLayerScene));
-            lines.push(BABYLON.MeshBuilder.CreateLines("lines", { points: [new BABYLON.Vector3(0, 0, this._boundingDimensions.z), new BABYLON.Vector3(0, this._boundingDimensions.y, this._boundingDimensions.z)] }, gizmoLayer.utilityLayerScene));
-            lines.push(BABYLON.MeshBuilder.CreateLines("lines", { points: [new BABYLON.Vector3(this._boundingDimensions.x, this._boundingDimensions.y, this._boundingDimensions.z), new BABYLON.Vector3(0, this._boundingDimensions.y, this._boundingDimensions.z)] }, gizmoLayer.utilityLayerScene));
-            lines.push(BABYLON.MeshBuilder.CreateLines("lines", { points: [new BABYLON.Vector3(this._boundingDimensions.x, this._boundingDimensions.y, this._boundingDimensions.z), new BABYLON.Vector3(this._boundingDimensions.x, 0, this._boundingDimensions.z)] }, gizmoLayer.utilityLayerScene));
-            lines.push(BABYLON.MeshBuilder.CreateLines("lines", { points: [new BABYLON.Vector3(this._boundingDimensions.x, this._boundingDimensions.y, this._boundingDimensions.z), new BABYLON.Vector3(this._boundingDimensions.x, this._boundingDimensions.y, 0)] }, gizmoLayer.utilityLayerScene));
+            lines.push(MeshBuilder.CreateLines("lines", { points: [new Vector3(0, 0, 0), new Vector3(this._boundingDimensions.x, 0, 0)] }, gizmoLayer.utilityLayerScene));
+            lines.push(MeshBuilder.CreateLines("lines", { points: [new Vector3(0, 0, 0), new Vector3(0, this._boundingDimensions.y, 0)] }, gizmoLayer.utilityLayerScene));
+            lines.push(MeshBuilder.CreateLines("lines", { points: [new Vector3(0, 0, 0), new Vector3(0, 0, this._boundingDimensions.z)] }, gizmoLayer.utilityLayerScene));
+            lines.push(MeshBuilder.CreateLines("lines", { points: [new Vector3(this._boundingDimensions.x, 0, 0), new Vector3(this._boundingDimensions.x, this._boundingDimensions.y, 0)] }, gizmoLayer.utilityLayerScene));
+            lines.push(MeshBuilder.CreateLines("lines", { points: [new Vector3(this._boundingDimensions.x, 0, 0), new Vector3(this._boundingDimensions.x, 0, this._boundingDimensions.z)] }, gizmoLayer.utilityLayerScene));
+            lines.push(MeshBuilder.CreateLines("lines", { points: [new Vector3(0, this._boundingDimensions.y, 0), new Vector3(this._boundingDimensions.x, this._boundingDimensions.y, 0)] }, gizmoLayer.utilityLayerScene));
+            lines.push(MeshBuilder.CreateLines("lines", { points: [new Vector3(0, this._boundingDimensions.y, 0), new Vector3(0, this._boundingDimensions.y, this._boundingDimensions.z)] }, gizmoLayer.utilityLayerScene));
+            lines.push(MeshBuilder.CreateLines("lines", { points: [new Vector3(0, 0, this._boundingDimensions.z), new Vector3(this._boundingDimensions.x, 0, this._boundingDimensions.z)] }, gizmoLayer.utilityLayerScene));
+            lines.push(MeshBuilder.CreateLines("lines", { points: [new Vector3(0, 0, this._boundingDimensions.z), new Vector3(0, this._boundingDimensions.y, this._boundingDimensions.z)] }, gizmoLayer.utilityLayerScene));
+            lines.push(MeshBuilder.CreateLines("lines", { points: [new Vector3(this._boundingDimensions.x, this._boundingDimensions.y, this._boundingDimensions.z), new Vector3(0, this._boundingDimensions.y, this._boundingDimensions.z)] }, gizmoLayer.utilityLayerScene));
+            lines.push(MeshBuilder.CreateLines("lines", { points: [new Vector3(this._boundingDimensions.x, this._boundingDimensions.y, this._boundingDimensions.z), new Vector3(this._boundingDimensions.x, 0, this._boundingDimensions.z)] }, gizmoLayer.utilityLayerScene));
+            lines.push(MeshBuilder.CreateLines("lines", { points: [new Vector3(this._boundingDimensions.x, this._boundingDimensions.y, this._boundingDimensions.z), new Vector3(this._boundingDimensions.x, this._boundingDimensions.y, 0)] }, gizmoLayer.utilityLayerScene));
             lines.forEach((l) => {
                 l.color = color;
-                l.position.addInPlace(new BABYLON.Vector3(-this._boundingDimensions.x / 2, -this._boundingDimensions.y / 2, -this._boundingDimensions.z / 2));
+                l.position.addInPlace(new Vector3(-this._boundingDimensions.x / 2, -this._boundingDimensions.y / 2, -this._boundingDimensions.z / 2));
                 l.isPickable = false;
                 this._lineBoundingBox.addChild(l);
             });
             this._rootMesh.addChild(this._lineBoundingBox);
 
             // Create rotation spheres
-            this._rotateSpheresParent = new BABYLON.AbstractMesh("", gizmoLayer.utilityLayerScene);
+            this._rotateSpheresParent = new AbstractMesh("", gizmoLayer.utilityLayerScene);
             this._rotateSpheresParent.rotationQuaternion = new Quaternion();
             for (let i = 0; i < 12; i++) {
-                let sphere = BABYLON.MeshBuilder.CreateSphere("", { diameter: 1 }, gizmoLayer.utilityLayerScene);
+                let sphere = MeshBuilder.CreateSphere("", { diameter: 1 }, gizmoLayer.utilityLayerScene);
                 sphere.rotationQuaternion = new Quaternion();
                 sphere.material = coloredMaterial;
 
@@ -236,16 +237,16 @@ import { UtilityLayerRenderer } from "Rendering";
             this._rootMesh.addChild(this._rotateSpheresParent);
 
             // Create scale cubes
-            this._scaleBoxesParent = new BABYLON.AbstractMesh("", gizmoLayer.utilityLayerScene);
+            this._scaleBoxesParent = new AbstractMesh("", gizmoLayer.utilityLayerScene);
             this._scaleBoxesParent.rotationQuaternion = new Quaternion();
             for (var i = 0; i < 2; i++) {
                 for (var j = 0; j < 2; j++) {
                     for (var k = 0; k < 2; k++) {
-                        let box = BABYLON.MeshBuilder.CreateBox("", { size: 1 }, gizmoLayer.utilityLayerScene);
+                        let box = MeshBuilder.CreateBox("", { size: 1 }, gizmoLayer.utilityLayerScene);
                         box.material = coloredMaterial;
 
                         // Dragging logic
-                        let dragAxis = new BABYLON.Vector3(i == 0 ? -1 : 1, j == 0 ? -1 : 1, k == 0 ? -1 : 1);
+                        let dragAxis = new Vector3(i == 0 ? -1 : 1, j == 0 ? -1 : 1, k == 0 ? -1 : 1);
                         var _dragBehavior = new PointerDragBehavior({ dragAxis: dragAxis });
                         _dragBehavior.moveAttached = false;
                         box.addBehavior(_dragBehavior);
@@ -393,17 +394,17 @@ import { UtilityLayerRenderer } from "Rendering";
                         var index = ((i * 4) + (j * 2)) + k;
                         if (i == 0) {
                             rotateSpheres[index].position.set(this._boundingDimensions.x / 2, this._boundingDimensions.y * j, this._boundingDimensions.z * k);
-                            rotateSpheres[index].position.addInPlace(new BABYLON.Vector3(-this._boundingDimensions.x / 2, -this._boundingDimensions.y / 2, -this._boundingDimensions.z / 2));
+                            rotateSpheres[index].position.addInPlace(new Vector3(-this._boundingDimensions.x / 2, -this._boundingDimensions.y / 2, -this._boundingDimensions.z / 2));
                             rotateSpheres[index].lookAt(Vector3.Cross(Vector3.Right(), rotateSpheres[index].position.normalizeToNew()).normalizeToNew().add(rotateSpheres[index].position));
                         }
                         if (i == 1) {
                             rotateSpheres[index].position.set(this._boundingDimensions.x * j, this._boundingDimensions.y / 2, this._boundingDimensions.z * k);
-                            rotateSpheres[index].position.addInPlace(new BABYLON.Vector3(-this._boundingDimensions.x / 2, -this._boundingDimensions.y / 2, -this._boundingDimensions.z / 2));
+                            rotateSpheres[index].position.addInPlace(new Vector3(-this._boundingDimensions.x / 2, -this._boundingDimensions.y / 2, -this._boundingDimensions.z / 2));
                             rotateSpheres[index].lookAt(Vector3.Cross(Vector3.Up(), rotateSpheres[index].position.normalizeToNew()).normalizeToNew().add(rotateSpheres[index].position));
                         }
                         if (i == 2) {
                             rotateSpheres[index].position.set(this._boundingDimensions.x * j, this._boundingDimensions.y * k, this._boundingDimensions.z / 2);
-                            rotateSpheres[index].position.addInPlace(new BABYLON.Vector3(-this._boundingDimensions.x / 2, -this._boundingDimensions.y / 2, -this._boundingDimensions.z / 2));
+                            rotateSpheres[index].position.addInPlace(new Vector3(-this._boundingDimensions.x / 2, -this._boundingDimensions.y / 2, -this._boundingDimensions.z / 2));
                             rotateSpheres[index].lookAt(Vector3.Cross(Vector3.Forward(), rotateSpheres[index].position.normalizeToNew()).normalizeToNew().add(rotateSpheres[index].position));
                         }
                         if (this.fixedDragMeshScreenSize) {
@@ -428,7 +429,7 @@ import { UtilityLayerRenderer } from "Rendering";
                         var index = ((i * 4) + (j * 2)) + k;
                         if (scaleBoxes[index]) {
                             scaleBoxes[index].position.set(this._boundingDimensions.x * i, this._boundingDimensions.y * j, this._boundingDimensions.z * k);
-                            scaleBoxes[index].position.addInPlace(new BABYLON.Vector3(-this._boundingDimensions.x / 2, -this._boundingDimensions.y / 2, -this._boundingDimensions.z / 2));
+                            scaleBoxes[index].position.addInPlace(new Vector3(-this._boundingDimensions.x / 2, -this._boundingDimensions.y / 2, -this._boundingDimensions.z / 2));
                             if (this.fixedDragMeshScreenSize) {
                                 this._rootMesh.computeWorldMatrix();
                                 this._scaleBoxesParent.computeWorldMatrix();
@@ -501,7 +502,7 @@ import { UtilityLayerRenderer } from "Rendering";
             mesh.position.set(0, 0, 0);
 
             // Update bounding dimensions/positions
-            var box = BABYLON.MeshBuilder.CreateBox("box", { size: 1 }, mesh.getScene());
+            var box = MeshBuilder.CreateBox("box", { size: 1 }, mesh.getScene());
             var boundingMinMax = mesh.getHierarchyBoundingVectors();
             boundingMinMax.max.subtractToRef(boundingMinMax.min, box.scaling);
             box.position.set((boundingMinMax.max.x + boundingMinMax.min.x) / 2, (boundingMinMax.max.y + boundingMinMax.min.y) / 2, (boundingMinMax.max.z + boundingMinMax.min.z) / 2);

+ 1 - 1
src/Gizmos/gizmo.ts

@@ -78,7 +78,7 @@ import { UtilityLayerRenderer } from "Rendering";
         constructor(
             /** The utility layer the gizmo will be added to */
             public gizmoLayer: UtilityLayerRenderer = UtilityLayerRenderer.DefaultUtilityLayer) {
-            this._rootMesh = new BABYLON.Mesh("gizmoRootNode", gizmoLayer.utilityLayerScene);
+            this._rootMesh = new Mesh("gizmoRootNode", gizmoLayer.utilityLayerScene);
             this._beforeRenderObserver = this.gizmoLayer.utilityLayerScene.onBeforeRenderObservable.add(() => {
                 this._update();
             });

+ 7 - 5
src/Gizmos/gizmoManager.ts

@@ -1,13 +1,15 @@
 import { Observer } from "Tools";
 import { Nullable } from "types";
-import { PointerInfo } from "Events";
+import { PointerInfo, PointerEventTypes } from "Events";
 import { Scene, IDisposable } from "scene";
-import {Node} from "Node";
+import { Node } from "Node";
 import { AbstractMesh } from "Mesh";
 import { _TimeToken } from "Instrumentation";
 import { _DepthCullingState, _StencilState, _AlphaState } from "States";
 import { Gizmo, RotationGizmo, PositionGizmo, ScaleGizmo, BoundingBoxGizmo } from "Gizmos";
 import { UtilityLayerRenderer } from "Rendering";
+import { Color3 } from "Math";
+import { SixDofDragBehavior } from "Behaviors";
     /**
      * Helps setup gizmo's in the scene to rotate/scale/position meshes
      */
@@ -19,13 +21,13 @@ import { UtilityLayerRenderer } from "Rendering";
         private _gizmosEnabled = {positionGizmo: false, rotationGizmo: false, scaleGizmo: false, boundingBoxGizmo: false};
         private _pointerObserver: Nullable<Observer<PointerInfo>> = null;
         private _attachedMesh: Nullable<AbstractMesh> = null;
-        private _boundingBoxColor = BABYLON.Color3.FromHexString("#0984e3");
+        private _boundingBoxColor = Color3.FromHexString("#0984e3");
         private _defaultUtilityLayer: UtilityLayerRenderer;
         private _defaultKeepDepthUtilityLayer: UtilityLayerRenderer;
         /**
          * When bounding box gizmo is enabled, this can be used to track drag/end events
          */
-        public boundingBoxDragBehavior = new BABYLON.SixDofDragBehavior();
+        public boundingBoxDragBehavior = new SixDofDragBehavior();
         /**
          * Array of meshes which will have the gizmo attached when a pointer selected them. If null, all meshes are attachable. (Default: null)
          */
@@ -51,7 +53,7 @@ import { UtilityLayerRenderer } from "Rendering";
                 if (!this.usePointerToAttachGizmos) {
                     return;
                 }
-                if (pointerInfo.type == BABYLON.PointerEventTypes.POINTERDOWN) {
+                if (pointerInfo.type == PointerEventTypes.POINTERDOWN) {
                     if (pointerInfo.pickInfo && pointerInfo.pickInfo.pickedMesh) {
                         var node: Nullable<Node> = pointerInfo.pickInfo.pickedMesh;
                         if (this.attachableMeshes == null) {

+ 8 - 7
src/Gizmos/planeRotationGizmo.ts

@@ -8,6 +8,7 @@ import { _TimeToken } from "Instrumentation";
 import { _DepthCullingState, _StencilState, _AlphaState } from "States";
 import { Gizmo } from "Gizmos";
 import { UtilityLayerRenderer } from "Rendering";
+import { StandardMaterial } from "Materials";
     /**
      * Single plane rotation gizmo
      */
@@ -39,16 +40,16 @@ import { UtilityLayerRenderer } from "Rendering";
             super(gizmoLayer);
 
             // Create Material
-            var coloredMaterial = new BABYLON.StandardMaterial("", gizmoLayer.utilityLayerScene);
+            var coloredMaterial = new StandardMaterial("", gizmoLayer.utilityLayerScene);
             coloredMaterial.disableLighting = true;
             coloredMaterial.emissiveColor = color;
 
-            var hoverMaterial = new BABYLON.StandardMaterial("", gizmoLayer.utilityLayerScene);
+            var hoverMaterial = new StandardMaterial("", gizmoLayer.utilityLayerScene);
             hoverMaterial.disableLighting = true;
             hoverMaterial.emissiveColor = color.add(new Color3(0.3, 0.3, 0.3));
 
             // Build mesh on root node
-            var parentMesh = new BABYLON.AbstractMesh("", gizmoLayer.utilityLayerScene);
+            var parentMesh = new AbstractMesh("", gizmoLayer.utilityLayerScene);
 
             // Create circle out of lines
             var radius = 0.8;
@@ -90,9 +91,9 @@ import { UtilityLayerRenderer } from "Rendering";
 
             var tmpSnapEvent = {snapDistance: 0};
             var currentSnapDragDistance = 0;
-            var tmpMatrix = new BABYLON.Matrix();
-            var tmpVector = new BABYLON.Vector3();
-            var amountToRotate = new BABYLON.Quaternion();
+            var tmpMatrix = new Matrix();
+            var tmpVector = new Vector3();
+            var amountToRotate = new Quaternion();
             this.dragBehavior.onDragObservable.add((event) => {
                 if (this.attachedMesh) {
                     if (!this.attachedMesh.rotationQuaternion) {
@@ -150,7 +151,7 @@ import { UtilityLayerRenderer } from "Rendering";
                     // If the meshes local scale is inverted (eg. loaded gltf file parent with z scale of -1) the rotation needs to be inverted on the y axis
                     if (tmpMatrix.determinant() > 0) {
                         amountToRotate.toEulerAnglesToRef(tmpVector);
-                        BABYLON.Quaternion.RotationYawPitchRollToRef(tmpVector.y, -tmpVector.x, -tmpVector.z, amountToRotate);
+                        Quaternion.RotationYawPitchRollToRef(tmpVector.y, -tmpVector.x, -tmpVector.z, amountToRotate);
                     }
 
                      if (this.updateGizmoRotationToMatchAttachedMesh) {

+ 4 - 4
src/Gizmos/positionGizmo.ts

@@ -1,6 +1,6 @@
 import { Observable, Tools } from "Tools";
 import { Nullable } from "types";
-import { Vector3 } from "Math";
+import { Vector3, Color3 } from "Math";
 import { Mesh, AbstractMesh } from "Mesh";
 import { _TimeToken } from "Instrumentation";
 import { _DepthCullingState, _StencilState, _AlphaState } from "States";
@@ -41,9 +41,9 @@ import { UtilityLayerRenderer } from "Rendering";
          */
         constructor(gizmoLayer: UtilityLayerRenderer= UtilityLayerRenderer.DefaultUtilityLayer) {
             super(gizmoLayer);
-            this.xGizmo = new AxisDragGizmo(new Vector3(1, 0, 0), BABYLON.Color3.Red().scale(0.5), gizmoLayer);
-            this.yGizmo = new AxisDragGizmo(new Vector3(0, 1, 0), BABYLON.Color3.Green().scale(0.5), gizmoLayer);
-            this.zGizmo = new AxisDragGizmo(new Vector3(0, 0, 1), BABYLON.Color3.Blue().scale(0.5), gizmoLayer);
+            this.xGizmo = new AxisDragGizmo(new Vector3(1, 0, 0), Color3.Red().scale(0.5), gizmoLayer);
+            this.yGizmo = new AxisDragGizmo(new Vector3(0, 1, 0), Color3.Green().scale(0.5), gizmoLayer);
+            this.zGizmo = new AxisDragGizmo(new Vector3(0, 0, 1), Color3.Blue().scale(0.5), gizmoLayer);
 
             // Relay drag events
             [this.xGizmo, this.yGizmo, this.zGizmo].forEach((gizmo) => {

+ 4 - 5
src/Gizmos/rotationGizmo.ts

@@ -1,7 +1,6 @@
 import { Observable, Tools } from "Tools";
 import { Nullable } from "types";
-import { Vector3 } from "Math";
-import {ArcRotateCameraInputsManager} from "Gamepad";
+import { Vector3, Color3 } from "Math";
 import { Mesh, AbstractMesh } from "Mesh";
 import { _TimeToken } from "Instrumentation";
 import { _DepthCullingState, _StencilState, _AlphaState } from "States";
@@ -43,9 +42,9 @@ import { UtilityLayerRenderer } from "Rendering";
          */
         constructor(gizmoLayer: UtilityLayerRenderer= UtilityLayerRenderer.DefaultUtilityLayer, tessellation = 32) {
             super(gizmoLayer);
-            this.xGizmo = new PlaneRotationGizmo(new Vector3(1, 0, 0), BABYLON.Color3.Red().scale(0.5), gizmoLayer, tessellation);
-            this.yGizmo = new PlaneRotationGizmo(new Vector3(0, 1, 0), BABYLON.Color3.Green().scale(0.5), gizmoLayer, tessellation);
-            this.zGizmo = new PlaneRotationGizmo(new Vector3(0, 0, 1), BABYLON.Color3.Blue().scale(0.5), gizmoLayer, tessellation);
+            this.xGizmo = new PlaneRotationGizmo(new Vector3(1, 0, 0), Color3.Red().scale(0.5), gizmoLayer, tessellation);
+            this.yGizmo = new PlaneRotationGizmo(new Vector3(0, 1, 0), Color3.Green().scale(0.5), gizmoLayer, tessellation);
+            this.zGizmo = new PlaneRotationGizmo(new Vector3(0, 0, 1), Color3.Blue().scale(0.5), gizmoLayer, tessellation);
 
             // Relay drag events
             [this.xGizmo, this.yGizmo, this.zGizmo].forEach((gizmo) => {

+ 8 - 10
src/Gizmos/scaleGizmo.ts

@@ -1,9 +1,7 @@
 import { Observable, Tools } from "Tools";
 import { Nullable } from "types";
-import { Vector3 } from "Math";
-import { AbstractMesh } from "Mesh";
-import { _TimeToken } from "Instrumentation";
-import { _DepthCullingState, _StencilState, _AlphaState } from "States";
+import { Vector3, Color3 } from "Math";
+import { AbstractMesh, Mesh } from "Mesh";
 import { Gizmo, AxisScaleGizmo } from "Gizmos";
 import { UtilityLayerRenderer } from "Rendering";
     /**
@@ -47,18 +45,18 @@ import { UtilityLayerRenderer } from "Rendering";
          */
         constructor(gizmoLayer: UtilityLayerRenderer= UtilityLayerRenderer.DefaultUtilityLayer) {
             super(gizmoLayer);
-            this.xGizmo = new AxisScaleGizmo(new Vector3(1, 0, 0), BABYLON.Color3.Red().scale(0.5), gizmoLayer);
-            this.yGizmo = new AxisScaleGizmo(new Vector3(0, 1, 0), BABYLON.Color3.Green().scale(0.5), gizmoLayer);
-            this.zGizmo = new AxisScaleGizmo(new Vector3(0, 0, 1), BABYLON.Color3.Blue().scale(0.5), gizmoLayer);
+            this.xGizmo = new AxisScaleGizmo(new Vector3(1, 0, 0), Color3.Red().scale(0.5), gizmoLayer);
+            this.yGizmo = new AxisScaleGizmo(new Vector3(0, 1, 0), Color3.Green().scale(0.5), gizmoLayer);
+            this.zGizmo = new AxisScaleGizmo(new Vector3(0, 0, 1), Color3.Blue().scale(0.5), gizmoLayer);
 
             // Create uniform scale gizmo
-            this.uniformScaleGizmo = new AxisScaleGizmo(new Vector3(0, 1, 0), BABYLON.Color3.Yellow().scale(0.5), gizmoLayer);
+            this.uniformScaleGizmo = new AxisScaleGizmo(new Vector3(0, 1, 0), Color3.Yellow().scale(0.5), gizmoLayer);
             this.uniformScaleGizmo.updateGizmoRotationToMatchAttachedMesh = false;
             this.uniformScaleGizmo.uniformScaling = true;
-            var uniformScalingMesh = BABYLON.Mesh.CreatePolyhedron("", {type: 1}, this.uniformScaleGizmo.gizmoLayer.utilityLayerScene);
+            var uniformScalingMesh = Mesh.CreatePolyhedron("", {type: 1}, this.uniformScaleGizmo.gizmoLayer.utilityLayerScene);
             uniformScalingMesh.scaling.scaleInPlace(0.02);
             uniformScalingMesh.visibility = 0;
-            var octahedron = BABYLON.Mesh.CreatePolyhedron("", {type: 1}, this.uniformScaleGizmo.gizmoLayer.utilityLayerScene);
+            var octahedron = Mesh.CreatePolyhedron("", {type: 1}, this.uniformScaleGizmo.gizmoLayer.utilityLayerScene);
             octahedron.scaling.scaleInPlace(0.007);
             uniformScalingMesh.addChild(octahedron);
             this.uniformScaleGizmo.setCustomMesh(uniformScalingMesh, true);

+ 1 - 1
src/Helpers/photoDome.ts

@@ -97,7 +97,7 @@ import { _DepthCullingState, _StencilState, _AlphaState } from "States";
 
             // create
             let material = this._material = new BackgroundMaterial(name + "_material", scene);
-            this._mesh = BABYLON.Mesh.CreateSphere(name + "_mesh", options.resolution, options.size, scene, false, BABYLON.Mesh.BACKSIDE);
+            this._mesh = Mesh.CreateSphere(name + "_mesh", options.resolution, options.size, scene, false, Mesh.BACKSIDE);
 
             // configure material
             material.opacityFresnel = false;

+ 6 - 8
src/Helpers/sceneHelpers.ts

@@ -1,13 +1,11 @@
 import { Tools } from "Tools";
 import { Nullable } from "types";
-import { FreeCamera, ArcRotateCamera, TargetCamera, WebXRExperienceHelper, VRExperienceHelperOptions, VRExperienceHelper } from "Cameras";
+import { FreeCamera, ArcRotateCamera, TargetCamera, WebXRExperienceHelper, VRExperienceHelperOptions, VRExperienceHelper, WebXRManagedOutputCanvas, WebXRInput, WebXREnterExitUI } from "Cameras";
 import { Scene } from "scene";
 import { Vector3 } from "Math";
 import { Mesh } from "Mesh";
 import { StandardMaterial, Texture, BaseTexture } from "Materials";
 import { HemisphericLight } from "Lights";
-import { _TimeToken } from "Instrumentation";
-import { _DepthCullingState, _StencilState, _AlphaState } from "States";
 import { IEnvironmentHelperOptions, EnvironmentHelper } from "./environmentHelper";
     export interface Scene {
         /**
@@ -191,12 +189,12 @@ import { IEnvironmentHelperOptions, EnvironmentHelper } from "./environmentHelpe
         return new VRExperienceHelper(this, webVROptions);
     };
 
-    Scene.prototype.createDefaultXRExperienceAsync = function(): Promise<BABYLON.WebXRExperienceHelper> {
-        return BABYLON.WebXRExperienceHelper.CreateAsync(this).then((helper) => {
-            var outputCanvas = new BABYLON.WebXRManagedOutputCanvas(helper);
-            return BABYLON.WebXREnterExitUI.CreateAsync(this, helper, {outputCanvasContext: outputCanvas.canvasContext})
+    Scene.prototype.createDefaultXRExperienceAsync = function(): Promise<WebXRExperienceHelper> {
+        return WebXRExperienceHelper.CreateAsync(this).then((helper) => {
+            var outputCanvas = new WebXRManagedOutputCanvas(helper);
+            return WebXREnterExitUI.CreateAsync(this, helper, {outputCanvasContext: outputCanvas.canvasContext})
             .then(() => {
-                    new BABYLON.WebXRInput(helper);
+                    new WebXRInput(helper);
                     return helper;
                 });
         });

+ 1 - 1
src/Helpers/videoDome.ts

@@ -82,7 +82,7 @@ import { _DepthCullingState, _StencilState, _AlphaState } from "States";
             let tempOptions: VideoTextureSettings = { loop: options.loop, autoPlay: options.autoPlay, autoUpdateTexture: true, poster: options.poster };
             let material = this._material = new BackgroundMaterial(name + "_material", scene);
             let texture = this._videoTexture = new VideoTexture(name + "_texture", urlsOrVideo, scene, false, this._useDirectMapping, Texture.TRILINEAR_SAMPLINGMODE, tempOptions);
-            this._mesh = BABYLON.Mesh.CreateSphere(name + "_mesh", options.resolution, options.size, scene, false, BABYLON.Mesh.BACKSIDE);
+            this._mesh = Mesh.CreateSphere(name + "_mesh", options.resolution, options.size, scene, false, Mesh.BACKSIDE);
 
             texture.onLoadObservable.addOnce(() => {
                 this._setReady(true);

+ 0 - 2
src/Layer/glowLayer.ts

@@ -7,8 +7,6 @@ import { Engine } from "Engine";
 import { Mesh, AbstractMesh, VertexBuffer, SubMesh } from "Mesh";
 import { RenderTargetTexture, Material, Texture, Effect } from "Materials";
 import { PostProcess, BlurPostProcess } from "PostProcess";
-import { _TimeToken } from "Instrumentation";
-import { _DepthCullingState, _StencilState, _AlphaState } from "States";
 import { EffectLayer } from "Layer";
 import { AbstractScene } from "abstractScene";
     export interface AbstractScene {

+ 1 - 1
src/Layer/highlightLayer.ts

@@ -250,7 +250,7 @@ import { AbstractScene } from "abstractScene";
 
             // Warn on stencil
             if (!this._engine.isStencilEnable) {
-                Tools.Warn("Rendering the Highlight Layer requires the stencil to be active on the canvas. var engine = new BABYLON.Engine(canvas, antialias, { stencil: true }");
+                Tools.Warn("Rendering the Highlight Layer requires the stencil to be active on the canvas. var engine = new Engine(canvas, antialias, { stencil: true }");
             }
 
             // Adapt options

+ 3 - 3
src/LensFlare/lensFlare.ts

@@ -6,7 +6,7 @@ import { _TimeToken } from "Instrumentation";
 import { _DepthCullingState, _StencilState, _AlphaState } from "States";
 import { LensFlareSystem } from "LensFlare";
     /**
-     * This represents one of the lens effect in a `BABYLON.lensFlareSystem`.
+     * This represents one of the lens effect in a `lensFlareSystem`.
      * It controls one of the indiviual texture used in the effect.
      * @see http://doc.babylonjs.com/how_to/how_to_use_lens_flares
      */
@@ -30,7 +30,7 @@ import { LensFlareSystem } from "LensFlare";
 
         /**
          * Creates a new Lens Flare.
-         * This represents one of the lens effect in a `BABYLON.lensFlareSystem`.
+         * This represents one of the lens effect in a `lensFlareSystem`.
          * It controls one of the indiviual texture used in the effect.
          * @see http://doc.babylonjs.com/how_to/how_to_use_lens_flares
          * @param size Define the size of the lens flare (a floating value between 0 and 1)
@@ -46,7 +46,7 @@ import { LensFlareSystem } from "LensFlare";
 
         /**
          * Instantiates a new Lens Flare.
-         * This represents one of the lens effect in a `BABYLON.lensFlareSystem`.
+         * This represents one of the lens effect in a `lensFlareSystem`.
          * It controls one of the indiviual texture used in the effect.
          * @see http://doc.babylonjs.com/how_to/how_to_use_lens_flares
          * @param size Define the size of the lens flare in the system (a floating value between 0 and 1)

+ 2 - 2
src/LensFlare/lensFlareSystem.ts

@@ -12,7 +12,7 @@ import { _DepthCullingState, _StencilState, _AlphaState } from "States";
 import { LensFlare, LensFlareSystemSceneComponent } from "LensFlare";
     /**
      * This represents a Lens Flare System or the shiny effect created by the light reflection on the  camera lenses.
-     * It is usually composed of several `BABYLON.lensFlare`.
+     * It is usually composed of several `lensFlare`.
      * @see http://doc.babylonjs.com/how_to/how_to_use_lens_flares
      */
     export class LensFlareSystem {
@@ -59,7 +59,7 @@ import { LensFlare, LensFlareSystemSceneComponent } from "LensFlare";
         /**
          * Instantiates a lens flare system.
          * This represents a Lens Flare System or the shiny effect created by the light reflection on the  camera lenses.
-         * It is usually composed of several `BABYLON.lensFlare`.
+         * It is usually composed of several `lensFlare`.
          * @see http://doc.babylonjs.com/how_to/how_to_use_lens_flares
          * @param name Define the name of the lens flare system in the scene
          * @param emitter Define the source (the emitter) of the lens flares (it can be a camera, a light or a mesh).

+ 1 - 3
src/Lights/light.ts

@@ -2,13 +2,11 @@ import { serialize, SerializationHelper, serializeAsColor3, expandToProperty } f
 import { Nullable } from "types";
 import { Scene } from "scene";
 import { Vector3, Color3 } from "Math";
-import {Node} from "Node";
+import { Node } from "Node";
 import { AbstractMesh } from "Mesh";
 import { UniformBuffer, Effect } from "Materials";
 import { Animation } from "Animations";
 import { IShadowGenerator } from "Lights";
-import { _TimeToken } from "Instrumentation";
-import { _DepthCullingState, _StencilState, _AlphaState } from "States";
     /**
      * Base class of all the lights in Babylon. It groups all the generic information about lights.
      * Lights are used, as you would expect, to affect how meshes are seen, in terms of both illumination and colour.

+ 2 - 2
src/Lights/pointLight.ts

@@ -1,7 +1,7 @@
 import { serialize } from "Tools";
 import { Scene } from "scene";
 import { Matrix, Vector3 } from "Math";
-import {Node} from "Node";
+import { Node } from "Node";
 import { AbstractMesh } from "Mesh";
 import { ShadowLight, Light } from "Lights";
 import { _TimeToken } from "Instrumentation";
@@ -65,7 +65,7 @@ import { _DepthCullingState, _StencilState, _AlphaState } from "States";
          * It can cast shadows.
          * If the scene camera is already defined and you want to set your PointLight at the camera position, just set it :
          * ```javascript
-         * var pointLight = new BABYLON.PointLight("pl", camera.position, scene);
+         * var pointLight = new PointLight("pl", camera.position, scene);
          * ```
          * Documentation : http://doc.babylonjs.com/tutorials/lights
          * @param name The light friendly name

+ 9 - 9
src/Loading/sceneLoader.ts

@@ -524,7 +524,7 @@ import { Skeleton } from "Bones";
          * @param meshNames an array of mesh names, a single mesh name, or empty string for all meshes that filter what meshes are imported
          * @param rootUrl a string that defines the root url for the scene and resources or the concatenation of rootURL and filename (e.g. http://example.com/test.glb)
          * @param sceneFilename a string that defines the name of the scene file or starts with "data:" following by the stringified version of the scene (default: empty string)
-         * @param scene the instance of BABYLON.Scene to append to
+         * @param scene the instance of Scene to append to
          * @param onSuccess a callback with a list of imported meshes, particleSystems, and skeletons when import succeeds
          * @param onProgress a callback with a progress event for each file being loaded
          * @param onError a callback with the scene, a message, and possibly an exception when import fails
@@ -621,7 +621,7 @@ import { Skeleton } from "Bones";
          * @param meshNames an array of mesh names, a single mesh name, or empty string for all meshes that filter what meshes are imported
          * @param rootUrl a string that defines the root url for the scene and resources or the concatenation of rootURL and filename (e.g. http://example.com/test.glb)
          * @param sceneFilename a string that defines the name of the scene file or starts with "data:" following by the stringified version of the scene (default: empty string)
-         * @param scene the instance of BABYLON.Scene to append to
+         * @param scene the instance of Scene to append to
          * @param onProgress a callback with a progress event for each file being loaded
          * @param pluginExtension the extension used to determine the plugin
          * @returns The loaded list of imported meshes, particle systems, skeletons, and animation groups
@@ -646,7 +646,7 @@ import { Skeleton } from "Bones";
          * Load a scene
          * @param rootUrl a string that defines the root url for the scene and resources or the concatenation of rootURL and filename (e.g. http://example.com/test.glb)
          * @param sceneFilename a string that defines the name of the scene file or starts with "data:" following by the stringified version of the scene (default: empty string)
-         * @param engine is the instance of BABYLON.Engine to use to create the scene
+         * @param engine is the instance of Engine to use to create the scene
          * @param onSuccess a callback with the scene when import succeeds
          * @param onProgress a callback with a progress event for each file being loaded
          * @param onError a callback with the scene, a message, and possibly an exception when import fails
@@ -661,7 +661,7 @@ import { Skeleton } from "Bones";
          * Load a scene
          * @param rootUrl a string that defines the root url for the scene and resources or the concatenation of rootURL and filename (e.g. http://example.com/test.glb)
          * @param sceneFilename a string that defines the name of the scene file or starts with "data:" following by the stringified version of the scene (default: empty string)
-         * @param engine is the instance of BABYLON.Engine to use to create the scene
+         * @param engine is the instance of Engine to use to create the scene
          * @param onProgress a callback with a progress event for each file being loaded
          * @param pluginExtension the extension used to determine the plugin
          * @returns The loaded scene
@@ -680,7 +680,7 @@ import { Skeleton } from "Bones";
          * Append a scene
          * @param rootUrl a string that defines the root url for the scene and resources or the concatenation of rootURL and filename (e.g. http://example.com/test.glb)
          * @param sceneFilename a string that defines the name of the scene file or starts with "data:" following by the stringified version of the scene (default: empty string)
-         * @param scene is the instance of BABYLON.Scene to append to
+         * @param scene is the instance of Scene to append to
          * @param onSuccess a callback with the scene when import succeeds
          * @param onProgress a callback with a progress event for each file being loaded
          * @param onError a callback with the scene, a message, and possibly an exception when import fails
@@ -775,7 +775,7 @@ import { Skeleton } from "Bones";
          * Append a scene
          * @param rootUrl a string that defines the root url for the scene and resources or the concatenation of rootURL and filename (e.g. http://example.com/test.glb)
          * @param sceneFilename a string that defines the name of the scene file or starts with "data:" following by the stringified version of the scene (default: empty string)
-         * @param scene is the instance of BABYLON.Scene to append to
+         * @param scene is the instance of Scene to append to
          * @param onProgress a callback with a progress event for each file being loaded
          * @param pluginExtension the extension used to determine the plugin
          * @returns The given scene
@@ -794,7 +794,7 @@ import { Skeleton } from "Bones";
          * Load a scene into an asset container
          * @param rootUrl a string that defines the root url for the scene and resources or the concatenation of rootURL and filename (e.g. http://example.com/test.glb)
          * @param sceneFilename a string that defines the name of the scene file or starts with "data:" following by the stringified version of the scene (default: empty string)
-         * @param scene is the instance of BABYLON.Scene to append to (default: last created scene)
+         * @param scene is the instance of Scene to append to (default: last created scene)
          * @param onSuccess a callback with the scene when import succeeds
          * @param onProgress a callback with a progress event for each file being loaded
          * @param onError a callback with the scene, a message, and possibly an exception when import fails
@@ -804,7 +804,7 @@ import { Skeleton } from "Bones";
         public static LoadAssetContainer(
             rootUrl: string,
             sceneFilename: string = "",
-            scene: Nullable<Scene> = BABYLON.Engine.LastCreatedScene,
+            scene: Nullable<Scene> = Engine.LastCreatedScene,
             onSuccess: Nullable<(assets: AssetContainer) => void> = null,
             onProgress: Nullable<(event: SceneLoaderProgressEvent) => void> = null,
             onError: Nullable<(scene: Scene, message: string, exception?: any) => void> = null,
@@ -895,7 +895,7 @@ import { Skeleton } from "Bones";
          * Load a scene into an asset container
          * @param rootUrl a string that defines the root url for the scene and resources or the concatenation of rootURL and filename (e.g. http://example.com/test.glb)
          * @param sceneFilename a string that defines the name of the scene file or starts with "data:" following by the stringified version of the scene (default: empty string)
-         * @param scene is the instance of BABYLON.Scene to append to
+         * @param scene is the instance of Scene to append to
          * @param onProgress a callback with a progress event for each file being loaded
          * @param pluginExtension the extension used to determine the plugin
          * @returns The loaded asset container

+ 1 - 1
src/Materials/Textures/cubeTexture.ts

@@ -57,7 +57,7 @@ import { _DepthCullingState, _StencilState, _AlphaState } from "States";
         @serialize("rotationY")
         public set rotationY(value: number) {
             this._rotationY = value;
-            this.setReflectionTextureMatrix(BABYLON.Matrix.RotationY(this._rotationY));
+            this.setReflectionTextureMatrix(Matrix.RotationY(this._rotationY));
         }
         /**
          * Gets texture matrix rotation angle around Y axis radians.

+ 2 - 2
src/Materials/Textures/dynamicTexture.ts

@@ -22,8 +22,8 @@ import { _DepthCullingState, _StencilState, _AlphaState } from "States";
          * @param options provides 3 alternatives for width and height of texture, a canvas, object with width and height properties, number for both width and height
          * @param scene defines the scene where you want the texture
          * @param generateMipMaps defines the use of MinMaps or not (default is false)
-         * @param samplingMode defines the sampling mode to use (default is BABYLON.Texture.TRILINEAR_SAMPLINGMODE)
-         * @param format defines the texture format to use (default is BABYLON.Engine.TEXTUREFORMAT_RGBA)
+         * @param samplingMode defines the sampling mode to use (default is Texture.TRILINEAR_SAMPLINGMODE)
+         * @param format defines the texture format to use (default is Engine.TEXTUREFORMAT_RGBA)
          */
 
         constructor(name: string, options: any, scene: Nullable<Scene> = null, generateMipMaps: boolean, samplingMode: number = Texture.TRILINEAR_SAMPLINGMODE, format: number = Engine.TEXTUREFORMAT_RGBA) {

+ 1 - 1
src/Materials/Textures/hdrCubeTexture.ts

@@ -60,7 +60,7 @@ import { HDRTools, CubeMapToSphericalPolynomialTools } from "Tools";
          */
         public set rotationY(value: number) {
             this._rotationY = value;
-            this.setReflectionTextureMatrix(BABYLON.Matrix.RotationY(this._rotationY));
+            this.setReflectionTextureMatrix(Matrix.RotationY(this._rotationY));
         }
         /**
          * Gets texture matrix rotation angle around Y axis radians.

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

@@ -232,7 +232,7 @@ import { _DepthCullingState, _StencilState, _AlphaState } from "States";
         }
 
         /**
-         * Gets the data source type of the texture (can be one of the BABYLON.InternalTexture.DATASOURCE_XXXX)
+         * Gets the data source type of the texture (can be one of the InternalTexture.DATASOURCE_XXXX)
          */
         public get dataSource(): number {
             return this._dataSource;

+ 1 - 1
src/Materials/Textures/mirrorTexture.ts

@@ -16,7 +16,7 @@ import { BlurPostProcess } from "PostProcess";
     export class MirrorTexture extends RenderTargetTexture {
         /**
          * Define the reflection plane we want to use. The mirrorPlane is usually set to the constructed reflector.
-         * It is possible to directly set the mirrorPlane by directly using a BABYLON.Plane(a, b, c, d) where a, b and c give the plane normal vector (a, b, c) and d is a scalar displacement from the mirrorPlane to the origin. However in all but the very simplest of situations it is more straight forward to set it to the reflector as stated in the doc.
+         * It is possible to directly set the mirrorPlane by directly using a Plane(a, b, c, d) where a, b and c give the plane normal vector (a, b, c) and d is a scalar displacement from the mirrorPlane to the origin. However in all but the very simplest of situations it is more straight forward to set it to the reflector as stated in the doc.
          * @see https://doc.babylonjs.com/how_to/reflect#mirrors
          */
         public mirrorPlane = new Plane(0, 1, 0, 1);

+ 3 - 3
src/Materials/Textures/rawCubeTexture.ts

@@ -14,10 +14,10 @@ import { Texture, InternalTexture, CubeTexture } from "Materials";
          * @param data defines the array of data to use to create each face
          * @param size defines the size of the textures
          * @param format defines the format of the data
-         * @param type defines the type of the data (like BABYLON.Engine.TEXTURETYPE_UNSIGNED_INT)
+         * @param type defines the type of the data (like Engine.TEXTURETYPE_UNSIGNED_INT)
          * @param generateMipMaps  defines if the engine should generate the mip levels
          * @param invertY defines if data must be stored with Y axis inverted
-         * @param samplingMode defines the required sampling mode (like BABYLON.Texture.NEAREST_SAMPLINGMODE)
+         * @param samplingMode defines the required sampling mode (like Texture.NEAREST_SAMPLINGMODE)
          * @param compression defines the compression used (null by default)
          */
         constructor(scene: Scene, data: Nullable<ArrayBufferView[]>, size: number,
@@ -33,7 +33,7 @@ import { Texture, InternalTexture, CubeTexture } from "Materials";
          * Updates the raw cube texture.
          * @param data defines the data to store
          * @param format defines the data format
-         * @param type defines the type fo the data (BABYLON.Engine.TEXTURETYPE_UNSIGNED_INT by default)
+         * @param type defines the type fo the data (Engine.TEXTURETYPE_UNSIGNED_INT by default)
          * @param invertY defines if data must be stored with Y axis inverted
          * @param compression defines the compression used (null by default)
          * @param level defines which level of the texture to update

+ 1 - 1
src/Materials/Textures/rawTexture3D.ts

@@ -17,7 +17,7 @@ import { Texture } from "Materials";
          * @param scene defines the hosting scene
          * @param generateMipMaps defines a boolean indicating if mip levels should be generated (true by default)
          * @param invertY defines if texture must be stored with Y axis inverted
-         * @param samplingMode defines the sampling mode to use (BABYLON.Texture.TRILINEAR_SAMPLINGMODE by default)
+         * @param samplingMode defines the sampling mode to use (Texture.TRILINEAR_SAMPLINGMODE by default)
          * @param textureType defines the texture Type (Engine.TEXTURETYPE_UNSIGNED_INT, Engine.TEXTURETYPE_FLOAT...)
          */
         constructor(data: ArrayBufferView, width: number, height: number, depth: number,

+ 1 - 1
src/Materials/Textures/refractionTexture.ts

@@ -9,7 +9,7 @@ import { RenderTargetTexture } from "Materials";
     export class RefractionTexture extends RenderTargetTexture {
         /**
          * Define the reflection plane we want to use. The refractionPlane is usually set to the constructed refractor.
-         * It is possible to directly set the refractionPlane by directly using a BABYLON.Plane(a, b, c, d) where a, b and c give the plane normal vector (a, b, c) and d is a scalar displacement from the refractionPlane to the origin. However in all but the very simplest of situations it is more straight forward to set it to the refractor as stated in the doc.
+         * It is possible to directly set the refractionPlane by directly using a Plane(a, b, c, d) where a, b and c give the plane normal vector (a, b, c) and d is a scalar displacement from the refractionPlane to the origin. However in all but the very simplest of situations it is more straight forward to set it to the refractor as stated in the doc.
          * @see https://doc.babylonjs.com/how_to/reflect#refraction
          */
         public refractionPlane = new Plane(0, 1, 0, 1);

+ 1 - 1
src/Materials/imageProcessingConfiguration.ts

@@ -1,4 +1,4 @@
-import { serialize, Observable, Tools, SerializationHelper, serializeAsTexture } from "Tools";
+import { serialize, Observable, Tools, SerializationHelper, serializeAsTexture, serializeAsColorCurves, serializeAsColor4 } from "Tools";
 import { Nullable } from "types";
 import { Color4 } from "Math";
 import { Effect, BaseTexture, IImageProcessingConfigurationDefines, ColorCurves, MaterialDefines } from "Materials";

+ 2 - 2
src/Materials/materialHelper.ts

@@ -2,7 +2,7 @@ import { Tools } from "Tools";
 import { Nullable } from "types";
 import { Camera } from "Cameras";
 import { Scene } from "scene";
-import { Tmp } from "Math";
+import { Tmp, Color3 } from "Math";
 import { Engine } from "Engine";
 import { Mesh, AbstractMesh, VertexBuffer } from "Mesh";
 import { UniformBuffer, Effect, BaseTexture, EffectFallbacks, EffectCreationOptions } from "Materials";
@@ -586,7 +586,7 @@ import { Light } from "Lights";
             }
         }
 
-        private static _tempFogColor = BABYLON.Color3.Black();
+        private static _tempFogColor = Color3.Black();
         /**
          * Binds the fog information from the scene to the effect for the given mesh.
          * @param scene The scene the lights belongs to

+ 2 - 2
src/Materials/shaderMaterial.ts

@@ -80,7 +80,7 @@ import { Material, Texture, BaseTexture, MaterialHelper, EffectFallbacks, Effect
          * @param name Define the name of the material in the scene
          * @param scene Define the scene the material belongs to
          * @param shaderPath Defines  the route to the shader code in one of three ways:
-         *     - object - { vertex: "custom", fragment: "custom" }, used with BABYLON.Effect.ShadersStore["customVertexShader"] and BABYLON.Effect.ShadersStore["customFragmentShader"]
+         *     - object - { vertex: "custom", fragment: "custom" }, used with Effect.ShadersStore["customVertexShader"] and Effect.ShadersStore["customFragmentShader"]
          *     - object - { vertexElement: "vertexShaderCode", fragmentElement: "fragmentShaderCode" }, used with shader code in <script> tags
          *     - string - "./COMMON_NAME", used with external files COMMON_NAME.vertex.fx and COMMON_NAME.fragment.fx in index.html folder.
          * @param options Define the options used to create the shader
@@ -705,7 +705,7 @@ import { Material, Texture, BaseTexture, MaterialHelper, EffectFallbacks, Effect
          */
         public serialize(): any {
             var serializationObject = SerializationHelper.Serialize(this);
-            serializationObject.customType = "BABYLON.ShaderMaterial";
+            serializationObject.customType = "ShaderMaterial";
 
             serializationObject.options = this._options;
             serializationObject.shaderPath = this._shaderPath;

+ 2 - 2
src/Math/math.ts

@@ -1532,7 +1532,7 @@ import { Ray } from "Culling";
      * Classed used to store (x,y,z) vector representation
      * A Vector3 is the main object used in 3D geometry
      * It can represent etiher the coordinates of a point the space, either a direction
-     * Reminder: Babylon.js uses a left handed forward facing system
+     * Reminder: js uses a left handed forward facing system
      */
     export class Vector3 {
         /**
@@ -1614,7 +1614,7 @@ import { Ray } from "Culling";
          * @returns a new Quaternion object, computed from the Vector3 coordinates
          */
         public toQuaternion(): Quaternion {
-            return BABYLON.Quaternion.RotationYawPitchRoll(this.y, this.x, this.z);
+            return Quaternion.RotationYawPitchRoll(this.y, this.x, this.z);
         }
 
         /**

+ 4 - 4
src/Mesh/Compression/dracoCompression.ts

@@ -46,7 +46,7 @@ declare var WebAssembly: any;
      *
      * To update the configuration, use the following code:
      * ```javascript
-     *     BABYLON.DracoCompression.Configuration = {
+     *     DracoCompression.Configuration = {
      *         decoder: {
      *             wasmUrl: "<url to the WebAssembly library>",
      *             wasmBinaryUrl: "<url to the WebAssembly binary>",
@@ -57,13 +57,13 @@ declare var WebAssembly: any;
      *
      * Draco has two versions, one for WebAssembly and one for JavaScript. The decoder configuration can be set to only support Webssembly or only support the JavaScript version.
      * Decoding will automatically fallback to the JavaScript version if WebAssembly version is not configured or if WebAssembly is not supported by the browser.
-     * Use `BABYLON.DracoCompression.DecoderAvailable` to determine if the decoder is available for the current session.
+     * Use `DracoCompression.DecoderAvailable` to determine if the decoder is available for the current session.
      *
      * To decode Draco compressed data, create a DracoCompression object and call decodeMeshAsync:
      * ```javascript
-     *     var dracoCompression = new BABYLON.DracoCompression();
+     *     var dracoCompression = new DracoCompression();
      *     var vertexData = await dracoCompression.decodeMeshAsync(data, {
-     *         [BABYLON.VertexBuffer.PositionKind]: 0
+     *         [VertexBuffer.PositionKind]: 0
      *     });
      * ```
      *

+ 26 - 25
src/Mesh/abstractMesh.ts

@@ -4,7 +4,7 @@ import { Camera } from "Cameras";
 import { Scene, IDisposable } from "scene";
 import { Quaternion, Matrix, Vector3, Color3, Color4, Plane, Tmp, Epsilon, Axis } from "Math";
 import { Engine } from "Engine";
-import {Node} from "Node";
+import { Node } from "Node";
 import { InstancedMesh, VertexBuffer, TransformNode, SubMesh, LinesMesh, IGetSetVerticesData, VertexData } from "Mesh";
 import { PickingInfo, Collider, IntersectionInfo } from "Collisions";
 import { Ray, ICullable, BoundingInfo } from "Culling";
@@ -14,6 +14,7 @@ import { ActionManager } from "Actions";
 import { Skeleton } from "Bones";
 import { IEdgesRenderer } from "Rendering";
 import { SolidParticle } from "Particles";
+
     /** @hidden */
     class _FacetDataStorage {
         // facetData private properties
@@ -780,18 +781,18 @@ import { SolidParticle } from "Particles";
          * Note that a new underlying VertexBuffer object is created each call.
          * If the `kind` is the `PositionKind`, the mesh BoundingInfo is renewed, so the bounding box and sphere, and the mesh World Matrix is recomputed.
          * @param kind defines vertex data kind:
-         * * BABYLON.VertexBuffer.PositionKind
-         * * BABYLON.VertexBuffer.UVKind
-         * * BABYLON.VertexBuffer.UV2Kind
-         * * BABYLON.VertexBuffer.UV3Kind
-         * * BABYLON.VertexBuffer.UV4Kind
-         * * BABYLON.VertexBuffer.UV5Kind
-         * * BABYLON.VertexBuffer.UV6Kind
-         * * BABYLON.VertexBuffer.ColorKind
-         * * BABYLON.VertexBuffer.MatricesIndicesKind
-         * * BABYLON.VertexBuffer.MatricesIndicesExtraKind
-         * * BABYLON.VertexBuffer.MatricesWeightsKind
-         * * BABYLON.VertexBuffer.MatricesWeightsExtraKind
+         * * VertexBuffer.PositionKind
+         * * VertexBuffer.UVKind
+         * * VertexBuffer.UV2Kind
+         * * VertexBuffer.UV3Kind
+         * * VertexBuffer.UV4Kind
+         * * VertexBuffer.UV5Kind
+         * * VertexBuffer.UV6Kind
+         * * VertexBuffer.ColorKind
+         * * VertexBuffer.MatricesIndicesKind
+         * * VertexBuffer.MatricesIndicesExtraKind
+         * * VertexBuffer.MatricesWeightsKind
+         * * VertexBuffer.MatricesWeightsExtraKind
          * @param data defines the data source
          * @param updatable defines if the data must be flagged as updatable (or static)
          * @param stride defines the vertex stride (size of an entire vertex). Can be null and in this case will be deduced from vertex data kind
@@ -805,18 +806,18 @@ import { SolidParticle } from "Particles";
          * Updates the existing vertex data of the mesh geometry for the requested `kind`.
          * If the mesh has no geometry, it is simply returned as it is.
          * @param kind defines vertex data kind:
-         * * BABYLON.VertexBuffer.PositionKind
-         * * BABYLON.VertexBuffer.UVKind
-         * * BABYLON.VertexBuffer.UV2Kind
-         * * BABYLON.VertexBuffer.UV3Kind
-         * * BABYLON.VertexBuffer.UV4Kind
-         * * BABYLON.VertexBuffer.UV5Kind
-         * * BABYLON.VertexBuffer.UV6Kind
-         * * BABYLON.VertexBuffer.ColorKind
-         * * BABYLON.VertexBuffer.MatricesIndicesKind
-         * * BABYLON.VertexBuffer.MatricesIndicesExtraKind
-         * * BABYLON.VertexBuffer.MatricesWeightsKind
-         * * BABYLON.VertexBuffer.MatricesWeightsExtraKind
+         * * VertexBuffer.PositionKind
+         * * VertexBuffer.UVKind
+         * * VertexBuffer.UV2Kind
+         * * VertexBuffer.UV3Kind
+         * * VertexBuffer.UV4Kind
+         * * VertexBuffer.UV5Kind
+         * * VertexBuffer.UV6Kind
+         * * VertexBuffer.ColorKind
+         * * VertexBuffer.MatricesIndicesKind
+         * * VertexBuffer.MatricesIndicesExtraKind
+         * * VertexBuffer.MatricesWeightsKind
+         * * VertexBuffer.MatricesWeightsExtraKind
          * @param data defines the data source
          * @param updateExtends If `kind` is `PositionKind` and if `updateExtends` is true, the mesh BoundingInfo is renewed, so the bounding box and sphere, and the mesh World Matrix is recomputed
          * @param makeItUnique If true, a new global geometry is created from this data and is set to the mesh

+ 1 - 1
src/Mesh/buffer.ts

@@ -28,7 +28,7 @@ import { Mesh, VertexBuffer } from "Mesh";
          * @param useBytes set to true if the stride in in bytes (optional)
          */
         constructor(engine: any, data: DataArray, updatable: boolean, stride = 0, postponeInternalCreation = false, instanced = false, useBytes = false) {
-            if (engine instanceof Mesh) { // old versions of BABYLON.VertexBuffer accepted 'mesh' instead of 'engine'
+            if (engine instanceof Mesh) { // old versions of VertexBuffer accepted 'mesh' instead of 'engine'
                 this._engine = engine.getScene().getEngine();
             }
             else {

+ 21 - 21
src/Mesh/csg.ts

@@ -84,7 +84,7 @@ import { Material } from "Materials";
         }
 
         /**
-         * `BABYLON.CSG.Plane.EPSILON` is the tolerance used by `splitPolygon()` to decide if a
+         * `CSG.Plane.EPSILON` is the tolerance used by `splitPolygon()` to decide if a
          * point is on the plane
          */
         static EPSILON = 1e-5;
@@ -406,9 +406,9 @@ import { Material } from "Materials";
         public scaling: Vector3;
 
         /**
-         * Convert the BABYLON.Mesh to BABYLON.CSG
-         * @param mesh The BABYLON.Mesh to convert to BABYLON.CSG
-         * @returns A new BABYLON.CSG from the BABYLON.Mesh
+         * Convert the Mesh to CSG
+         * @param mesh The Mesh to convert to CSG
+         * @returns A new CSG from the Mesh
          */
         public static FromMesh(mesh: Mesh): CSG {
             var vertex: Vertex, normal: Vector3, uv: Vector2, position: Vector3,
@@ -477,8 +477,8 @@ import { Material } from "Materials";
         }
 
         /**
-         * Construct a BABYLON.CSG solid from a list of `BABYLON.CSG.Polygon` instances.
-         * @param polygons Polygons used to construct a BABYLON.CSG solid
+         * Construct a CSG solid from a list of `CSG.Polygon` instances.
+         * @param polygons Polygons used to construct a CSG solid
          */
         private static FromPolygons(polygons: Polygon[]): CSG {
             var csg = new CSG();
@@ -487,8 +487,8 @@ import { Material } from "Materials";
         }
 
         /**
-         * Clones, or makes a deep copy, of the BABYLON.CSG
-         * @returns A new BABYLON.CSG
+         * Clones, or makes a deep copy, of the CSG
+         * @returns A new CSG
          */
         public clone(): CSG {
             var csg = new CSG();
@@ -535,7 +535,7 @@ import { Material } from "Materials";
         /**
          * Subtracts this CSG with another CSG
          * @param csg The CSG to subtract against this CSG
-         * @returns A new BABYLON.CSG
+         * @returns A new CSG
          */
         public subtract(csg: CSG): CSG {
             var a = new Node(this.clone().polygons);
@@ -574,7 +574,7 @@ import { Material } from "Materials";
         /**
          * Intersect this CSG with another CSG
          * @param csg The CSG to intersect against this CSG
-         * @returns A new BABYLON.CSG
+         * @returns A new CSG
          */
         public intersect(csg: CSG): CSG {
             var a = new Node(this.clone().polygons);
@@ -609,9 +609,9 @@ import { Material } from "Materials";
         }
 
         /**
-         * Return a new BABYLON.CSG solid with solid and empty space switched. This solid is
+         * Return a new CSG solid with solid and empty space switched. This solid is
          * not modified.
-         * @returns A new BABYLON.CSG solid with solid and empty space switched
+         * @returns A new CSG solid with solid and empty space switched
          */
         public inverse(): CSG {
             var csg = this.clone();
@@ -620,7 +620,7 @@ import { Material } from "Materials";
         }
 
         /**
-         * Inverses the BABYLON.CSG in place
+         * Inverses the CSG in place
          */
         public inverseInPlace(): void {
             this.polygons.map((p) => { p.flip(); });
@@ -630,8 +630,8 @@ import { Material } from "Materials";
          * This is used to keep meshes transformations so they can be restored
          * when we build back a Babylon Mesh
          * NB : All CSG operations are performed in world coordinates
-         * @param csg The BABYLON.CSG to copy the transform attributes from
-         * @returns This BABYLON.CSG
+         * @param csg The CSG to copy the transform attributes from
+         * @returns This CSG
          */
         public copyTransformAttributes(csg: CSG): CSG {
             this.matrix = csg.matrix;
@@ -647,9 +647,9 @@ import { Material } from "Materials";
          * Build Raw mesh from CSG
          * Coordinates here are in world space
          * @param name The name of the mesh geometry
-         * @param scene The BABYLON.Scene
+         * @param scene The Scene
          * @param keepSubMeshes Specifies if the submeshes should be kept
-         * @returns A new BABYLON.Mesh
+         * @returns A new Mesh
          */
         public buildMeshGeometry(name: string, scene: Scene, keepSubMeshes: boolean): Mesh {
             var matrix = this.matrix.clone();
@@ -765,11 +765,11 @@ import { Material } from "Materials";
 
         /**
          * Build Mesh from CSG taking material and transforms into account
-         * @param name The name of the BABYLON.Mesh
-         * @param material The material of the BABYLON.Mesh
-         * @param scene The BABYLON.Scene
+         * @param name The name of the Mesh
+         * @param material The material of the Mesh
+         * @param scene The Scene
          * @param keepSubMeshes Specifies if submeshes should be kept
-         * @returns The new BABYLON.Mesh
+         * @returns The new Mesh
          */
         public toMesh(name: string, material: Nullable<Material>, scene: Scene, keepSubMeshes: boolean): Mesh {
             var mesh = this.buildMeshGeometry(name, scene, keepSubMeshes);

+ 16 - 16
src/Mesh/geometry.ts

@@ -1557,7 +1557,7 @@ import { BoundingInfo } from "index";
          * @param offset defines the offset between points
          * @param canBeRegenerated defines if the geometry supports being regenerated with new parameters (false by default)
          * @param mesh defines the hosting mesh (can be null)
-         * @param side defines if the created geometry is double sided or not (default is BABYLON.Mesh.DEFAULTSIDE)
+         * @param side defines if the created geometry is double sided or not (default is Mesh.DEFAULTSIDE)
          */
         constructor(
             id: string, scene: Scene,
@@ -1580,7 +1580,7 @@ import { BoundingInfo } from "index";
             canBeRegenerated?: boolean,
             mesh?: Mesh,
             /**
-             * Defines if the created geometry is double sided or not (default is BABYLON.Mesh.DEFAULTSIDE)
+             * Defines if the created geometry is double sided or not (default is Mesh.DEFAULTSIDE)
              */
             public side: number = Mesh.DEFAULTSIDE) {
             super(id, scene, canBeRegenerated, mesh);
@@ -1609,7 +1609,7 @@ import { BoundingInfo } from "index";
          * @param size defines the zise of the box (width, height and depth are the same)
          * @param canBeRegenerated defines if the geometry supports being regenerated with new parameters (false by default)
          * @param mesh defines the hosting mesh (can be null)
-         * @param side defines if the created geometry is double sided or not (default is BABYLON.Mesh.DEFAULTSIDE)
+         * @param side defines if the created geometry is double sided or not (default is Mesh.DEFAULTSIDE)
          */
         constructor(
             id: string, scene: Scene,
@@ -1620,7 +1620,7 @@ import { BoundingInfo } from "index";
             canBeRegenerated?: boolean,
             mesh: Nullable<Mesh> = null,
             /**
-             * Defines if the created geometry is double sided or not (default is BABYLON.Mesh.DEFAULTSIDE)
+             * Defines if the created geometry is double sided or not (default is Mesh.DEFAULTSIDE)
              */
             public side: number = Mesh.DEFAULTSIDE) {
             super(id, scene, canBeRegenerated, mesh);
@@ -1673,7 +1673,7 @@ import { BoundingInfo } from "index";
          * @param diameter defines the diameter of the sphere
          * @param canBeRegenerated defines if the geometry supports being regenerated with new parameters (false by default)
          * @param mesh defines the hosting mesh (can be null)
-         * @param side defines if the created geometry is double sided or not (default is BABYLON.Mesh.DEFAULTSIDE)
+         * @param side defines if the created geometry is double sided or not (default is Mesh.DEFAULTSIDE)
          */
         constructor(
             id: string, scene: Scene,
@@ -1688,7 +1688,7 @@ import { BoundingInfo } from "index";
             canBeRegenerated?: boolean,
             mesh: Nullable<Mesh> = null,
             /**
-             * Defines if the created geometry is double sided or not (default is BABYLON.Mesh.DEFAULTSIDE)
+             * Defines if the created geometry is double sided or not (default is Mesh.DEFAULTSIDE)
              */
             public side: number = Mesh.DEFAULTSIDE) {
             super(id, scene, canBeRegenerated, mesh);
@@ -1742,7 +1742,7 @@ import { BoundingInfo } from "index";
          * @param tessellation defines the tesselation factor to apply to the disc
          * @param canBeRegenerated defines if the geometry supports being regenerated with new parameters (false by default)
          * @param mesh defines the hosting mesh (can be null)
-         * @param side defines if the created geometry is double sided or not (default is BABYLON.Mesh.DEFAULTSIDE)
+         * @param side defines if the created geometry is double sided or not (default is Mesh.DEFAULTSIDE)
          */
         constructor(
             id: string, scene: Scene,
@@ -1757,7 +1757,7 @@ import { BoundingInfo } from "index";
             canBeRegenerated?: boolean,
             mesh: Nullable<Mesh> = null,
             /**
-             * Defines if the created geometry is double sided or not (default is BABYLON.Mesh.DEFAULTSIDE)
+             * Defines if the created geometry is double sided or not (default is Mesh.DEFAULTSIDE)
              */
             public side: number = Mesh.DEFAULTSIDE) {
             super(id, scene, canBeRegenerated, mesh);
@@ -1790,7 +1790,7 @@ import { BoundingInfo } from "index";
          * @param subdivisions defines the number of subdivisions to apply to the cylinder (number of rings) (1 by default)
          * @param canBeRegenerated defines if the geometry supports being regenerated with new parameters (false by default)
          * @param mesh defines the hosting mesh (can be null)
-         * @param side defines if the created geometry is double sided or not (default is BABYLON.Mesh.DEFAULTSIDE)
+         * @param side defines if the created geometry is double sided or not (default is Mesh.DEFAULTSIDE)
          */
         constructor(
             id: string, scene: Scene,
@@ -1817,7 +1817,7 @@ import { BoundingInfo } from "index";
             canBeRegenerated?: boolean, mesh:
                 Nullable<Mesh> = null,
             /**
-             * Defines if the created geometry is double sided or not (default is BABYLON.Mesh.DEFAULTSIDE)
+             * Defines if the created geometry is double sided or not (default is Mesh.DEFAULTSIDE)
              */
             public side: number = Mesh.DEFAULTSIDE) {
             super(id, scene, canBeRegenerated, mesh);
@@ -1874,7 +1874,7 @@ import { BoundingInfo } from "index";
          * @param tessellation defines the tesselation factor to apply to the torus (number of segments along the circle)
          * @param canBeRegenerated defines if the geometry supports being regenerated with new parameters (false by default)
          * @param mesh defines the hosting mesh (can be null)
-         * @param side defines if the created geometry is double sided or not (default is BABYLON.Mesh.DEFAULTSIDE)
+         * @param side defines if the created geometry is double sided or not (default is Mesh.DEFAULTSIDE)
          */
         constructor(
             id: string, scene: Scene,
@@ -1893,7 +1893,7 @@ import { BoundingInfo } from "index";
             canBeRegenerated?: boolean,
             mesh: Nullable<Mesh> = null,
             /**
-             * Defines if the created geometry is double sided or not (default is BABYLON.Mesh.DEFAULTSIDE)
+             * Defines if the created geometry is double sided or not (default is Mesh.DEFAULTSIDE)
              */
             public side: number = Mesh.DEFAULTSIDE) {
             super(id, scene, canBeRegenerated, mesh);
@@ -2077,7 +2077,7 @@ import { BoundingInfo } from "index";
          * @param size defines the size of the plane (width === height)
          * @param canBeRegenerated defines if the geometry supports being regenerated with new parameters (false by default)
          * @param mesh defines the hosting mesh (can be null)
-         * @param side defines if the created geometry is double sided or not (default is BABYLON.Mesh.DEFAULTSIDE)
+         * @param side defines if the created geometry is double sided or not (default is Mesh.DEFAULTSIDE)
          */
         constructor(
             id: string, scene: Scene,
@@ -2088,7 +2088,7 @@ import { BoundingInfo } from "index";
             canBeRegenerated?: boolean,
             mesh: Nullable<Mesh> = null,
             /**
-             * Defines if the created geometry is double sided or not (default is BABYLON.Mesh.DEFAULTSIDE)
+             * Defines if the created geometry is double sided or not (default is Mesh.DEFAULTSIDE)
              */
             public side: number = Mesh.DEFAULTSIDE) {
             super(id, scene, canBeRegenerated, mesh);
@@ -2145,7 +2145,7 @@ import { BoundingInfo } from "index";
          * @param q defines the second number of windings
          * @param canBeRegenerated defines if the geometry supports being regenerated with new parameters (false by default)
          * @param mesh defines the hosting mesh (can be null)
-         * @param side defines if the created geometry is double sided or not (default is BABYLON.Mesh.DEFAULTSIDE)
+         * @param side defines if the created geometry is double sided or not (default is Mesh.DEFAULTSIDE)
          */
         constructor(
             id: string, scene: Scene,
@@ -2176,7 +2176,7 @@ import { BoundingInfo } from "index";
             canBeRegenerated?: boolean,
             mesh: Nullable<Mesh> = null,
             /**
-             * Defines if the created geometry is double sided or not (default is BABYLON.Mesh.DEFAULTSIDE)
+             * Defines if the created geometry is double sided or not (default is Mesh.DEFAULTSIDE)
              */
             public side: number = Mesh.DEFAULTSIDE) {
             super(id, scene, canBeRegenerated, mesh);

+ 24 - 24
src/Mesh/instancedMesh.ts

@@ -135,18 +135,18 @@ import { BoundingInfo } from "Culling";
          * If the `kind` is the `PositionKind`, the mesh BoundingInfo is renewed, so the bounding box and sphere, and the mesh World Matrix is recomputed.
          *
          * Possible `kind` values :
-         * - BABYLON.VertexBuffer.PositionKind
-         * - BABYLON.VertexBuffer.UVKind
-         * - BABYLON.VertexBuffer.UV2Kind
-         * - BABYLON.VertexBuffer.UV3Kind
-         * - BABYLON.VertexBuffer.UV4Kind
-         * - BABYLON.VertexBuffer.UV5Kind
-         * - BABYLON.VertexBuffer.UV6Kind
-         * - BABYLON.VertexBuffer.ColorKind
-         * - BABYLON.VertexBuffer.MatricesIndicesKind
-         * - BABYLON.VertexBuffer.MatricesIndicesExtraKind
-         * - BABYLON.VertexBuffer.MatricesWeightsKind
-         * - BABYLON.VertexBuffer.MatricesWeightsExtraKind
+         * - VertexBuffer.PositionKind
+         * - VertexBuffer.UVKind
+         * - VertexBuffer.UV2Kind
+         * - VertexBuffer.UV3Kind
+         * - VertexBuffer.UV4Kind
+         * - VertexBuffer.UV5Kind
+         * - VertexBuffer.UV6Kind
+         * - VertexBuffer.ColorKind
+         * - VertexBuffer.MatricesIndicesKind
+         * - VertexBuffer.MatricesIndicesExtraKind
+         * - VertexBuffer.MatricesWeightsKind
+         * - VertexBuffer.MatricesWeightsExtraKind
          *
          * Returns the Mesh.
          */
@@ -166,18 +166,18 @@ import { BoundingInfo } from "Culling";
          * If the parameter `makeItUnique` is true, a new global geometry is created from this positions and is set to the mesh.
          *
          * Possible `kind` values :
-         * - BABYLON.VertexBuffer.PositionKind
-         * - BABYLON.VertexBuffer.UVKind
-         * - BABYLON.VertexBuffer.UV2Kind
-         * - BABYLON.VertexBuffer.UV3Kind
-         * - BABYLON.VertexBuffer.UV4Kind
-         * - BABYLON.VertexBuffer.UV5Kind
-         * - BABYLON.VertexBuffer.UV6Kind
-         * - BABYLON.VertexBuffer.ColorKind
-         * - BABYLON.VertexBuffer.MatricesIndicesKind
-         * - BABYLON.VertexBuffer.MatricesIndicesExtraKind
-         * - BABYLON.VertexBuffer.MatricesWeightsKind
-         * - BABYLON.VertexBuffer.MatricesWeightsExtraKind
+         * - VertexBuffer.PositionKind
+         * - VertexBuffer.UVKind
+         * - VertexBuffer.UV2Kind
+         * - VertexBuffer.UV3Kind
+         * - VertexBuffer.UV4Kind
+         * - VertexBuffer.UV5Kind
+         * - VertexBuffer.UV6Kind
+         * - VertexBuffer.ColorKind
+         * - VertexBuffer.MatricesIndicesKind
+         * - VertexBuffer.MatricesIndicesExtraKind
+         * - VertexBuffer.MatricesWeightsKind
+         * - VertexBuffer.MatricesWeightsExtraKind
          *
          * Returns the Mesh.
          */

+ 102 - 102
src/Mesh/mesh.ts

@@ -591,18 +591,18 @@ import { PhysicsImpostor } from "Physics";
         /**
          * Returns the content of an associated vertex buffer
          * @param kind defines which buffer to read from (positions, indices, normals, etc). Possible `kind` values :
-         * - BABYLON.VertexBuffer.PositionKind
-         * - BABYLON.VertexBuffer.UVKind
-         * - BABYLON.VertexBuffer.UV2Kind
-         * - BABYLON.VertexBuffer.UV3Kind
-         * - BABYLON.VertexBuffer.UV4Kind
-         * - BABYLON.VertexBuffer.UV5Kind
-         * - BABYLON.VertexBuffer.UV6Kind
-         * - BABYLON.VertexBuffer.ColorKind
-         * - BABYLON.VertexBuffer.MatricesIndicesKind
-         * - BABYLON.VertexBuffer.MatricesIndicesExtraKind
-         * - BABYLON.VertexBuffer.MatricesWeightsKind
-         * - BABYLON.VertexBuffer.MatricesWeightsExtraKind
+         * - VertexBuffer.PositionKind
+         * - VertexBuffer.UVKind
+         * - VertexBuffer.UV2Kind
+         * - VertexBuffer.UV3Kind
+         * - VertexBuffer.UV4Kind
+         * - VertexBuffer.UV5Kind
+         * - VertexBuffer.UV6Kind
+         * - VertexBuffer.ColorKind
+         * - VertexBuffer.MatricesIndicesKind
+         * - VertexBuffer.MatricesIndicesExtraKind
+         * - VertexBuffer.MatricesWeightsKind
+         * - VertexBuffer.MatricesWeightsExtraKind
          * @param copyWhenShared defines a boolean indicating that if the mesh geometry is shared among some other meshes, the returned array is a copy of the internal one
          * @param forceCopy defines a boolean forcing the copy of the buffer no matter what the value of copyWhenShared is
          * @returns a FloatArray or null if the mesh has no geometry or no vertex buffer for this kind.
@@ -617,18 +617,18 @@ import { PhysicsImpostor } from "Physics";
         /**
          * Returns the mesh VertexBuffer object from the requested `kind`
          * @param kind defines which buffer to read from (positions, indices, normals, etc). Possible `kind` values :
-         * - BABYLON.VertexBuffer.PositionKind
-         * - BABYLON.VertexBuffer.UVKind
-         * - BABYLON.VertexBuffer.UV2Kind
-         * - BABYLON.VertexBuffer.UV3Kind
-         * - BABYLON.VertexBuffer.UV4Kind
-         * - BABYLON.VertexBuffer.UV5Kind
-         * - BABYLON.VertexBuffer.UV6Kind
-         * - BABYLON.VertexBuffer.ColorKind
-         * - BABYLON.VertexBuffer.MatricesIndicesKind
-         * - BABYLON.VertexBuffer.MatricesIndicesExtraKind
-         * - BABYLON.VertexBuffer.MatricesWeightsKind
-         * - BABYLON.VertexBuffer.MatricesWeightsExtraKind
+         * - VertexBuffer.PositionKind
+         * - VertexBuffer.UVKind
+         * - VertexBuffer.UV2Kind
+         * - VertexBuffer.UV3Kind
+         * - VertexBuffer.UV4Kind
+         * - VertexBuffer.UV5Kind
+         * - VertexBuffer.UV6Kind
+         * - VertexBuffer.ColorKind
+         * - VertexBuffer.MatricesIndicesKind
+         * - VertexBuffer.MatricesIndicesExtraKind
+         * - VertexBuffer.MatricesWeightsKind
+         * - VertexBuffer.MatricesWeightsExtraKind
          * @returns a FloatArray or null if the mesh has no vertex buffer for this kind.
          */
         public getVertexBuffer(kind: string): Nullable<VertexBuffer> {
@@ -641,18 +641,18 @@ import { PhysicsImpostor } from "Physics";
         /**
          * Tests if a specific vertex buffer is associated with this mesh
          * @param kind defines which buffer to check (positions, indices, normals, etc). Possible `kind` values :
-         * - BABYLON.VertexBuffer.PositionKind
-         * - BABYLON.VertexBuffer.UVKind
-         * - BABYLON.VertexBuffer.UV2Kind
-         * - BABYLON.VertexBuffer.UV3Kind
-         * - BABYLON.VertexBuffer.UV4Kind
-         * - BABYLON.VertexBuffer.UV5Kind
-         * - BABYLON.VertexBuffer.UV6Kind
-         * - BABYLON.VertexBuffer.ColorKind
-         * - BABYLON.VertexBuffer.MatricesIndicesKind
-         * - BABYLON.VertexBuffer.MatricesIndicesExtraKind
-         * - BABYLON.VertexBuffer.MatricesWeightsKind
-         * - BABYLON.VertexBuffer.MatricesWeightsExtraKind
+         * - VertexBuffer.PositionKind
+         * - VertexBuffer.UVKind
+         * - VertexBuffer.UV2Kind
+         * - VertexBuffer.UV3Kind
+         * - VertexBuffer.UV4Kind
+         * - VertexBuffer.UV5Kind
+         * - VertexBuffer.UV6Kind
+         * - VertexBuffer.ColorKind
+         * - VertexBuffer.MatricesIndicesKind
+         * - VertexBuffer.MatricesIndicesExtraKind
+         * - VertexBuffer.MatricesWeightsKind
+         * - VertexBuffer.MatricesWeightsExtraKind
          * @returns a boolean
          */
         public isVerticesDataPresent(kind: string): boolean {
@@ -668,18 +668,18 @@ import { PhysicsImpostor } from "Physics";
         /**
          * Returns a boolean defining if the vertex data for the requested `kind` is updatable.
          * @param kind defines which buffer to check (positions, indices, normals, etc). Possible `kind` values :
-         * - BABYLON.VertexBuffer.PositionKind
-         * - BABYLON.VertexBuffer.UVKind
-         * - BABYLON.VertexBuffer.UV2Kind
-         * - BABYLON.VertexBuffer.UV3Kind
-         * - BABYLON.VertexBuffer.UV4Kind
-         * - BABYLON.VertexBuffer.UV5Kind
-         * - BABYLON.VertexBuffer.UV6Kind
-         * - BABYLON.VertexBuffer.ColorKind
-         * - BABYLON.VertexBuffer.MatricesIndicesKind
-         * - BABYLON.VertexBuffer.MatricesIndicesExtraKind
-         * - BABYLON.VertexBuffer.MatricesWeightsKind
-         * - BABYLON.VertexBuffer.MatricesWeightsExtraKind
+         * - VertexBuffer.PositionKind
+         * - VertexBuffer.UVKind
+         * - VertexBuffer.UV2Kind
+         * - VertexBuffer.UV3Kind
+         * - VertexBuffer.UV4Kind
+         * - VertexBuffer.UV5Kind
+         * - VertexBuffer.UV6Kind
+         * - VertexBuffer.ColorKind
+         * - VertexBuffer.MatricesIndicesKind
+         * - VertexBuffer.MatricesIndicesExtraKind
+         * - VertexBuffer.MatricesWeightsKind
+         * - VertexBuffer.MatricesWeightsExtraKind
          * @returns a boolean
          */
         public isVertexBufferUpdatable(kind: string): boolean {
@@ -695,18 +695,18 @@ import { PhysicsImpostor } from "Physics";
         /**
          * Returns a string which contains the list of existing `kinds` of Vertex Data associated with this mesh.
          * @param kind defines which buffer to read from (positions, indices, normals, etc). Possible `kind` values :
-         * - BABYLON.VertexBuffer.PositionKind
-         * - BABYLON.VertexBuffer.UVKind
-         * - BABYLON.VertexBuffer.UV2Kind
-         * - BABYLON.VertexBuffer.UV3Kind
-         * - BABYLON.VertexBuffer.UV4Kind
-         * - BABYLON.VertexBuffer.UV5Kind
-         * - BABYLON.VertexBuffer.UV6Kind
-         * - BABYLON.VertexBuffer.ColorKind
-         * - BABYLON.VertexBuffer.MatricesIndicesKind
-         * - BABYLON.VertexBuffer.MatricesIndicesExtraKind
-         * - BABYLON.VertexBuffer.MatricesWeightsKind
-         * - BABYLON.VertexBuffer.MatricesWeightsExtraKind
+         * - VertexBuffer.PositionKind
+         * - VertexBuffer.UVKind
+         * - VertexBuffer.UV2Kind
+         * - VertexBuffer.UV3Kind
+         * - VertexBuffer.UV4Kind
+         * - VertexBuffer.UV5Kind
+         * - VertexBuffer.UV6Kind
+         * - VertexBuffer.ColorKind
+         * - VertexBuffer.MatricesIndicesKind
+         * - VertexBuffer.MatricesIndicesExtraKind
+         * - VertexBuffer.MatricesWeightsKind
+         * - VertexBuffer.MatricesWeightsExtraKind
          * @returns an array of strings
          */
         public getVerticesDataKinds(): string[] {
@@ -1064,18 +1064,18 @@ import { PhysicsImpostor } from "Physics";
         /**
          * Copy a FloatArray into a specific associated vertex buffer
          * @param kind defines which buffer to write to (positions, indices, normals, etc). Possible `kind` values :
-         * - BABYLON.VertexBuffer.PositionKind
-         * - BABYLON.VertexBuffer.UVKind
-         * - BABYLON.VertexBuffer.UV2Kind
-         * - BABYLON.VertexBuffer.UV3Kind
-         * - BABYLON.VertexBuffer.UV4Kind
-         * - BABYLON.VertexBuffer.UV5Kind
-         * - BABYLON.VertexBuffer.UV6Kind
-         * - BABYLON.VertexBuffer.ColorKind
-         * - BABYLON.VertexBuffer.MatricesIndicesKind
-         * - BABYLON.VertexBuffer.MatricesIndicesExtraKind
-         * - BABYLON.VertexBuffer.MatricesWeightsKind
-         * - BABYLON.VertexBuffer.MatricesWeightsExtraKind
+         * - VertexBuffer.PositionKind
+         * - VertexBuffer.UVKind
+         * - VertexBuffer.UV2Kind
+         * - VertexBuffer.UV3Kind
+         * - VertexBuffer.UV4Kind
+         * - VertexBuffer.UV5Kind
+         * - VertexBuffer.UV6Kind
+         * - VertexBuffer.ColorKind
+         * - VertexBuffer.MatricesIndicesKind
+         * - VertexBuffer.MatricesIndicesExtraKind
+         * - VertexBuffer.MatricesWeightsKind
+         * - VertexBuffer.MatricesWeightsExtraKind
          * @param data defines the data source
          * @param updatable defines if the updated vertex buffer must be flagged as updatable
          * @param stride defines the data stride size (can be null)
@@ -1099,18 +1099,18 @@ import { PhysicsImpostor } from "Physics";
         /**
          * Flags an associated vertex buffer as updatable
          * @param kind defines which buffer to use (positions, indices, normals, etc). Possible `kind` values :
-         * - BABYLON.VertexBuffer.PositionKind
-         * - BABYLON.VertexBuffer.UVKind
-         * - BABYLON.VertexBuffer.UV2Kind
-         * - BABYLON.VertexBuffer.UV3Kind
-         * - BABYLON.VertexBuffer.UV4Kind
-         * - BABYLON.VertexBuffer.UV5Kind
-         * - BABYLON.VertexBuffer.UV6Kind
-         * - BABYLON.VertexBuffer.ColorKind
-         * - BABYLON.VertexBuffer.MatricesIndicesKind
-         * - BABYLON.VertexBuffer.MatricesIndicesExtraKind
-         * - BABYLON.VertexBuffer.MatricesWeightsKind
-         * - BABYLON.VertexBuffer.MatricesWeightsExtraKind
+         * - VertexBuffer.PositionKind
+         * - VertexBuffer.UVKind
+         * - VertexBuffer.UV2Kind
+         * - VertexBuffer.UV3Kind
+         * - VertexBuffer.UV4Kind
+         * - VertexBuffer.UV5Kind
+         * - VertexBuffer.UV6Kind
+         * - VertexBuffer.ColorKind
+         * - VertexBuffer.MatricesIndicesKind
+         * - VertexBuffer.MatricesIndicesExtraKind
+         * - VertexBuffer.MatricesWeightsKind
+         * - VertexBuffer.MatricesWeightsExtraKind
          * @param updatable defines if the updated vertex buffer must be flagged as updatable
          */
         public markVerticesDataAsUpdatable(kind: string, updatable = true) {
@@ -1140,18 +1140,18 @@ import { PhysicsImpostor } from "Physics";
         /**
          * Update a specific associated vertex buffer
          * @param kind defines which buffer to write to (positions, indices, normals, etc). Possible `kind` values :
-         * - BABYLON.VertexBuffer.PositionKind
-         * - BABYLON.VertexBuffer.UVKind
-         * - BABYLON.VertexBuffer.UV2Kind
-         * - BABYLON.VertexBuffer.UV3Kind
-         * - BABYLON.VertexBuffer.UV4Kind
-         * - BABYLON.VertexBuffer.UV5Kind
-         * - BABYLON.VertexBuffer.UV6Kind
-         * - BABYLON.VertexBuffer.ColorKind
-         * - BABYLON.VertexBuffer.MatricesIndicesKind
-         * - BABYLON.VertexBuffer.MatricesIndicesExtraKind
-         * - BABYLON.VertexBuffer.MatricesWeightsKind
-         * - BABYLON.VertexBuffer.MatricesWeightsExtraKind
+         * - VertexBuffer.PositionKind
+         * - VertexBuffer.UVKind
+         * - VertexBuffer.UV2Kind
+         * - VertexBuffer.UV3Kind
+         * - VertexBuffer.UV4Kind
+         * - VertexBuffer.UV5Kind
+         * - VertexBuffer.UV6Kind
+         * - VertexBuffer.ColorKind
+         * - VertexBuffer.MatricesIndicesKind
+         * - VertexBuffer.MatricesIndicesExtraKind
+         * - VertexBuffer.MatricesWeightsKind
+         * - VertexBuffer.MatricesWeightsExtraKind
          * @param data defines the data source
          * @param updateExtends defines if extends info of the mesh must be updated (can be null). This is mostly useful for "position" kind
          * @param makeItUnique defines if the geometry associated with the mesh must be cloned to make the change only for this mesh (and not all meshes associated with the same geometry)
@@ -3193,7 +3193,7 @@ import { PhysicsImpostor } from "Physics";
          * Please consider using the same method from the MeshBuilder class instead.
          * The polygon's shape will depend on the input parameters and is constructed parallel to a ground mesh.
          * The parameter `shape` is a required array of successive Vector3 representing the corners of the polygon in th XoZ plane, that is y = 0 for all vectors.
-         * You can set the mesh side orientation with the values : BABYLON.Mesh.FRONTSIDE (default), BABYLON.Mesh.BACKSIDE or BABYLON.Mesh.DOUBLESIDE
+         * You can set the mesh side orientation with the values : Mesh.FRONTSIDE (default), Mesh.BACKSIDE or Mesh.DOUBLESIDE
          * The mesh can be set to updatable with the boolean parameter `updatable` (default false) if its internal geometry is supposed to change once created.
          * Remember you can only change the shape positions, not their number when updating a polygon.
          */
@@ -3252,7 +3252,7 @@ import { PhysicsImpostor } from "Physics";
          * @param path is a required array of successive Vector3. This is the axis curve the shape is extruded along
          * @param scale is the value to scale the shape
          * @param rotation is the angle value to rotate the shape each step (each path point), from the former step (so rotation added each step) along the curve
-         * @param cap sets the way the extruded shape is capped. Possible values : BABYLON.Mesh.NO_CAP (default), BABYLON.Mesh.CAP_START, BABYLON.Mesh.CAP_END, BABYLON.Mesh.CAP_ALL
+         * @param cap sets the way the extruded shape is capped. Possible values : Mesh.NO_CAP (default), Mesh.CAP_START, Mesh.CAP_END, Mesh.CAP_ALL
          * @param scene defines the hosting scene
          * @param updatable defines if the mesh must be flagged as updatable
          * @param sideOrientation defines the mesh side orientation (http://doc.babylonjs.com/babylon101/discover_basic_elements#side-orientation)
@@ -3287,7 +3287,7 @@ import { PhysicsImpostor } from "Physics";
          * @param rotationFunction is a custom Javascript function called on each path point
          * @param ribbonCloseArray forces the extrusion underlying ribbon to close all the paths in its `pathArray`
          * @param ribbonClosePath forces the extrusion underlying ribbon to close its `pathArray`
-         * @param cap sets the way the extruded shape is capped. Possible values : BABYLON.Mesh.NO_CAP (default), BABYLON.Mesh.CAP_START, BABYLON.Mesh.CAP_END, BABYLON.Mesh.CAP_ALL
+         * @param cap sets the way the extruded shape is capped. Possible values : Mesh.NO_CAP (default), Mesh.CAP_START, Mesh.CAP_END, Mesh.CAP_ALL
          * @param scene defines the hosting scene
          * @param updatable defines if the mesh must be flagged as updatable
          * @param sideOrientation defines the mesh side orientation (http://doc.babylonjs.com/babylon101/discover_basic_elements#side-orientation)
@@ -3450,7 +3450,7 @@ import { PhysicsImpostor } from "Physics";
          * @param radius sets the tube radius size
          * @param tessellation is the number of sides on the tubular surface
          * @param radiusFunction is a custom function. If it is not null, it overwrittes the parameter `radius`. This function is called on each point of the tube path and is passed the index `i` of the i-th point and the distance of this point from the first point of the path
-         * @param cap sets the way the extruded shape is capped. Possible values : BABYLON.Mesh.NO_CAP (default), BABYLON.Mesh.CAP_START, BABYLON.Mesh.CAP_END, BABYLON.Mesh.CAP_ALL
+         * @param cap sets the way the extruded shape is capped. Possible values : Mesh.NO_CAP (default), Mesh.CAP_START, Mesh.CAP_END, Mesh.CAP_ALL
          * @param scene defines the hosting scene
          * @param updatable defines if the mesh must be flagged as updatable
          * @param sideOrientation defines the mesh side orientation (http://doc.babylonjs.com/babylon101/discover_basic_elements#side-orientation)
@@ -3483,7 +3483,7 @@ import { PhysicsImpostor } from "Physics";
           * * You can set the color and the UV of each side of the polyhedron with the parameters `faceColors` (Color4, default `(1, 1, 1, 1)`) and faceUV (Vector4, default `(0, 0, 1, 1)`)
           * * To understand how to set `faceUV` or `faceColors`, please read this by considering the right number of faces of your polyhedron, instead of only 6 for the box : http://doc.babylonjs.com/tutorials/CreateBox_Per_Face_Textures_And_Colors
           * * The parameter `flat` (boolean, default true). If set to false, it gives the polyhedron a single global face, so less vertices and shared normals. In this case, `faceColors` and `faceUV` are ignored
-          * * You can also set the mesh side orientation with the values : BABYLON.Mesh.FRONTSIDE (default), BABYLON.Mesh.BACKSIDE or BABYLON.Mesh.DOUBLESIDE
+          * * You can also set the mesh side orientation with the values : Mesh.FRONTSIDE (default), Mesh.BACKSIDE or Mesh.DOUBLESIDE
           * * If you create a double-sided mesh, you can choose what parts of the texture image to crop and stick respectively on the front and the back sides with the parameters `frontUVs` and `backUVs` (Vector4). Detail here : http://doc.babylonjs.com/babylon101/discover_basic_elements#side-orientation
           * * The mesh can be set to updatable with the boolean parameter `updatable` (default false) if its internal geometry is supposed to change once created
           * @param name defines the name of the mesh to create
@@ -3501,7 +3501,7 @@ import { PhysicsImpostor } from "Physics";
          * * You can set some different icosphere dimensions, for instance to build an ellipsoid, by using the parameters `radiusX`, `radiusY` and `radiusZ` (all by default have the same value than `radius`)
          * * The parameter `subdivisions` sets the number of subdivisions (postive integer, default 4). The more subdivisions, the more faces on the icosphere whatever its size
          * * The parameter `flat` (boolean, default true) gives each side its own normals. Set it to false to get a smooth continuous light reflection on the surface
-         * * You can also set the mesh side orientation with the values : BABYLON.Mesh.FRONTSIDE (default), BABYLON.Mesh.BACKSIDE or BABYLON.Mesh.DOUBLESIDE
+         * * You can also set the mesh side orientation with the values : Mesh.FRONTSIDE (default), Mesh.BACKSIDE or Mesh.DOUBLESIDE
          * * If you create a double-sided mesh, you can choose what parts of the texture image to crop and stick respectively on the front and the back sides with the parameters `frontUVs` and `backUVs` (Vector4). Detail here : http://doc.babylonjs.com/babylon101/discover_basic_elements#side-orientation
          * * The mesh can be set to updatable with the boolean parameter `updatable` (default false) if its internal geometry is supposed to change once created
          * @param name defines the name of the mesh

+ 24 - 24
src/Mesh/mesh.vertexData.ts

@@ -37,18 +37,18 @@ import { Mesh, Geometry, VertexBuffer } from "Mesh";
         /**
          * Update a specific associated vertex buffer
          * @param kind defines which buffer to write to (positions, indices, normals, etc). Possible `kind` values :
-         * - BABYLON.VertexBuffer.PositionKind
-         * - BABYLON.VertexBuffer.UVKind
-         * - BABYLON.VertexBuffer.UV2Kind
-         * - BABYLON.VertexBuffer.UV3Kind
-         * - BABYLON.VertexBuffer.UV4Kind
-         * - BABYLON.VertexBuffer.UV5Kind
-         * - BABYLON.VertexBuffer.UV6Kind
-         * - BABYLON.VertexBuffer.ColorKind
-         * - BABYLON.VertexBuffer.MatricesIndicesKind
-         * - BABYLON.VertexBuffer.MatricesIndicesExtraKind
-         * - BABYLON.VertexBuffer.MatricesWeightsKind
-         * - BABYLON.VertexBuffer.MatricesWeightsExtraKind
+         * - VertexBuffer.PositionKind
+         * - VertexBuffer.UVKind
+         * - VertexBuffer.UV2Kind
+         * - VertexBuffer.UV3Kind
+         * - VertexBuffer.UV4Kind
+         * - VertexBuffer.UV5Kind
+         * - VertexBuffer.UV6Kind
+         * - VertexBuffer.ColorKind
+         * - VertexBuffer.MatricesIndicesKind
+         * - VertexBuffer.MatricesIndicesExtraKind
+         * - VertexBuffer.MatricesWeightsKind
+         * - VertexBuffer.MatricesWeightsExtraKind
          * @param data defines the data source
          * @param updateExtends defines if extends info of the mesh must be updated (can be null). This is mostly useful for "position" kind
          * @param makeItUnique defines if the geometry associated with the mesh must be cloned to make the change only for this mesh (and not all meshes associated with the same geometry)
@@ -740,7 +740,7 @@ import { Mesh, Geometry, VertexBuffer } from "Mesh";
           * * closeArray creates a seam between the first and the last paths of the pathArray, optional, default false
           * * closePath creates a seam between the first and the last points of each path of the path array, optional, default false
           * * offset a positive integer, only used when pathArray contains a single path (offset = 10 means the point 1 is joined to the point 11), default rounded half size of the pathArray length
-          * * sideOrientation optional and takes the values : BABYLON.Mesh.FRONTSIDE (default), BABYLON.Mesh.BACKSIDE or BABYLON.Mesh.DOUBLESIDE
+          * * sideOrientation optional and takes the values : Mesh.FRONTSIDE (default), Mesh.BACKSIDE or Mesh.DOUBLESIDE
           * * frontUvs only usable when you create a double-sided mesh, used to choose what parts of the texture image to crop and apply on the front side, optional, default vector4 (0, 0, 1, 1)
           * * backUVs only usable when you create a double-sided mesh, used to choose what parts of the texture image to crop and apply on the back side, optional, default vector4 (0, 0, 1, 1)
           * * invertUV swaps in the U and V coordinates when applying a texture, optional, default false
@@ -987,7 +987,7 @@ import { Mesh, Geometry, VertexBuffer } from "Mesh";
           * * depth sets the depth (z direction) of the box, overwrites the depth set by size, optional, default size
           * * faceUV an array of 6 Vector4 elements used to set different images to each box side
           * * faceColors an array of 6 Color3 elements used to set different colors to each box side
-          * * sideOrientation optional and takes the values : BABYLON.Mesh.FRONTSIDE (default), BABYLON.Mesh.BACKSIDE or BABYLON.Mesh.DOUBLESIDE
+          * * sideOrientation optional and takes the values : Mesh.FRONTSIDE (default), Mesh.BACKSIDE or Mesh.DOUBLESIDE
           * * frontUvs only usable when you create a double-sided mesh, used to choose what parts of the texture image to crop and apply on the front side, optional, default vector4 (0, 0, 1, 1)
           * * backUVs only usable when you create a double-sided mesh, used to choose what parts of the texture image to crop and apply on the back side, optional, default vector4 (0, 0, 1, 1)
          * @returns the VertexData of the box
@@ -1108,7 +1108,7 @@ import { Mesh, Geometry, VertexBuffer } from "Mesh";
           * * diameterZ sets the diameterZ (z direction) of the ellipsoid, overwrites the diameterZ set by diameter, optional, default diameter
           * * arc a number from 0 to 1, to create an unclosed ellipsoid based on the fraction of the circumference (latitude) given by the arc value, optional, default 1
           * * slice a number from 0 to 1, to create an unclosed ellipsoid based on the fraction of the height (latitude) given by the arc value, optional, default 1
-          * * sideOrientation optional and takes the values : BABYLON.Mesh.FRONTSIDE (default), BABYLON.Mesh.BACKSIDE or BABYLON.Mesh.DOUBLESIDE
+          * * sideOrientation optional and takes the values : Mesh.FRONTSIDE (default), Mesh.BACKSIDE or Mesh.DOUBLESIDE
           * * frontUvs only usable when you create a double-sided mesh, used to choose what parts of the texture image to crop and apply on the front side, optional, default vector4 (0, 0, 1, 1)
           * * backUVs only usable when you create a double-sided mesh, used to choose what parts of the texture image to crop and apply on the back side, optional, default vector4 (0, 0, 1, 1)
          * @returns the VertexData of the ellipsoid
@@ -1196,7 +1196,7 @@ import { Mesh, Geometry, VertexBuffer } from "Mesh";
           * * faceUV an array of Vector4 elements used to set different images to the top, rings and bottom respectively
           * * hasRings when true makes each subdivision independantly treated as a face for faceUV and faceColors, optional, default false
           * * enclose when true closes an open cylinder by adding extra flat faces between the height axis and vertical edges, think cut cake
-          * * sideOrientation optional and takes the values : BABYLON.Mesh.FRONTSIDE (default), BABYLON.Mesh.BACKSIDE or BABYLON.Mesh.DOUBLESIDE
+          * * sideOrientation optional and takes the values : Mesh.FRONTSIDE (default), Mesh.BACKSIDE or Mesh.DOUBLESIDE
           * * frontUvs only usable when you create a double-sided mesh, used to choose what parts of the texture image to crop and apply on the front side, optional, default vector4 (0, 0, 1, 1)
           * * backUVs only usable when you create a double-sided mesh, used to choose what parts of the texture image to crop and apply on the back side, optional, default vector4 (0, 0, 1, 1)
          * @returns the VertexData of the cylinder, cone or prism
@@ -1458,7 +1458,7 @@ import { Mesh, Geometry, VertexBuffer } from "Mesh";
           * * diameter the diameter of the torus, optional default 1
           * * thickness the diameter of the tube forming the torus, optional default 0.5
           * * tessellation the number of prism sides, 3 for a triangular prism, optional, default 24
-          * * sideOrientation optional and takes the values : BABYLON.Mesh.FRONTSIDE (default), BABYLON.Mesh.BACKSIDE or BABYLON.Mesh.DOUBLESIDE
+          * * sideOrientation optional and takes the values : Mesh.FRONTSIDE (default), Mesh.BACKSIDE or Mesh.DOUBLESIDE
           * * frontUvs only usable when you create a double-sided mesh, used to choose what parts of the texture image to crop and apply on the front side, optional, default vector4 (0, 0, 1, 1)
           * * backUVs only usable when you create a double-sided mesh, used to choose what parts of the texture image to crop and apply on the back side, optional, default vector4 (0, 0, 1, 1)
          * @returns the VertexData of the torus
@@ -1818,7 +1818,7 @@ import { Mesh, Geometry, VertexBuffer } from "Mesh";
                         position.y = options.minHeight + (options.maxHeight - options.minHeight) * gradient;
                     }
                     else {
-                        position.y = options.minHeight - BABYLON.Epsilon; // We can't have a height below minHeight, normally.
+                        position.y = options.minHeight - Epsilon; // We can't have a height below minHeight, normally.
                     }
 
                     // Add  vertex
@@ -1878,7 +1878,7 @@ import { Mesh, Geometry, VertexBuffer } from "Mesh";
           * * size sets the width and height of the plane to the value of size, optional default 1
           * * width sets the width (x direction) of the plane, overwrites the width set by size, optional, default size
           * * height sets the height (y direction) of the plane, overwrites the height set by size, optional, default size
-          * * sideOrientation optional and takes the values : BABYLON.Mesh.FRONTSIDE (default), BABYLON.Mesh.BACKSIDE or BABYLON.Mesh.DOUBLESIDE
+          * * sideOrientation optional and takes the values : Mesh.FRONTSIDE (default), Mesh.BACKSIDE or Mesh.DOUBLESIDE
           * * frontUvs only usable when you create a double-sided mesh, used to choose what parts of the texture image to crop and apply on the front side, optional, default vector4 (0, 0, 1, 1)
           * * backUVs only usable when you create a double-sided mesh, used to choose what parts of the texture image to crop and apply on the back side, optional, default vector4 (0, 0, 1, 1)
          * @returns the VertexData of the box
@@ -1942,7 +1942,7 @@ import { Mesh, Geometry, VertexBuffer } from "Mesh";
           * * radius the radius of the disc, optional default 0.5
           * * tessellation the number of polygon sides, optional, default 64
           * * arc a number from 0 to 1, to create an unclosed polygon based on the fraction of the circumference given by the arc value, optional, default 1
-          * * sideOrientation optional and takes the values : BABYLON.Mesh.FRONTSIDE (default), BABYLON.Mesh.BACKSIDE or BABYLON.Mesh.DOUBLESIDE
+          * * sideOrientation optional and takes the values : Mesh.FRONTSIDE (default), Mesh.BACKSIDE or Mesh.DOUBLESIDE
           * * frontUvs only usable when you create a double-sided mesh, used to choose what parts of the texture image to crop and apply on the front side, optional, default vector4 (0, 0, 1, 1)
           * * backUVs only usable when you create a double-sided mesh, used to choose what parts of the texture image to crop and apply on the back side, optional, default vector4 (0, 0, 1, 1)
          * @returns the VertexData of the box
@@ -2001,7 +2001,7 @@ import { Mesh, Geometry, VertexBuffer } from "Mesh";
          * Creates the VertexData for an irregular Polygon in the XoZ plane using a mesh built by polygonTriangulation.build()
          * All parameters are provided by MeshBuilder.CreatePolygon as needed
          * @param polygon a mesh built from polygonTriangulation.build()
-         * @param sideOrientation takes the values BABYLON.Mesh.FRONTSIDE (default), BABYLON.Mesh.BACKSIDE or BABYLON.Mesh.DOUBLESIDE
+         * @param sideOrientation takes the values Mesh.FRONTSIDE (default), Mesh.BACKSIDE or Mesh.DOUBLESIDE
          * @param fUV an array of Vector4 elements used to set different images to the top, rings and bottom respectively
          * @param fColors an array of Color3 elements used to set different colors to the top, rings and bottom respectively
          * @param frontUVs only usable when you create a double-sided mesh, used to choose what parts of the texture image to crop and apply on the front side, optional, default vector4 (0, 0, 1, 1)
@@ -2080,7 +2080,7 @@ import { Mesh, Geometry, VertexBuffer } from "Mesh";
           * * radiusZ allows stretching in the z direction, optional, default radius
           * * flat when true creates a flat shaded mesh, optional, default true
           * * subdivisions increasing the subdivisions increases the number of faces, optional, default 4
-          * * sideOrientation optional and takes the values : BABYLON.Mesh.FRONTSIDE (default), BABYLON.Mesh.BACKSIDE or BABYLON.Mesh.DOUBLESIDE
+          * * sideOrientation optional and takes the values : Mesh.FRONTSIDE (default), Mesh.BACKSIDE or Mesh.DOUBLESIDE
           * * frontUvs only usable when you create a double-sided mesh, used to choose what parts of the texture image to crop and apply on the front side, optional, default vector4 (0, 0, 1, 1)
           * * backUVs only usable when you create a double-sided mesh, used to choose what parts of the texture image to crop and apply on the back side, optional, default vector4 (0, 0, 1, 1)
          * @returns the VertexData of the IcoSphere
@@ -2358,7 +2358,7 @@ import { Mesh, Geometry, VertexBuffer } from "Mesh";
          * * faceColors an array of Color3 elements used to set different colors to the top, rings and bottom respectively
          * * flat when true creates a flat shaded mesh, optional, default true
          * * subdivisions increasing the subdivisions increases the number of faces, optional, default 4
-         * * sideOrientation optional and takes the values : BABYLON.Mesh.FRONTSIDE (default), BABYLON.Mesh.BACKSIDE or BABYLON.Mesh.DOUBLESIDE
+         * * sideOrientation optional and takes the values : Mesh.FRONTSIDE (default), Mesh.BACKSIDE or Mesh.DOUBLESIDE
          * * frontUvs only usable when you create a double-sided mesh, used to choose what parts of the texture image to crop and apply on the front side, optional, default vector4 (0, 0, 1, 1)
          * * backUVs only usable when you create a double-sided mesh, used to choose what parts of the texture image to crop and apply on the back side, optional, default vector4 (0, 0, 1, 1)
          * @returns the VertexData of the Polyhedron
@@ -2503,7 +2503,7 @@ import { Mesh, Geometry, VertexBuffer } from "Mesh";
           * * tubularSegments the number of tubes to decompose the knot into, optional, default 32
           * * p the number of windings around the z axis, optional,  default 2
           * * q the number of windings around the x axis, optional,  default 3
-          * * sideOrientation optional and takes the values : BABYLON.Mesh.FRONTSIDE (default), BABYLON.Mesh.BACKSIDE or BABYLON.Mesh.DOUBLESIDE
+          * * sideOrientation optional and takes the values : Mesh.FRONTSIDE (default), Mesh.BACKSIDE or Mesh.DOUBLESIDE
           * * frontUvs only usable when you create a double-sided mesh, used to choose what parts of the texture image to crop and apply on the front side, optional, default vector4 (0, 0, 1, 1)
           * * backUVs only usable when you create a double-sided mesh, used to choose what parts of the texture image to crop and apply on the back side, optional, default vector4 (0, 0, 1, 1)
          * @returns the VertexData of the Torus Knot

+ 19 - 19
src/Mesh/meshBuilder.ts

@@ -28,7 +28,7 @@ import { BoundingInfo } from "Culling";
          * * You can set some different box dimensions by using the parameters `width`, `height` and `depth` (all by default have the same value of `size`)
          * * You can set different colors and different images to each box side by using the parameters `faceColors` (an array of 6 Color3 elements) and `faceUV` (an array of 6 Vector4 elements)
          * * Please read this tutorial : http://doc.babylonjs.com/tutorials/CreateBox_Per_Face_Textures_And_Colors
-         * * You can also set the mesh side orientation with the values : BABYLON.Mesh.FRONTSIDE (default), BABYLON.Mesh.BACKSIDE or BABYLON.Mesh.DOUBLESIDE
+         * * You can also set the mesh side orientation with the values : Mesh.FRONTSIDE (default), Mesh.BACKSIDE or Mesh.DOUBLESIDE
          * * If you create a double-sided mesh, you can choose what parts of the texture image to crop and stick respectively on the front and the back sides with the parameters `frontUVs` and `backUVs` (Vector4). Detail here : http://doc.babylonjs.com/babylon101/discover_basic_elements#side-orientation
          * * The mesh can be set to updatable with the boolean parameter `updatable` (default false) if its internal geometry is supposed to change once created
          * @see http://doc.babylonjs.com/tutorials/Mesh_CreateXXX_Methods_With_Options_Parameter#box
@@ -57,7 +57,7 @@ import { BoundingInfo } from "Culling";
          * * The parameter `segments` sets the sphere number of horizontal stripes (positive integer, default 32)
          * * You can create an unclosed sphere with the parameter `arc` (positive float, default 1), valued between 0 and 1, what is the ratio of the circumference (latitude) : 2 x PI x ratio
          * * You can create an unclosed sphere on its height with the parameter `slice` (positive float, default1), valued between 0 and 1, what is the height ratio (longitude)
-         * * You can also set the mesh side orientation with the values : BABYLON.Mesh.FRONTSIDE (default), BABYLON.Mesh.BACKSIDE or BABYLON.Mesh.DOUBLESIDE
+         * * You can also set the mesh side orientation with the values : Mesh.FRONTSIDE (default), Mesh.BACKSIDE or Mesh.DOUBLESIDE
          * * If you create a double-sided mesh, you can choose what parts of the texture image to crop and stick respectively on the front and the back sides with the parameters `frontUVs` and `backUVs` (Vector4). Detail here : http://doc.babylonjs.com/babylon101/discover_basic_elements#side-orientation
          * * The mesh can be set to updatable with the boolean parameter `updatable` (default false) if its internal geometry is supposed to change once created
          * @param name defines the name of the mesh
@@ -84,7 +84,7 @@ import { BoundingInfo } from "Culling";
          * * The parameter `radius` sets the radius size (float) of the polygon (default 0.5)
          * * The parameter `tessellation` sets the number of polygon sides (positive integer, default 64). So a tessellation valued to 3 will build a triangle, to 4 a square, etc
          * * You can create an unclosed polygon with the parameter `arc` (positive float, default 1), valued between 0 and 1, what is the ratio of the circumference : 2 x PI x ratio
-         * * You can also set the mesh side orientation with the values : BABYLON.Mesh.FRONTSIDE (default), BABYLON.Mesh.BACKSIDE or BABYLON.Mesh.DOUBLESIDE
+         * * You can also set the mesh side orientation with the values : Mesh.FRONTSIDE (default), Mesh.BACKSIDE or Mesh.DOUBLESIDE
          * * If you create a double-sided mesh, you can choose what parts of the texture image to crop and stick respectively on the front and the back sides with the parameters `frontUVs` and `backUVs` (Vector4). Detail here : http://doc.babylonjs.com/babylon101/discover_basic_elements#side-orientation
          * * The mesh can be set to updatable with the boolean parameter `updatable` (default false) if its internal geometry is supposed to change once created
          * @param name defines the name of the mesh
@@ -112,7 +112,7 @@ import { BoundingInfo } from "Culling";
          * * You can set some different icosphere dimensions, for instance to build an ellipsoid, by using the parameters `radiusX`, `radiusY` and `radiusZ` (all by default have the same value of `radius`)
          * * The parameter `subdivisions` sets the number of subdivisions (postive integer, default 4). The more subdivisions, the more faces on the icosphere whatever its size
          * * The parameter `flat` (boolean, default true) gives each side its own normals. Set it to false to get a smooth continuous light reflection on the surface
-         * * You can also set the mesh side orientation with the values : BABYLON.Mesh.FRONTSIDE (default), BABYLON.Mesh.BACKSIDE or BABYLON.Mesh.DOUBLESIDE
+         * * You can also set the mesh side orientation with the values : Mesh.FRONTSIDE (default), Mesh.BACKSIDE or Mesh.DOUBLESIDE
          * * If you create a double-sided mesh, you can choose what parts of the texture image to crop and stick respectively on the front and the back sides with the parameters `frontUVs` and `backUVs` (Vector4). Detail here : http://doc.babylonjs.com/babylon101/discover_basic_elements#side-orientation
          * * The mesh can be set to updatable with the boolean parameter `updatable` (default false) if its internal geometry is supposed to change once created
          * @param name defines the name of the mesh
@@ -142,7 +142,7 @@ import { BoundingInfo } from "Culling";
          * * The parameter `offset` (positive integer, default : rounded half size of the pathArray length), is taken in account only if the `pathArray` is containing a single path
          * * It's the offset to join the points from the same path. Ex : offset = 10 means the point 1 is joined to the point 11
          * * The optional parameter `instance` is an instance of an existing Ribbon object to be updated with the passed `pathArray` parameter : http://doc.babylonjs.com/tutorials/How_to_dynamically_morph_a_mesh#ribbon
-         * * You can also set the mesh side orientation with the values : BABYLON.Mesh.FRONTSIDE (default), BABYLON.Mesh.BACKSIDE or BABYLON.Mesh.DOUBLESIDE
+         * * You can also set the mesh side orientation with the values : Mesh.FRONTSIDE (default), Mesh.BACKSIDE or Mesh.DOUBLESIDE
          * * If you create a double-sided mesh, you can choose what parts of the texture image to crop and stick respectively on the front and the back sides with the parameters `frontUVs` and `backUVs` (Vector4). Detail here : http://doc.babylonjs.com/babylon101/discover_basic_elements#side-orientation
          * * The optional parameter `invertUV` (boolean, default false) swaps in the geometry the U and V coordinates to apply a texture
          * * The parameter `uvs` is an optional flat array of `Vector2` to update/set each ribbon vertex with its own custom UV values instead of the computed ones
@@ -296,7 +296,7 @@ import { BoundingInfo } from "Culling";
          * * If `enclose` is false, a ring surface is one element.
          * * If `enclose` is true, a ring surface is 3 successive elements in the array : the tubular surface, then the two closing faces.
          * * Example how to set colors and textures on a sliced cylinder : http://www.html5gamedevs.com/topic/17945-creating-a-closed-slice-of-a-cylinder/#comment-106379
-         * * You can also set the mesh side orientation with the values : BABYLON.Mesh.FRONTSIDE (default), BABYLON.Mesh.BACKSIDE or BABYLON.Mesh.DOUBLESIDE
+         * * You can also set the mesh side orientation with the values : Mesh.FRONTSIDE (default), Mesh.BACKSIDE or Mesh.DOUBLESIDE
          * * If you create a double-sided mesh, you can choose what parts of the texture image to crop and stick respectively on the front and the back sides with the parameters `frontUVs` and `backUVs` (Vector4). Detail here : http://doc.babylonjs.com/babylon101/discover_basic_elements#side-orientation
          * * The mesh can be set to updatable with the boolean parameter `updatable` (default false) if its internal geometry is supposed to change once created.
          * @param name defines the name of the mesh
@@ -323,7 +323,7 @@ import { BoundingInfo } from "Culling";
          * * The parameter `diameter` sets the diameter size (float) of the torus (default 1)
          * * The parameter `thickness` sets the diameter size of the tube of the torus (float, default 0.5)
          * * The parameter `tessellation` sets the number of torus sides (postive integer, default 16)
-         * * You can also set the mesh side orientation with the values : BABYLON.Mesh.FRONTSIDE (default), BABYLON.Mesh.BACKSIDE or BABYLON.Mesh.DOUBLESIDE
+         * * You can also set the mesh side orientation with the values : Mesh.FRONTSIDE (default), Mesh.BACKSIDE or Mesh.DOUBLESIDE
          * * If you create a double-sided mesh, you can choose what parts of the texture image to crop and stick respectively on the front and the back sides with the parameters `frontUVs` and `backUVs` (Vector4). Detail here : http://doc.babylonjs.com/babylon101/discover_basic_elements#side-orientation
          * * The mesh can be set to updatable with the boolean parameter `updatable` (default false) if its internal geometry is supposed to change once created.
          * @param name defines the name of the mesh
@@ -351,7 +351,7 @@ import { BoundingInfo } from "Culling";
          * * The parameter `radialSegments` sets the number of sides on each tube segments (positive integer, default 32)
          * * The parameter `tubularSegments` sets the number of tubes to decompose the knot into (positive integer, default 32)
          * * The parameters `p` and `q` are the number of windings on each axis (positive integers, default 2 and 3)
-         * * You can also set the mesh side orientation with the values : BABYLON.Mesh.FRONTSIDE (default), BABYLON.Mesh.BACKSIDE or BABYLON.Mesh.DOUBLESIDE
+         * * You can also set the mesh side orientation with the values : Mesh.FRONTSIDE (default), Mesh.BACKSIDE or Mesh.DOUBLESIDE
          * * If you create a double-sided mesh, you can choose what parts of the texture image to crop and stick respectively on the front and the back sides with the parameters `frontUVs` and `backUVs` (Vector4). Detail here : http://doc.babylonjs.com/babylon101/discover_basic_elements#side-orientation
          * * The mesh can be set to updatable with the boolean parameter `updatable` (default false) if its internal geometry is supposed to change once created.
          * @param name defines the name of the mesh
@@ -545,10 +545,10 @@ import { BoundingInfo } from "Culling";
          * * The parameter `path` is a required array of successive Vector3. This is the axis curve the shape is extruded along.
          * * The parameter `rotation` (float, default 0 radians) is the angle value to rotate the shape each step (each path point), from the former step (so rotation added each step) along the curve.
          * * The parameter `scale` (float, default 1) is the value to scale the shape.
-         * * The parameter `cap` sets the way the extruded shape is capped. Possible values : BABYLON.Mesh.NO_CAP (default), BABYLON.Mesh.CAP_START, BABYLON.Mesh.CAP_END, BABYLON.Mesh.CAP_ALL
+         * * The parameter `cap` sets the way the extruded shape is capped. Possible values : Mesh.NO_CAP (default), Mesh.CAP_START, Mesh.CAP_END, Mesh.CAP_ALL
          * * The optional parameter `instance` is an instance of an existing ExtrudedShape object to be updated with the passed `shape`, `path`, `scale` or `rotation` parameters : http://doc.babylonjs.com/tutorials/How_to_dynamically_morph_a_mesh#extruded-shape
          * * Remember you can only change the shape or path point positions, not their number when updating an extruded shape.
-         * * You can also set the mesh side orientation with the values : BABYLON.Mesh.FRONTSIDE (default), BABYLON.Mesh.BACKSIDE or BABYLON.Mesh.DOUBLESIDE
+         * * You can also set the mesh side orientation with the values : Mesh.FRONTSIDE (default), Mesh.BACKSIDE or Mesh.DOUBLESIDE
          * * If you create a double-sided mesh, you can choose what parts of the texture image to crop and stick respectively on the front and the back sides with the parameters `frontUVs` and `backUVs` (Vector4). Detail here : http://doc.babylonjs.com/babylon101/discover_basic_elements#side-orientation
          * * The optional parameter `invertUV` (boolean, default false) swaps in the geometry the U and V coordinates to apply a texture.
          * * The mesh can be set to updatable with the boolean parameter `updatable` (default false) if its internal geometry is supposed to change once created.
@@ -585,10 +585,10 @@ import { BoundingInfo } from "Culling";
          * * It must returns a float value that will be the scale value applied to the shape on each path point
          * * The parameter `ribbonClosePath` (boolean, default false) forces the extrusion underlying ribbon to close all the paths in its `pathArray`
          * * The parameter `ribbonCloseArray` (boolean, default false) forces the extrusion underlying ribbon to close its `pathArray`
-         * * The parameter `cap` sets the way the extruded shape is capped. Possible values : BABYLON.Mesh.NO_CAP (default), BABYLON.Mesh.CAP_START, BABYLON.Mesh.CAP_END, BABYLON.Mesh.CAP_ALL
+         * * The parameter `cap` sets the way the extruded shape is capped. Possible values : Mesh.NO_CAP (default), Mesh.CAP_START, Mesh.CAP_END, Mesh.CAP_ALL
          * * The optional parameter `instance` is an instance of an existing ExtrudedShape object to be updated with the passed `shape`, `path`, `scale` or `rotation` parameters : http://doc.babylonjs.com/tutorials/How_to_dynamically_morph_a_mesh#extruded-shape
          * * Remember you can only change the shape or path point positions, not their number when updating an extruded shape
-         * * You can also set the mesh side orientation with the values : BABYLON.Mesh.FRONTSIDE (default), BABYLON.Mesh.BACKSIDE or BABYLON.Mesh.DOUBLESIDE
+         * * You can also set the mesh side orientation with the values : Mesh.FRONTSIDE (default), Mesh.BACKSIDE or Mesh.DOUBLESIDE
          * * If you create a double-sided mesh, you can choose what parts of the texture image to crop and stick respectively on the front and the back sides with the parameters `frontUVs` and `backUVs` (Vector4). Detail here : http://doc.babylonjs.com/babylon101/discover_basic_elements#side-orientation
          * * The optional parameter `invertUV` (boolean, default false) swaps in the geometry the U and V coordinates to apply a texture
          * * The mesh can be set to updatable with the boolean parameter `updatable` (default false) if its internal geometry is supposed to change once created
@@ -624,8 +624,8 @@ import { BoundingInfo } from "Culling";
 	 * * The parameter `clip` (positive integer, default 0) is the number of sides to not create without effecting the general shape of the sides
          * * The parameter `arc` (positive float, default 1) is the ratio of the lathe. 0.5 builds for instance half a lathe, so an opened shape
          * * The parameter `closed` (boolean, default true) opens/closes the lathe circumference. This should be set to false when used with the parameter "arc"
-         * * The parameter `cap` sets the way the extruded shape is capped. Possible values : BABYLON.Mesh.NO_CAP (default), BABYLON.Mesh.CAP_START, BABYLON.Mesh.CAP_END, BABYLON.Mesh.CAP_ALL
-         * * You can also set the mesh side orientation with the values : BABYLON.Mesh.FRONTSIDE (default), BABYLON.Mesh.BACKSIDE or BABYLON.Mesh.DOUBLESIDE
+         * * The parameter `cap` sets the way the extruded shape is capped. Possible values : Mesh.NO_CAP (default), Mesh.CAP_START, Mesh.CAP_END, Mesh.CAP_ALL
+         * * You can also set the mesh side orientation with the values : Mesh.FRONTSIDE (default), Mesh.BACKSIDE or Mesh.DOUBLESIDE
          * * If you create a double-sided mesh, you can choose what parts of the texture image to crop and stick respectively on the front and the back sides with the parameters `frontUVs` and `backUVs` (Vector4). Detail here : http://doc.babylonjs.com/babylon101/discover_basic_elements#side-orientation
          * * The optional parameter `invertUV` (boolean, default false) swaps in the geometry the U and V coordinates to apply a texture
          * * The mesh can be set to updatable with the boolean parameter `updatable` (default false) if its internal geometry is supposed to change once created
@@ -681,7 +681,7 @@ import { BoundingInfo } from "Culling";
          * * The parameter `size` sets the size (float) of both sides of the plane at once (default 1)
          * * You can set some different plane dimensions by using the parameters `width` and `height` (both by default have the same value of `size`)
          * * The parameter `sourcePlane` is a Plane instance. It builds a mesh plane from a Math plane
-         * * You can also set the mesh side orientation with the values : BABYLON.Mesh.FRONTSIDE (default), BABYLON.Mesh.BACKSIDE or BABYLON.Mesh.DOUBLESIDE
+         * * You can also set the mesh side orientation with the values : Mesh.FRONTSIDE (default), Mesh.BACKSIDE or Mesh.DOUBLESIDE
          * * If you create a double-sided mesh, you can choose what parts of the texture image to crop and stick respectively on the front and the back sides with the parameters `frontUVs` and `backUVs` (Vector4). Detail here : http://doc.babylonjs.com/babylon101/discover_basic_elements#side-orientation
          * * The mesh can be set to updatable with the boolean parameter `updatable` (default false) if its internal geometry is supposed to change once created
          * @param name defines the name of the mesh
@@ -861,7 +861,7 @@ import { BoundingInfo } from "Culling";
          * Creates a polygon mesh
          * The polygon's shape will depend on the input parameters and is constructed parallel to a ground mesh
          * * The parameter `shape` is a required array of successive Vector3 representing the corners of the polygon in th XoZ plane, that is y = 0 for all vectors
-         * * You can set the mesh side orientation with the values : BABYLON.Mesh.FRONTSIDE (default), BABYLON.Mesh.BACKSIDE or BABYLON.Mesh.DOUBLESIDE
+         * * You can set the mesh side orientation with the values : Mesh.FRONTSIDE (default), Mesh.BACKSIDE or Mesh.DOUBLESIDE
          * * The mesh can be set to updatable with the boolean parameter `updatable` (default false) if its internal geometry is supposed to change once created
          * * If you create a double-sided mesh, you can choose what parts of the texture image to crop and stick respectively on the front and the back sides with the parameters `frontUVs` and `backUVs` (Vector4)
          * * Remember you can only change the shape positions, not their number when updating a polygon
@@ -924,9 +924,9 @@ import { BoundingInfo } from "Culling";
          * * The parameter `radiusFunction` (javascript function, default null) is a vanilla javascript function. If it is not null, it overwrittes the parameter `radius`
          * * This function is called on each point of the tube path and is passed the index `i` of the i-th point and the distance of this point from the first point of the path. It must return a radius value (positive float)
          * * The parameter `arc` (positive float, maximum 1, default 1) is the ratio to apply to the tube circumference : 2 x PI x arc
-         * * The parameter `cap` sets the way the extruded shape is capped. Possible values : BABYLON.Mesh.NO_CAP (default), BABYLON.Mesh.CAP_START, BABYLON.Mesh.CAP_END, BABYLON.Mesh.CAP_ALL
+         * * The parameter `cap` sets the way the extruded shape is capped. Possible values : Mesh.NO_CAP (default), Mesh.CAP_START, Mesh.CAP_END, Mesh.CAP_ALL
          * * The optional parameter `instance` is an instance of an existing Tube object to be updated with the passed `pathArray` parameter : http://doc.babylonjs.com/tutorials/How_to_dynamically_morph_a_mesh#tube
-         * * You can also set the mesh side orientation with the values : BABYLON.Mesh.FRONTSIDE (default), BABYLON.Mesh.BACKSIDE or BABYLON.Mesh.DOUBLESIDE
+         * * You can also set the mesh side orientation with the values : Mesh.FRONTSIDE (default), Mesh.BACKSIDE or Mesh.DOUBLESIDE
          * * If you create a double-sided mesh, you can choose what parts of the texture image to crop and stick respectively on the front and the back sides with the parameters `frontUVs` and `backUVs` (Vector4). Detail here : http://doc.babylonjs.com/babylon101/discover_basic_elements#side-orientation
          * * The optional parameter `invertUV` (boolean, default false) swaps in the geometry the U and V coordinates to apply a texture
          * * The mesh can be set to updatable with the boolean parameter `updatable` (default false) if its internal geometry is supposed to change once created
@@ -1061,7 +1061,7 @@ import { BoundingInfo } from "Culling";
          * * You can set the color and the UV of each side of the polyhedron with the parameters `faceColors` (Color4, default `(1, 1, 1, 1)`) and faceUV (Vector4, default `(0, 0, 1, 1)`)
          * * To understand how to set `faceUV` or `faceColors`, please read this by considering the right number of faces of your polyhedron, instead of only 6 for the box : http://doc.babylonjs.com/tutorials/CreateBox_Per_Face_Textures_And_Colors
          * * The parameter `flat` (boolean, default true). If set to false, it gives the polyhedron a single global face, so less vertices and shared normals. In this case, `faceColors` and `faceUV` are ignored
-         * * You can also set the mesh side orientation with the values : BABYLON.Mesh.FRONTSIDE (default), BABYLON.Mesh.BACKSIDE or BABYLON.Mesh.DOUBLESIDE
+         * * You can also set the mesh side orientation with the values : Mesh.FRONTSIDE (default), Mesh.BACKSIDE or Mesh.DOUBLESIDE
          * * If you create a double-sided mesh, you can choose what parts of the texture image to crop and stick respectively on the front and the back sides with the parameters `frontUVs` and `backUVs` (Vector4). Detail here : http://doc.babylonjs.com/babylon101/discover_basic_elements#side-orientation
          * * The mesh can be set to updatable with the boolean parameter `updatable` (default false) if its internal geometry is supposed to change once created
          * @param name defines the name of the mesh

+ 3 - 3
src/Mesh/transformNode.ts

@@ -3,7 +3,7 @@ import { Nullable } from "types";
 import { Camera } from "Cameras";
 import { Scene } from "scene";
 import { Quaternion, Matrix, Vector3, Tmp, Space } from "Math";
-import {Node} from "Node";
+import { Node } from "Node";
 import { Bone } from "Bones";
     /**
      * A TransformNode is an object that is not rendered but can be used as a center of transformation. This can decrease memory usage and increase rendering speed compared to using an empty mesh as a parent and is less complicated than using a pivot matrix.
@@ -668,7 +668,7 @@ import { Bone } from "Bones";
         private static _rotationAxisCache = new Quaternion();
         /**
          * Rotates the mesh around the axis vector for the passed angle (amount) expressed in radians, in the given space.
-         * space (default LOCAL) can be either BABYLON.Space.LOCAL, either BABYLON.Space.WORLD.
+         * space (default LOCAL) can be either Space.LOCAL, either Space.WORLD.
          * Note that the property `rotationQuaternion` is then automatically updated and the property `rotation` is set to (0,0,0) and no longer used.
          * The passed axis is also normalized.
          * @param axis the axis to rotate around
@@ -745,7 +745,7 @@ import { Bone } from "Bones";
 
         /**
          * Translates the mesh along the axis vector for the passed distance in the given space.
-         * space (default LOCAL) can be either BABYLON.Space.LOCAL, either BABYLON.Space.WORLD.
+         * space (default LOCAL) can be either Space.LOCAL, either Space.WORLD.
          * @param axis the axis to translate in
          * @param distance the distance to translate
          * @param space Space to rotate in (Default: local)

+ 2 - 2
src/Particles/particle.ts

@@ -187,9 +187,9 @@ import { ColorGradient, FactorGradient } from "Tools";
                 var emitterMesh = (<AbstractMesh>subEmitter.particleSystem.emitter);
                 emitterMesh.position.copyFrom(this.position);
                 if (subEmitter.inheritDirection) {
-                    emitterMesh.position.subtractToRef(this.direction, BABYLON.Tmp.Vector3[0]);
+                    emitterMesh.position.subtractToRef(this.direction, Tmp.Vector3[0]);
                     // Look at using Y as forward
-                    emitterMesh.lookAt(BABYLON.Tmp.Vector3[0], 0, Math.PI / 2);
+                    emitterMesh.lookAt(Tmp.Vector3[0], 0, Math.PI / 2);
                 }
             } else {
                 var emitterPosition = (<Vector3>subEmitter.particleSystem.emitter);

+ 4 - 4
src/Particles/particleHelper.ts

@@ -1,6 +1,6 @@
 import { Nullable } from "types";
 import { Tools } from "Tools";
-import { Vector3 } from "Math";
+import { Vector3, Color4 } from "Math";
 import { AbstractMesh } from "Mesh";
 import { IParticleSystem, GPUParticleSystem, ParticleSystemSet } from "Particles";
 import { Texture } from "Materials";
@@ -38,9 +38,9 @@ import { Scene } from "scene";
             system.createConeEmitter(0.1, Math.PI / 4);
 
             // Particle color
-            system.color1 = new BABYLON.Color4(1.0, 1.0, 1.0, 1.0);
-            system.color2 = new BABYLON.Color4(1.0, 1.0, 1.0, 1.0);
-            system.colorDead = new BABYLON.Color4(1.0, 1.0, 1.0, 0.0);
+            system.color1 = new Color4(1.0, 1.0, 1.0, 1.0);
+            system.color2 = new Color4(1.0, 1.0, 1.0, 1.0);
+            system.colorDead = new Color4(1.0, 1.0, 1.0, 0.0);
 
             // Particle Size
             system.minSize = 0.1;

+ 1 - 1
src/Particles/particleSystem.ts

@@ -50,7 +50,7 @@ import { Scene, IDisposable } from "scene";
         /**
          * @hidden
          */
-        public _inheritedVelocityOffset = new BABYLON.Vector3();
+        public _inheritedVelocityOffset = new Vector3();
         /**
         * An event triggered when the system is disposed
         */

+ 2 - 1
src/Particles/particleSystemSet.ts

@@ -5,6 +5,7 @@ import { IParticleSystem, ParticleHelper, GPUParticleSystem } from "Particles";
 import { Engine } from "Engine";
 import { ParticleSystem } from "Particles";
 import { Scene, IDisposable } from "scene";
+import { StandardMaterial } from "Materials";
     /** Internal class used to store shapes for emitters */
     class ParticleSystemSetEmitterCreationOptions {
         public kind: string;
@@ -51,7 +52,7 @@ import { Scene, IDisposable } from "scene";
             let emitterMesh = MeshBuilder.CreateSphere("emitterSphere", {diameter: options.diameter, segments: options.segments}, scene);
             emitterMesh.renderingGroupId = renderingGroupId;
 
-            var material = new BABYLON.StandardMaterial("emitterSphereMaterial", scene);
+            var material = new StandardMaterial("emitterSphereMaterial", scene);
             material.emissiveColor = options.color;
             emitterMesh.material = material;
 

+ 1 - 1
src/Particles/subEmitter.ts

@@ -45,7 +45,7 @@ import { Scene } from "scene";
         ) {
             // Create mesh as emitter to support rotation
             if (!particleSystem.emitter || !(<AbstractMesh>particleSystem.emitter).dispose) {
-                particleSystem.emitter = new BABYLON.AbstractMesh("SubemitterSystemEmitter", particleSystem.getScene());
+                particleSystem.emitter = new AbstractMesh("SubemitterSystemEmitter", particleSystem.getScene());
             }
 
             // Automatically dispose of subemitter when system is disposed

+ 3 - 3
src/PostProcess/RenderPipeline/Pipelines/defaultRenderingPipeline.ts

@@ -321,7 +321,7 @@ import { GlowLayer } from "Layer";
          */
         public set glowLayerEnabled(enabled: boolean) {
             if (enabled && !this._glowLayer) {
-                this._glowLayer = new BABYLON.GlowLayer("", this._scene);
+                this._glowLayer = new GlowLayer("", this._scene);
             }else if (!enabled && this._glowLayer) {
                 this._glowLayer.dispose();
                 this._glowLayer = null;
@@ -374,7 +374,7 @@ import { GlowLayer } from "Layer";
          * @param cameras - The array of cameras that the rendering pipeline will be attached to (default: scene.cameras)
          * @param automaticBuild - if false, you will have to manually call prepare() to update the pipeline (default: true)
          */
-        constructor(name: string = "", hdr: boolean = true, scene: Scene = BABYLON.Engine.LastCreatedScene!, cameras?: Camera[], automaticBuild = true) {
+        constructor(name: string = "", hdr: boolean = true, scene: Scene = Engine.LastCreatedScene!, cameras?: Camera[], automaticBuild = true) {
             super(scene.getEngine(), name);
             this._cameras = cameras ||  scene.cameras;
             this._cameras = this._cameras.slice();
@@ -571,7 +571,7 @@ import { GlowLayer } from "Layer";
             }
 
             if (!this._enableMSAAOnFirstPostProcess(this.samples) && this.samples > 1) {
-                BABYLON.Tools.Warn("MSAA failed to enable, MSAA is only supported in browsers that support webGL >= 2.0");
+                Tools.Warn("MSAA failed to enable, MSAA is only supported in browsers that support webGL >= 2.0");
             }
         }
 

+ 1 - 1
src/PostProcess/RenderPipeline/Pipelines/standardRenderingPipeline.ts

@@ -574,7 +574,7 @@ import { GeometryBufferRenderer } from "Rendering";
             }
 
             if (!this._enableMSAAOnFirstPostProcess(this._samples) && this._samples > 1) {
-                BABYLON.Tools.Warn("MSAA failed to enable, MSAA is only supported in browsers that support webGL >= 2.0");
+                Tools.Warn("MSAA failed to enable, MSAA is only supported in browsers that support webGL >= 2.0");
             }
         }
 

+ 2 - 1
src/PostProcess/bloomEffect.ts

@@ -1,6 +1,7 @@
 import { PostProcessRenderEffect, PostProcess, ExtractHighlightsPostProcess, BlurPostProcess, BloomMergePostProcess, Scene } from "PostProcess";
 import { Vector2 } from "Math";
 import { Camera } from "Cameras";
+import { Texture } from "Materials";
 
     /**
      * The bloom effect spreads bright areas of an image to simulate artifacts seen in cameras
@@ -77,7 +78,7 @@ import { Camera } from "Cameras";
 
             this._effects = [this._downscale, this._blurX, this._blurY];
 
-            this._merge = new BloomMergePostProcess("bloomMerge", this._downscale, this._blurY, bloomWeight, bloomScale, null, BABYLON.Texture.BILINEAR_SAMPLINGMODE, scene.getEngine(), false, pipelineTextureType, blockCompilation);
+            this._merge = new BloomMergePostProcess("bloomMerge", this._downscale, this._blurY, bloomWeight, bloomScale, null, Texture.BILINEAR_SAMPLINGMODE, scene.getEngine(), false, pipelineTextureType, blockCompilation);
             this._merge.autoClear = false;
             this._effects.push(this._merge);
         }

+ 2 - 1
src/PostProcess/circleOfConfusionPostProcess.ts

@@ -3,6 +3,7 @@ import { Engine } from "Particles";
 import { PostProcess, PostProcessOptions } from "PostProcess";
 import { RenderTargetTexture, Effect } from "Materials";
 import { Camera } from "Cameras";
+import { Tools } from "Tools";
 
     /**
      * The CircleOfConfusionPostProcess computes the circle of confusion value for each pixel given required lens parameters. See https://en.wikipedia.org/wiki/Circle_of_confusion
@@ -43,7 +44,7 @@ import { Camera } from "Cameras";
             this._depthTexture = depthTexture;
             this.onApplyObservable.add((effect: Effect) => {
                 if (!this._depthTexture) {
-                    BABYLON.Tools.Warn("No depth texture set on CircleOfConfusionPostProcess");
+                    Tools.Warn("No depth texture set on CircleOfConfusionPostProcess");
                     return;
                 }
                 effect.setTexture("depthSampler", this._depthTexture);

+ 2 - 2
src/PostProcess/depthOfFieldEffect.ts

@@ -87,7 +87,7 @@ import { PostProcess, PostProcessRenderEffect, CircleOfConfusionPostProcess, Dep
                 return this._effects;
             }, true);
             // Circle of confusion value for each pixel is used to determine how much to blur that pixel
-            this._circleOfConfusion = new BABYLON.CircleOfConfusionPostProcess("circleOfConfusion", depthTexture, 1, null, BABYLON.Texture.BILINEAR_SAMPLINGMODE, scene.getEngine(), false, pipelineTextureType, blockCompilation);
+            this._circleOfConfusion = new CircleOfConfusionPostProcess("circleOfConfusion", depthTexture, 1, null, Texture.BILINEAR_SAMPLINGMODE, scene.getEngine(), false, pipelineTextureType, blockCompilation);
 
             // Create a pyramid of blurred images (eg. fullSize 1/4 blur, half size 1/2 blur, quarter size 3/4 blur, eith size 4/4 blur)
             // Blur the image but do not blur on sharp far to near distance changes to avoid bleeding artifacts
@@ -133,7 +133,7 @@ import { PostProcess, PostProcessRenderEffect, CircleOfConfusionPostProcess, Dep
             }
 
             // Merge blurred images with original image based on circleOfConfusion
-            this._dofMerge = new DepthOfFieldMergePostProcess("dofMerge", this._circleOfConfusion, this._circleOfConfusion, this._depthOfFieldBlurX, ratio, null, BABYLON.Texture.BILINEAR_SAMPLINGMODE, scene.getEngine(), false, pipelineTextureType, blockCompilation);
+            this._dofMerge = new DepthOfFieldMergePostProcess("dofMerge", this._circleOfConfusion, this._circleOfConfusion, this._depthOfFieldBlurX, ratio, null, Texture.BILINEAR_SAMPLINGMODE, scene.getEngine(), false, pipelineTextureType, blockCompilation);
             this._dofMerge.autoClear = false;
             this._effects.push(this._dofMerge);
         }

+ 2 - 1
src/PostProcess/extractHighlightsPostProcess.ts

@@ -3,6 +3,7 @@ import { Camera } from "Cameras";
 import { Effect } from "Materials";
 import { PostProcess, PostProcessOptions } from "PostProcess";
 import { Engine } from "Engine";
+import { ToGammaSpace } from "Math";
     
     /**
      * The extract highlights post process sets all pixels to black except pixels above the specified luminance threshold. Used as the first step for a bloom effect.
@@ -26,7 +27,7 @@ import { Engine } from "Engine";
                 if (this._inputPostProcess) {
                     effect.setTextureFromPostProcess("textureSampler", this._inputPostProcess);
                 }
-                effect.setFloat('threshold', Math.pow(this.threshold, BABYLON.ToGammaSpace));
+                effect.setFloat('threshold', Math.pow(this.threshold, ToGammaSpace));
                 effect.setFloat('exposure', this._exposure);
             });
         }

+ 12 - 11
src/Rendering/utilityLayerRenderer.ts

@@ -2,8 +2,9 @@ import { IDisposable, Scene } from "scene";
 import { Nullable } from "types";
 import { Observable, Observer } from "Tools";
 import { AbstractMesh } from "Culling";
-import { PointerInfoPre, PointerInfo } from "Events";
+import { PointerInfoPre, PointerInfo, PointerEventTypes } from "Events";
 import { PickingInfo } from "Collisions";
+import { Engine } from "Engine";
 
     /**
      * Renders a layer on top of an existing scene
@@ -18,7 +19,7 @@ import { PickingInfo } from "Collisions";
          */
         public static get DefaultUtilityLayer(): UtilityLayerRenderer {
             if (UtilityLayerRenderer._DefaultUtilityLayer == null) {
-                UtilityLayerRenderer._DefaultUtilityLayer = new UtilityLayerRenderer(BABYLON.Engine.LastCreatedScene!);
+                UtilityLayerRenderer._DefaultUtilityLayer = new UtilityLayerRenderer(Engine.LastCreatedScene!);
                 UtilityLayerRenderer._DefaultUtilityLayer.originalScene.onDisposeObservable.addOnce(() => {
                     UtilityLayerRenderer._DefaultUtilityLayer = null;
                 });
@@ -30,7 +31,7 @@ import { PickingInfo } from "Collisions";
          */
         public static get DefaultKeepDepthUtilityLayer(): UtilityLayerRenderer {
             if (UtilityLayerRenderer._DefaultKeepDepthUtilityLayer == null) {
-                UtilityLayerRenderer._DefaultKeepDepthUtilityLayer = new UtilityLayerRenderer(BABYLON.Engine.LastCreatedScene!);
+                UtilityLayerRenderer._DefaultKeepDepthUtilityLayer = new UtilityLayerRenderer(Engine.LastCreatedScene!);
                 UtilityLayerRenderer._DefaultKeepDepthUtilityLayer.utilityLayerScene.autoClearDepthAndStencil = false;
                 UtilityLayerRenderer._DefaultKeepDepthUtilityLayer.originalScene.onDisposeObservable.addOnce(() => {
                     UtilityLayerRenderer._DefaultKeepDepthUtilityLayer = null;
@@ -77,7 +78,7 @@ import { PickingInfo } from "Collisions";
             /** the original scene that will be rendered on top of */
             public originalScene: Scene) {
             // Create scene which will be rendered in the foreground and remove it from being referenced by engine to avoid interfering with existing app
-            this.utilityLayerScene = new BABYLON.Scene(originalScene.getEngine());
+            this.utilityLayerScene = new Scene(originalScene.getEngine());
             this.utilityLayerScene.useRightHandedSystem = originalScene.useRightHandedSystem;
             this.utilityLayerScene._allowPostProcessClearColor = false;
             originalScene.getEngine().scenes.pop();
@@ -87,9 +88,9 @@ import { PickingInfo } from "Collisions";
             this._originalPointerObserver = originalScene.onPrePointerObservable.add((prePointerInfo, eventState) => {
 
                 if (!this.processAllEvents) {
-                    if (prePointerInfo.type !== BABYLON.PointerEventTypes.POINTERMOVE
-                        && prePointerInfo.type !== BABYLON.PointerEventTypes.POINTERUP
-                        && prePointerInfo.type !== BABYLON.PointerEventTypes.POINTERDOWN) {
+                    if (prePointerInfo.type !== PointerEventTypes.POINTERMOVE
+                        && prePointerInfo.type !== PointerEventTypes.POINTERUP
+                        && prePointerInfo.type !== PointerEventTypes.POINTERDOWN) {
                         return;
                     }
                 }
@@ -109,11 +110,11 @@ import { PickingInfo } from "Collisions";
                 this.utilityLayerScene.onPrePointerObservable.notifyObservers(prePointerInfo);
 
                 // allow every non pointer down event to flow to the utility layer
-                if (this.onlyCheckPointerDownEvents && prePointerInfo.type != BABYLON.PointerEventTypes.POINTERDOWN) {
+                if (this.onlyCheckPointerDownEvents && prePointerInfo.type != PointerEventTypes.POINTERDOWN) {
                     if (!prePointerInfo.skipOnPointerObservable) {
                         this.utilityLayerScene.onPointerObservable.notifyObservers(new PointerInfo(prePointerInfo.type, prePointerInfo.event, utilityScenePick));
                     }
-                    if (prePointerInfo.type === BABYLON.PointerEventTypes.POINTERUP && this._pointerCaptures[pointerEvent.pointerId]) {
+                    if (prePointerInfo.type === PointerEventTypes.POINTERUP && this._pointerCaptures[pointerEvent.pointerId]) {
                         this._pointerCaptures[pointerEvent.pointerId] = false;
                     }
                     return;
@@ -141,7 +142,7 @@ import { PickingInfo } from "Collisions";
                                 // We touched an utility mesh present in the main scene
                                 this._notifyObservers(prePointerInfo, originalScenePick, pointerEvent);
                                 prePointerInfo.skipOnPointerObservable = true;
-                            } else if (prePointerInfo.type === BABYLON.PointerEventTypes.POINTERDOWN) {
+                            } else if (prePointerInfo.type === PointerEventTypes.POINTERDOWN) {
                                 this._pointerCaptures[pointerEvent.pointerId] = true;
                             } else if (this._lastPointerEvents[pointerEvent.pointerId]) {
                                 // We need to send a last pointerup to the utilityLayerScene to make sure animations can complete
@@ -169,7 +170,7 @@ import { PickingInfo } from "Collisions";
                             }
                         }
 
-                        if (prePointerInfo.type === BABYLON.PointerEventTypes.POINTERUP && this._pointerCaptures[pointerEvent.pointerId]) {
+                        if (prePointerInfo.type === PointerEventTypes.POINTERUP && this._pointerCaptures[pointerEvent.pointerId]) {
                             this._pointerCaptures[pointerEvent.pointerId] = false;
                         }
                     }

+ 1 - 0
src/Tools/tools.ts

@@ -1,3 +1,4 @@
+    import { Animation } from "Animations";
     /**
      * Interface for any object that can request an animation frame
      */