Browse Source

Progress :-(

sebastien 6 years ago
parent
commit
56939be11e
84 changed files with 146 additions and 133 deletions
  1. 2 3
      src/Behaviors/Mesh/attachToBoxBehavior.ts
  2. 1 1
      src/Cameras/Inputs/arcRotateCameraGamepadInput.ts
  3. 1 0
      src/Cameras/Inputs/flyCameraKeyboardInput.ts
  4. 1 0
      src/Cameras/Inputs/freeCameraDeviceOrientationInput.ts
  5. 1 1
      src/Cameras/Inputs/freeCameraGamepadInput.ts
  6. 3 2
      src/Cameras/Stereoscopic/anaglyphArcRotateCamera.ts
  7. 2 2
      src/Cameras/Stereoscopic/anaglyphFreeCamera.ts
  8. 2 2
      src/Cameras/Stereoscopic/anaglyphGamepadCamera.ts
  9. 2 2
      src/Cameras/Stereoscopic/anaglyphUniversalCamera.ts
  10. 2 2
      src/Cameras/Stereoscopic/stereoscopicArcRotateCamera.ts
  11. 3 2
      src/Cameras/Stereoscopic/stereoscopicFreeCamera.ts
  12. 3 2
      src/Cameras/Stereoscopic/stereoscopicGamepadCamera.ts
  13. 2 2
      src/Cameras/Stereoscopic/stereoscopicUniversalCamera.ts
  14. 2 1
      src/Cameras/VR/vrDeviceOrientationArcRotateCamera.ts
  15. 2 1
      src/Cameras/VR/vrDeviceOrientationFreeCamera.ts
  16. 2 1
      src/Cameras/VR/vrDeviceOrientationGamepadCamera.ts
  17. 1 1
      src/Cameras/VR/vrExperienceHelper.ts
  18. 1 1
      src/Cameras/VR/webVRCamera.ts
  19. 2 2
      src/Cameras/XR/webXREnterExitUI.ts
  20. 5 3
      src/Cameras/arcRotateCamera.ts
  21. 3 3
      src/Cameras/camera.ts
  22. 3 2
      src/Cameras/deviceOrientationCamera.ts
  23. 2 2
      src/Cameras/flyCamera.ts
  24. 2 2
      src/Cameras/followCamera.ts
  25. 1 0
      src/Cameras/freeCamera.ts
  26. 1 1
      src/Cameras/gamepadCamera.ts
  27. 0 1
      src/Cameras/index.ts
  28. 1 1
      src/Cameras/targetCamera.ts
  29. 2 1
      src/Cameras/touchCamera.ts
  30. 1 1
      src/Cameras/universalCamera.ts
  31. 1 1
      src/Collisions/collider.ts
  32. 1 0
      src/Collisions/pickingInfo.ts
  33. 1 1
      src/Debug/boneAxesViewer.ts
  34. 1 1
      src/Debug/debugLayer.ts
  35. 1 2
      src/Debug/rayHelper.ts
  36. 2 9
      src/Debug/skeletonViewer.ts
  37. 2 2
      src/Engine/engine.ts
  38. 1 2
      src/Engine/index.ts
  39. 1 1
      src/Gamepad/Controllers/daydreamController.ts
  40. 1 2
      src/Gamepad/Controllers/genericController.ts
  41. 1 2
      src/Gamepad/Controllers/oculusTouchController.ts
  42. 1 2
      src/Gamepad/Controllers/viveController.ts
  43. 1 2
      src/Gamepad/Controllers/webVRController.ts
  44. 2 2
      src/Gamepad/Controllers/windowsMotionController.ts
  45. 1 1
      src/Gamepad/gamepad.ts
  46. 1 1
      src/Gamepad/gamepadManager.ts
  47. 5 1
      src/Gamepad/gamepadSceneComponent.ts
  48. 1 1
      src/Gamepad/xboxGamepad.ts
  49. 2 2
      src/Gizmos/gizmo.ts
  50. 1 1
      src/Helpers/sceneHelpers.ts
  51. 3 3
      src/Layer/effectLayer.ts
  52. 0 1
      src/Layer/layerSceneComponent.ts
  53. 2 0
      src/Legacy/legacy.ts
  54. 2 2
      src/Lights/Shadows/shadowGenerator.ts
  55. 3 4
      src/Lights/directionalLight.ts
  56. 3 3
      src/Lights/hemisphericLight.ts
  57. 2 1
      src/Lights/pointLight.ts
  58. 1 1
      src/Lights/shadowLight.ts
  59. 2 2
      src/Lights/spotLight.ts
  60. 1 1
      src/Loading/Plugins/babylonFileLoader.ts
  61. 0 1
      src/Loading/loadingScreen.ts
  62. 2 2
      src/Materials/Background/backgroundMaterial.ts
  63. 5 1
      src/Materials/PBR/pbrBaseMaterial.ts
  64. 1 1
      src/Materials/Textures/Procedurals/proceduralTexture.ts
  65. 0 1
      src/Materials/Textures/Procedurals/proceduralTextureSceneComponent.ts
  66. 1 1
      src/Materials/Textures/hdrCubeTexture.ts
  67. 2 2
      src/Materials/material.ts
  68. 1 2
      src/Mesh/geometry.ts
  69. 2 2
      src/Mesh/instancedMesh.ts
  70. 1 1
      src/Mesh/linesMesh.ts
  71. 3 3
      src/Mesh/mesh.ts
  72. 1 1
      src/Mesh/mesh.vertexData.ts
  73. 5 4
      src/Mesh/meshSimplification.ts
  74. 1 1
      src/Mesh/polygonMesh.ts
  75. 2 2
      src/Mesh/subMesh.ts
  76. 1 0
      src/Mesh/vertexBuffer.ts
  77. 3 2
      src/Particles/baseParticleSystem.ts
  78. 2 1
      src/Particles/gpuParticleSystem.ts
  79. 2 1
      src/Physics/Plugins/oimoJSPlugin.ts
  80. 2 1
      src/Physics/physicsImpostor.ts
  81. 3 2
      src/PostProcess/RenderPipeline/Pipelines/defaultRenderingPipeline.ts
  82. 1 0
      src/PostProcess/postProcess.ts
  83. 2 1
      src/Rendering/edgesRenderer.ts
  84. 0 1
      src/index.ts

+ 2 - 3
src/Behaviors/Mesh/attachToBoxBehavior.ts

@@ -3,7 +3,6 @@ import { Mesh, TransformNode } from "Mesh";
 import { Scene } from "scene";
 import { Nullable } from "types";
 import { Observer } from "Tools";
-import { WebVRFreeCamera } from "Cameras";
 import { Behavior } from "Behaviors";
 
     /**
@@ -97,8 +96,8 @@ import { Behavior } from "Behaviors";
 
                 // Find the face closest to the cameras position
                 var cameraPos = this._scene.activeCamera.position;
-                if ((<WebVRFreeCamera>this._scene.activeCamera).devicePosition) {
-                    cameraPos = (<WebVRFreeCamera>this._scene.activeCamera).devicePosition;
+                if ((<any>this._scene.activeCamera).devicePosition) {
+                    cameraPos = (<any>this._scene.activeCamera).devicePosition;
                 }
                 var facing = this._closestFace(cameraPos.subtract(target.position));
                 if (this._scene.activeCamera.leftCamera) {

+ 1 - 1
src/Cameras/Inputs/arcRotateCameraGamepadInput.ts

@@ -1,7 +1,7 @@
 import { ICameraInput, ArcRotateCamera, CameraInputTypes } from "index";
 import { Nullable } from "types";
 import { serialize, Observer } from "Tools";
-import {Gamepad} from "Gamepad";
+import { Gamepad } from "Gamepad";
     /**
      * Manage the gamepad inputs to control an arc rotate camera.
      * @see http://doc.babylonjs.com/how_to/customizing_camera_inputs

+ 1 - 0
src/Cameras/Inputs/flyCameraKeyboardInput.ts

@@ -4,6 +4,7 @@ import { ICameraInput, CameraInputTypes, FlyCamera } from "Cameras";
 import { Engine } from "Engine";
 import { KeyboardInfo, KeyboardEventTypes } from "Events";
 import { Scene } from "scene";
+import { Vector3 } from "Math";
 
     /**
      * Listen to keyboard events to control the camera.

+ 1 - 0
src/Cameras/Inputs/freeCameraDeviceOrientationInput.ts

@@ -1,6 +1,7 @@
 import { Nullable } from "types";
 import { ICameraInput, CameraInputTypes, FreeCamera } from "Cameras";
 import { Quaternion } from "Math";
+import { Tools } from "index";
     /**
      * Takes information about the orientation of the device as reported by the deviceorientation event to orient the camera.
      * Screen rotation is taken into account.

+ 1 - 1
src/Cameras/Inputs/freeCameraGamepadInput.ts

@@ -2,7 +2,7 @@ import { serialize, Observer } from "Tools";
 import { Nullable } from "types";
 import { ICameraInput, CameraInputTypes, FreeCamera } from "Cameras";
 import { Matrix, Vector3, Vector2 } from "Math";
-import {Gamepad} from "Gamepad"
+import { Gamepad } from "Gamepad";
 
     /**
      * Manage the gamepad inputs to control a free camera.

+ 3 - 2
src/Cameras/Stereoscopic/anaglyphArcRotateCamera.ts

@@ -1,7 +1,8 @@
-import { ArcRotateCamera } from "Cameras";
+import { ArcRotateCamera, Camera } from "Cameras";
 import { Scene } from "scene";
 import { Vector3 } from "Math";
-import {Node} from "Node";
+import { Node } from "Node";
+
     Node.AddNodeConstructor("AnaglyphArcRotateCamera", (name, scene, options) => {
         return () => new AnaglyphArcRotateCamera(name, 0, 0, 1.0, Vector3.Zero(), options.interaxial_distance, scene);
     });

+ 2 - 2
src/Cameras/Stereoscopic/anaglyphFreeCamera.ts

@@ -1,7 +1,7 @@
-import { FreeCamera } from "Cameras";
+import { FreeCamera, Camera } from "Cameras";
 import { Scene } from "scene";
 import { Vector3 } from "Math";
-import {Node} from "Node";
+import { Node } from "Node";
 
     Node.AddNodeConstructor("AnaglyphFreeCamera", (name, scene, options) => {
         return () => new AnaglyphFreeCamera(name, Vector3.Zero(), options.interaxial_distance, scene);

+ 2 - 2
src/Cameras/Stereoscopic/anaglyphGamepadCamera.ts

@@ -1,7 +1,7 @@
-import { GamepadCamera } from "Cameras";
+import { GamepadCamera, Camera } from "Cameras";
 import { Scene } from "scene";
 import { Vector3 } from "Math";
-import {Node} from "Node";
+import { Node } from "Node";
 
     Node.AddNodeConstructor("AnaglyphGamepadCamera", (name, scene, options) => {
         return () => new AnaglyphGamepadCamera(name, Vector3.Zero(), options.interaxial_distance, scene);

+ 2 - 2
src/Cameras/Stereoscopic/anaglyphUniversalCamera.ts

@@ -1,7 +1,7 @@
-import { UniversalCamera } from "Cameras";
+import { UniversalCamera, Camera } from "Cameras";
 import { Scene } from "scene";
 import { Vector3 } from "Math";
-import {Node} from "Node";
+import { Node } from "Node";
 
     Node.AddNodeConstructor("AnaglyphUniversalCamera", (name, scene, options) => {
         return () => new AnaglyphUniversalCamera(name, Vector3.Zero(), options.interaxial_distance, scene);

+ 2 - 2
src/Cameras/Stereoscopic/stereoscopicArcRotateCamera.ts

@@ -1,7 +1,7 @@
-import { ArcRotateCamera } from "Cameras";
+import { ArcRotateCamera, Camera } from "Cameras";
 import { Scene } from "scene";
 import { Vector3 } from "Math";
-import {Node} from "Node";
+import { Node } from "Node";
 
     Node.AddNodeConstructor("StereoscopicArcRotateCamera", (name, scene, options) => {
         return () => new StereoscopicArcRotateCamera(name, 0, 0, 1.0, Vector3.Zero(), options.interaxial_distance, options.isStereoscopicSideBySide, scene);

+ 3 - 2
src/Cameras/Stereoscopic/stereoscopicFreeCamera.ts

@@ -1,7 +1,8 @@
-import { FreeCamera } from "Cameras";
+import { FreeCamera, Camera } from "Cameras";
 import { Scene } from "scene";
 import { Vector3 } from "Math";
-import {Node} from "Node";
+import { Node } from "Node";
+
     Node.AddNodeConstructor("StereoscopicFreeCamera", (name, scene, options) => {
         return () => new StereoscopicFreeCamera(name, Vector3.Zero(), options.interaxial_distance, options.isStereoscopicSideBySide, scene);
     });

+ 3 - 2
src/Cameras/Stereoscopic/stereoscopicGamepadCamera.ts

@@ -1,7 +1,8 @@
-import { GamepadCamera } from "Cameras";
+import { GamepadCamera, Camera } from "Cameras";
 import { Scene } from "scene";
 import { Vector3 } from "Math";
-import {Node} from "Node";
+import { Node } from "Node";
+
     Node.AddNodeConstructor("StereoscopicGamepadCamera", (name, scene, options) => {
         return () => new StereoscopicGamepadCamera(name, Vector3.Zero(), options.interaxial_distance, options.isStereoscopicSideBySide, scene);
     });

+ 2 - 2
src/Cameras/Stereoscopic/stereoscopicUniversalCamera.ts

@@ -1,7 +1,7 @@
-import { UniversalCamera } from "Cameras";
+import { UniversalCamera, Camera } from "Cameras";
 import { Scene } from "scene";
 import { Vector3 } from "Math";
-import {Node} from "Node";
+import { Node } from "Node";
     Node.AddNodeConstructor("StereoscopicFreeCamera", (name, scene, options) => {
         return () => new StereoscopicUniversalCamera(name, Vector3.Zero(), options.interaxial_distance, options.isStereoscopicSideBySide, scene);
     });

+ 2 - 1
src/Cameras/VR/vrDeviceOrientationArcRotateCamera.ts

@@ -1,7 +1,8 @@
 import { ArcRotateCamera, VRCameraMetrics, Camera } from "Cameras";
 import { Scene } from "scene";
 import { Vector3 } from "Math";
-import {Node} from "Node";
+import { Node } from "Node";
+
     Node.AddNodeConstructor("VRDeviceOrientationFreeCamera", (name, scene) => {
         return () => new VRDeviceOrientationArcRotateCamera(name, 0, 0, 1.0, Vector3.Zero(), scene);
     });

+ 2 - 1
src/Cameras/VR/vrDeviceOrientationFreeCamera.ts

@@ -1,7 +1,8 @@
 import { DeviceOrientationCamera, VRCameraMetrics, Camera } from "Cameras";
 import { Scene } from "scene";
 import { Vector3 } from "Math";
-import {Node} from "Node";
+import { Node } from "Node";
+
     Node.AddNodeConstructor("VRDeviceOrientationFreeCamera", (name, scene) => {
         return () => new VRDeviceOrientationFreeCamera(name, Vector3.Zero(), scene);
     });

+ 2 - 1
src/Cameras/VR/vrDeviceOrientationGamepadCamera.ts

@@ -1,7 +1,8 @@
 import { VRCameraMetrics, VRDeviceOrientationFreeCamera } from "Cameras";
 import { Scene } from "scene";
 import { Vector3 } from "Math";
-import {Node} from "Node";
+import { Node } from "Node";
+
     Node.AddNodeConstructor("VRDeviceOrientationGamepadCamera", (name, scene) => {
         return () => new VRDeviceOrientationGamepadCamera(name, Vector3.Zero(), scene);
     });

+ 1 - 1
src/Cameras/VR/vrExperienceHelper.ts

@@ -11,7 +11,7 @@ import { PickingInfo } from "Collisions";
 import { Ray } from "Culling";
 import { StandardMaterial, ImageProcessingConfiguration, DynamicTexture } from "Materials";
 import { ImageProcessingPostProcess } from "PostProcess";
-import { SineEase, EasingFunction, Animation, CircleEase } from "Animations";
+import { Animation, SineEase, EasingFunction, CircleEase } from "Animations";
     /**
      * Options to modify the vr teleportation behavior.
      */

+ 1 - 1
src/Cameras/VR/webVRCamera.ts

@@ -321,7 +321,7 @@ import { HemisphericLight } from "Lights";
          * Enables the standing matrix when supported. This can be used to position the user's view the correct height from the ground.
          * @param callback will be called when the standing matrix is set. Callback parameter is if the standing matrix is supported.
          */
-        public useStandingMatrix(callback = () => { }) {
+        public useStandingMatrix(callback = (bool: boolean) => { }) {
             // Use standing matrix if available
             this.getEngine().initWebVRAsync().then((result) => {
                 if (!result.vrDisplay || !result.vrDisplay.stageParameters || !result.vrDisplay.stageParameters.sittingToStandingTransform  || !this.webVROptions.trackPosition) {

+ 2 - 2
src/Cameras/XR/webXREnterExitUI.ts

@@ -21,7 +21,7 @@ import { Observable } from "Tools";
          * Overwritable function which can be used to update the button's visuals when the state changes
          * @param activeButton the current active button in the UI
          */
-        update() {
+        update(activeButton: Nullable<WebXREnterExitUIButton>) {
         }
     }
 
@@ -130,7 +130,7 @@ import { Observable } from "Tools";
         private _updateButtons(activeButton: Nullable<WebXREnterExitUIButton>) {
             this._activeButton = activeButton;
             this._buttons.forEach((b) => {
-                b.update();
+                b.update(this._activeButton);
             });
             this.activeButtonChangedObservable.notifyObservers(this._activeButton);
         }

+ 5 - 3
src/Cameras/arcRotateCamera.ts

@@ -1,11 +1,13 @@
-import { serialize, Observable } from "Tools";
+import { serialize, Observable, serializeAsVector3 } from "Tools";
 import { Nullable } from "types";
 import { Camera, TargetCamera, ArcRotateCameraPointersInput, ArcRotateCameraKeyboardMoveInput, ArcRotateCameraMouseWheelInput, ArcRotateCameraInputsManager } from "Cameras";
 import { Scene } from "scene";
-import { Matrix, Vector3, Vector2 } from "Math";
-import {Node} from "Node";
+import { Matrix, Vector3, Vector2, Epsilon } from "Math";
+import { Node } from "Node";
 import { Mesh, AbstractMesh } from "Mesh";
 import { BouncingBehavior, FramingBehavior, AutoRotationBehavior } from "Behaviors";
+import { Collider } from "index";
+
     Node.AddNodeConstructor("ArcRotateCamera", (name, scene) => {
         return () => new ArcRotateCamera(name, 0, 0, 1.0, Vector3.Zero(), scene);
     });

+ 3 - 3
src/Cameras/camera.ts

@@ -935,8 +935,8 @@ import { Animation } from "Animations";
 
             // create the rig cameras, unless none
             if (this.cameraRigMode !== Camera.RIG_MODE_NONE) {
-                let leftCamera = this.createRigCamera();
-                let rightCamera = this.createRigCamera();
+                let leftCamera = this.createRigCamera(this.name + "_L", 0);
+                let rightCamera = this.createRigCamera(this.name + "_R", 1);
                 if (leftCamera && rightCamera) {
                     this._rigCameras.push(leftCamera);
                     this._rigCameras.push(rightCamera);
@@ -1068,7 +1068,7 @@ import { Animation } from "Animations";
          * needs to be overridden by children so sub has required properties to be copied
          * @hidden
          */
-        public createRigCamera(): Nullable<Camera> {
+        public createRigCamera(name: string, cameraIndex: number): Nullable<Camera> {
             return null;
         }
 

+ 3 - 2
src/Cameras/deviceOrientationCamera.ts

@@ -1,7 +1,8 @@
 import { FreeCamera } from "Cameras";
 import { Scene } from "scene";
-import { Quaternion, Vector3 } from "Math";
-import {Node} from "Node";
+import { Quaternion, Vector3, Axis } from "Math";
+import { Node } from "Node";
+
     Node.AddNodeConstructor("DeviceOrientationCamera", (name, scene) => {
         return () => new DeviceOrientationCamera(name, Vector3.Zero(), scene);
     });

+ 2 - 2
src/Cameras/flyCamera.ts

@@ -1,8 +1,8 @@
-import { serialize } from "Tools";
+import { serialize, serializeAsVector3 } from "Tools";
 import { Nullable } from "types";
 import { TargetCamera, FlyCameraInputsManager, FlyCameraMouseInput, FlyCameraKeyboardInput } from "Cameras";
 import { Scene } from "scene";
-import { Vector3 } from "Math";
+import { Vector3, Quaternion } from "Math";
 import { Engine } from "Engine";
 import { AbstractMesh } from "Mesh";
 import { Collider } from "Collisions";

+ 2 - 2
src/Cameras/followCamera.ts

@@ -1,9 +1,9 @@
-import { serialize, Tools } from "Tools";
+import { serialize, Tools, serializeAsMeshReference } from "Tools";
 import { Nullable } from "types";
 import { TargetCamera } from "Cameras";
 import { Scene } from "scene";
 import { Matrix, Vector3 } from "Math";
-import {Node} from "Node";
+import { Node } from "Node";
 import { AbstractMesh } from "Mesh";
     Node.AddNodeConstructor("FollowCamera", (name, scene) => {
         return () => new FollowCamera(name, Vector3.Zero(), scene);

+ 1 - 0
src/Cameras/freeCamera.ts

@@ -6,6 +6,7 @@ import { Collider } from "Collisions";
 import { Scene } from "scene";
 import { Nullable } from "types";
 import { Engine } from "Engine";
+import { serializeAsVector3, serialize } from "index";
 
     Node.AddNodeConstructor("FreeCamera", (name, scene) => {
         // Forcing to use the Universal camera

+ 1 - 1
src/Cameras/gamepadCamera.ts

@@ -1,7 +1,7 @@
 import { UniversalCamera } from "Cameras";
 import { Scene } from "scene";
 import { Vector3 } from "Math";
-import {Node} from "Node";
+import { Node } from "Node";
     Node.AddNodeConstructor("GamepadCamera", (name, scene) => {
         return () => new GamepadCamera(name, Vector3.Zero(), scene);
     });

+ 0 - 1
src/Cameras/index.ts

@@ -16,5 +16,4 @@ export * from "./touchCamera";
 export * from "./universalCamera";
 export * from "./virtualJoysticksCamera";
 export * from "./VR";
-export * from "./webvr";
 export * from "./XR";

+ 1 - 1
src/Cameras/targetCamera.ts

@@ -1,4 +1,4 @@
-import { serialize } from "Tools";
+import { serialize, serializeAsVector3, serializeAsMeshReference } from "Tools";
 import { Nullable } from "types";
 import { Camera } from "Cameras";
 import { Scene } from "scene";

+ 2 - 1
src/Cameras/touchCamera.ts

@@ -1,7 +1,8 @@
 import { FreeCamera, FreeCameraTouchInput, FreeCameraMouseInput } from "Cameras";
 import { Scene } from "scene";
 import { Vector3 } from "Math";
-import {Node} from "Node";
+import { Node } from "Node";
+
     Node.AddNodeConstructor("TouchCamera", (name, scene) => {
         return () => new TouchCamera(name, Vector3.Zero(), scene);
     });

+ 1 - 1
src/Cameras/universalCamera.ts

@@ -1,4 +1,4 @@
-import { UniversalCamera, TouchCamera, FreeCameraGamepadInput } from "Cameras";
+import { TouchCamera, FreeCameraGamepadInput } from "Cameras";
 import { Scene } from "scene";
 import { Vector3 } from "Math";
     /**

+ 1 - 1
src/Collisions/collider.ts

@@ -1,4 +1,4 @@
-import { Nullable } from "types";
+import { Nullable, IndicesArray } from "types";
 import { Vector3, Plane } from "Math";
 import { AbstractMesh } from "Mesh";
     var intersectBoxAASphere = (boxMin: Vector3, boxMax: Vector3, sphereCenter: Vector3, sphereRadius: number): boolean => {

+ 1 - 0
src/Collisions/pickingInfo.ts

@@ -2,6 +2,7 @@ import { Nullable, FloatArray } from "types";
 import { Vector3, Vector2, Tmp } from "Math";
 import { AbstractMesh, VertexBuffer } from "Mesh";
 import { Ray } from "Culling";
+import { Sprite } from "Sprites";
     /**
      * @hidden
      */

+ 1 - 1
src/Debug/boneAxesViewer.ts

@@ -1,6 +1,6 @@
 import { AxesViewer } from "Debug";
 import { Nullable } from "types";
-import { Mesh } from "Particles";
+import { Mesh } from "Mesh";
 import { Bone } from "Bones";
 import { Vector3, Axis } from "Math";
 import { Scene } from "scene";

+ 1 - 1
src/Debug/debugLayer.ts

@@ -1,4 +1,4 @@
-import { Tools } from "Tools";
+import { Tools, Observable } from "Tools";
 import { Scene } from "scene";
 
     // declare INSPECTOR namespace for compilation issue

+ 1 - 2
src/Debug/rayHelper.ts

@@ -1,9 +1,8 @@
 import { Nullable } from "types";
 import { Ray } from "index";
 import { Vector3, Color3 } from "Math";
-import { LinesMesh } from "Rendering";
 import { Scene } from "scene";
-import { AbstractMesh, Mesh } from "Mesh";
+import { AbstractMesh, LinesMesh, Mesh } from "Mesh";
 
     /**
      * As raycast might be hard to debug, the RayHelper can help rendering the different rays

+ 2 - 9
src/Debug/skeletonViewer.ts

@@ -1,16 +1,9 @@
 import { Color3, Vector3, Matrix, Tmp } from "Math";
-
 import { Scene } from "scene";
-
 import { Nullable } from "types";
-
-import { LinesMesh } from "Mesh";
-
 import { Skeleton, Bone } from "Bones";
-
-import { AbstractMesh } from "Mesh";
-
-import { UtilityLayerRenderer } from "index";
+import { AbstractMesh, LinesMesh, MeshBuilder } from "Mesh";
+import { UtilityLayerRenderer } from "Rendering";
 
 /**
      * Class used to render a debug view of a given skeleton

+ 2 - 2
src/Engine/engine.ts

@@ -5,7 +5,7 @@ import { Scene } from "scene";
 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";
+import { RenderTargetTexture, Material, IInternalTextureLoader, Texture, UniformBuffer, InternalTexture, Effect, DummyInternalTextureTracker, IMultiRenderTargetOptions, BaseTexture, IInternalTextureTracker, VideoTexture, EffectCreationOptions, EffectFallbacks } from "Materials";
 import { PostProcess, PassPostProcess } from "PostProcess";
 import { _TimeToken } from "Instrumentation";
 import { IAudioEngine } from "Audio";
@@ -2620,7 +2620,7 @@ import { _DepthCullingState, _StencilState, _AlphaState } from "States";
          * @param indices defines the data to update
          * @param offset defines the offset in the target index buffer where update should start
          */
-        public updateDynamicIndexBuffer(indexBuffer: WebGLBuffer, indices: IndicesArray): void {
+        public updateDynamicIndexBuffer(indexBuffer: WebGLBuffer, indices: IndicesArray, offset: number = 0): void {
             // Force cache update
             this._currentBoundBuffer[this._gl.ELEMENT_ARRAY_BUFFER] = null;
             this.bindIndexBuffer(indexBuffer);

+ 1 - 2
src/Engine/index.ts

@@ -1,4 +1,3 @@
 export * from "./engine";
 export * from "./Extensions";
-export * from "./nullEngine";
-export * from "./webgl2";
+export * from "./nullEngine";

+ 1 - 1
src/Gamepad/Controllers/daydreamController.ts

@@ -1,6 +1,6 @@
 import { Tools } from "Tools";
 import { Scene } from "scene";
-import {WebVRController, PoseEnabledControllerType, ExtendedGamepadButton, GamepadButtonChanges} from "Gamepad"
+import { WebVRController, PoseEnabledControllerType, ExtendedGamepadButton, GamepadButtonChanges } from "Gamepad";
 import { AbstractMesh } from "Mesh";
 import { _TimeToken } from "Instrumentation";
 import { SceneLoader } from "Loading";

+ 1 - 2
src/Gamepad/Controllers/genericController.ts

@@ -1,5 +1,5 @@
 import { Scene } from "scene";
-import {WebVRController, ExtendedGamepadButton, GamepadButtonChanges} from "Gamepad"
+import { WebVRController, ExtendedGamepadButton, GamepadButtonChanges } from "Gamepad";
 import { AbstractMesh } from "Mesh";
 import { _TimeToken } from "Instrumentation";
 import { SceneLoader } from "Loading";
@@ -51,4 +51,3 @@ import { _DepthCullingState, _StencilState, _AlphaState } from "States";
             console.dir(state);
         }
     }
-

+ 1 - 2
src/Gamepad/Controllers/oculusTouchController.ts

@@ -1,6 +1,6 @@
 import { Observable } from "Tools";
 import { Scene } from "scene";
-import {WebVRController, PoseEnabledControllerType, ExtendedGamepadButton, GamepadButtonChanges} from "Gamepad"
+import { WebVRController, PoseEnabledControllerType, ExtendedGamepadButton, GamepadButtonChanges } from "Gamepad";
 import { AbstractMesh } from "Mesh";
 import { _TimeToken } from "Instrumentation";
 import { SceneLoader } from "Loading";
@@ -183,4 +183,3 @@ import { _DepthCullingState, _StencilState, _AlphaState } from "States";
         }
 
     }
-

+ 1 - 2
src/Gamepad/Controllers/viveController.ts

@@ -1,5 +1,5 @@
 import { Scene } from "scene";
-import {WebVRController, PoseEnabledControllerType, ExtendedGamepadButton, GamepadButtonChanges} from "Gamepad"
+import { WebVRController, PoseEnabledControllerType, ExtendedGamepadButton, GamepadButtonChanges } from "Gamepad";
 import { AbstractMesh } from "Mesh";
 import { _TimeToken } from "Instrumentation";
 import { SceneLoader } from "Loading";
@@ -114,4 +114,3 @@ import { _DepthCullingState, _StencilState, _AlphaState } from "States";
             }
         }
     }
-

+ 1 - 2
src/Gamepad/Controllers/webVRController.ts

@@ -1,6 +1,6 @@
 import { Observable } from "Tools";
 import { Scene } from "scene";
-import {PoseEnabledController, StickValues, ExtendedGamepadButton, GamepadButtonChanges, MutableGamepadButton} from "Gamepad"
+import { PoseEnabledController, StickValues, ExtendedGamepadButton, GamepadButtonChanges, MutableGamepadButton } from "Gamepad";
 import { AbstractMesh } from "Mesh";
 import { _TimeToken } from "Instrumentation";
 import { _DepthCullingState, _StencilState, _AlphaState } from "States";
@@ -161,4 +161,3 @@ import { _DepthCullingState, _StencilState, _AlphaState } from "States";
             this.onPadValuesChangedObservable.clear();
         }
     }
-

+ 2 - 2
src/Gamepad/Controllers/windowsMotionController.ts

@@ -2,8 +2,8 @@ import { Observable, Tools } from "Tools";
 import { Nullable } from "types";
 import { Scene } from "scene";
 import { Quaternion, Vector3 } from "Math";
-import {WebVRController, PoseEnabledController, StickValues, PoseEnabledControllerType, ExtendedGamepadButton, GamepadButtonChanges, GenericController} from "Gamepad"
-import {Node} from "Node";
+import { WebVRController, PoseEnabledController, StickValues, PoseEnabledControllerType, ExtendedGamepadButton, GamepadButtonChanges, GenericController } from "Gamepad";
+import { Node } from "Node";
 import { Mesh, AbstractMesh } from "Mesh";
 import { Ray } from "Culling";
 import { _TimeToken } from "Instrumentation";

+ 1 - 1
src/Gamepad/gamepad.ts

@@ -1,5 +1,5 @@
 import { Observable } from "Tools";
-import {GamepadButtonChanges} from "Gamepad"
+import { GamepadButtonChanges } from "Gamepad";
 import { _TimeToken } from "Instrumentation";
 import { _DepthCullingState, _StencilState, _AlphaState } from "States";
     /**

+ 1 - 1
src/Gamepad/gamepadManager.ts

@@ -1,7 +1,7 @@
 import { Observable, Tools } from "Tools";
 import { Nullable } from "types";
 import { Scene } from "scene";
-import {Gamepad, Xbox360Pad, PoseEnabledControllerHelper, GenericPad} from "Gamepad"
+import { Gamepad, Xbox360Pad, PoseEnabledControllerHelper, GenericPad } from "Gamepad";
 import { _TimeToken } from "Instrumentation";
 import { _DepthCullingState, _StencilState, _AlphaState } from "States";
     /**

+ 5 - 1
src/Gamepad/gamepadSceneComponent.ts

@@ -1,7 +1,7 @@
 import { Nullable } from "types";
 import { FreeCameraGamepadInput, FreeCameraInputsManager, ArcRotateCameraInputsManager, ArcRotateCameraGamepadInput } from "Cameras";
 import { Scene } from "scene";
-import {GamepadManager} from "Gamepad"
+import { GamepadManager } from "Gamepad";
 import { SceneComponentConstants, ISceneComponent } from "sceneComponent";
 import { _TimeToken } from "Instrumentation";
 import { _DepthCullingState, _StencilState, _AlphaState } from "States";
@@ -36,6 +36,7 @@ declare module "scene" {
         configurable: true
     });
 
+declare module "Cameras/FreeCameraInputsManager" {
     /**
      * Interface representing a free camera inputs manager
      */
@@ -46,6 +47,7 @@ declare module "scene" {
          */
         addGamepad(): FreeCameraInputsManager;
     }
+}
 
     /**
      * Adds a gamepad to the free camera inputs manager
@@ -55,6 +57,7 @@ declare module "scene" {
         return this;
     };
 
+declare module "Cameras/ArcRotateCameraInputsManager" {
     /**
      * Interface representing an arc rotate camera inputs manager
      */
@@ -65,6 +68,7 @@ declare module "scene" {
          */
         addGamepad(): ArcRotateCameraInputsManager;
     }
+}
 
     /**
      * Adds a gamepad to the arc rotate camera inputs manager

+ 1 - 1
src/Gamepad/xboxGamepad.ts

@@ -1,5 +1,5 @@
 import { Observable } from "Tools";
-import {Gamepad} from "Gamepad"
+import { Gamepad } from "Gamepad";
 import { _TimeToken } from "Instrumentation";
 import { _DepthCullingState, _StencilState, _AlphaState } from "States";
     /**

+ 2 - 2
src/Gizmos/gizmo.ts

@@ -35,7 +35,7 @@ import { UtilityLayerRenderer } from "Rendering";
         public set attachedMesh(value) {
             this._attachedMesh = value;
             this._rootMesh.setEnabled(value ? true : false);
-            this._attachedMeshChanged();
+            this._attachedMeshChanged(value);
         }
 
         /**
@@ -66,7 +66,7 @@ import { UtilityLayerRenderer } from "Rendering";
          */
         protected _updateScale = true;
         protected _interactionsEnabled = true;
-        protected _attachedMeshChanged() {
+        protected _attachedMeshChanged(value: Nullable<AbstractMesh>) {
         }
 
         private _beforeRenderObserver: Nullable<Observer<Scene>>;

+ 1 - 1
src/Helpers/sceneHelpers.ts

@@ -4,7 +4,7 @@ import { FreeCamera, ArcRotateCamera, TargetCamera, WebXRExperienceHelper, VRExp
 import { Scene } from "scene";
 import { Vector3 } from "Math";
 import { Mesh } from "Mesh";
-import { StandardMaterial, Texture, BaseTexture } from "Materials";
+import { StandardMaterial, Texture, BaseTexture, PBRMaterial } from "Materials";
 import { HemisphericLight } from "Lights";
 import { IEnvironmentHelperOptions, EnvironmentHelper } from "./environmentHelper";
 

+ 3 - 3
src/Layer/effectLayer.ts

@@ -1,4 +1,4 @@
-import { serialize, Observable, Tools, SmartArray } from "Tools";
+import { serialize, Observable, Tools, SmartArray, serializeAsColor4, serializeAsCameraReference } from "Tools";
 import { Nullable } from "types";
 import { Camera } from "Cameras";
 import { Scene } from "scene";
@@ -535,7 +535,7 @@ import { EffectLayerSceneComponent } from "Layer";
          * @param mesh The mesh to render
          * @returns true if it should render otherwise false
          */
-        protected _shouldRenderMesh(): boolean {
+        protected _shouldRenderMesh(mesh: AbstractMesh): boolean {
             return true;
         }
 
@@ -580,7 +580,7 @@ import { EffectLayerSceneComponent } from "Layer";
             }
 
             // Early Exit per mesh
-            if (!this._shouldRenderMesh()) {
+            if (!this._shouldRenderMesh(mesh)) {
                 return;
             }
 

+ 0 - 1
src/Layer/layerSceneComponent.ts

@@ -5,7 +5,6 @@ import { SceneComponentConstants, ISceneComponent } from "sceneComponent";
 import { _TimeToken } from "Instrumentation";
 import { _DepthCullingState, _StencilState, _AlphaState } from "States";
 import { Layer } from "Layer";
-import { AbstractScene } from "abstractScene";
 
 declare module "abstractScene" {
     export interface AbstractScene {

+ 2 - 0
src/Legacy/legacy.ts

@@ -1,6 +1,8 @@
 import * as Babylon from "../index";
 import * as Debug from "../Debug/index";
 
+declare var global: any;
+
 /**
  * Legacy support, defining window.BABYLON (global variable).
  *

+ 2 - 2
src/Lights/Shadows/shadowGenerator.ts

@@ -4,9 +4,9 @@ import { Scene } from "scene";
 import { Matrix, Vector3, Vector2, Color4 } from "Math";
 import { Engine } from "Engine";
 import { Mesh, AbstractMesh, VertexBuffer, SubMesh } from "Mesh";
-import { RenderTargetTexture, Material, Texture, Effect, MaterialHelper } from "Materials";
+import { RenderTargetTexture, Material, Texture, Effect, MaterialHelper, MaterialDefines } from "Materials";
 import { PostProcess, BlurPostProcess } from "PostProcess";
-import { IShadowLight, ShadowGeneratorSceneComponent } from "Lights";
+import { IShadowLight, ShadowGeneratorSceneComponent, Light } from "Lights";
 import { SceneComponentConstants } from "sceneComponent";
 import { _TimeToken } from "Instrumentation";
 import { _DepthCullingState, _StencilState, _AlphaState } from "States";

+ 3 - 4
src/Lights/directionalLight.ts

@@ -2,13 +2,12 @@ import { serialize } from "Tools";
 import { Camera } from "Cameras";
 import { Scene } from "scene";
 import { Matrix, Vector3 } from "Math";
-import {ArcRotateCameraInputsManager} from "Gamepad";
-import {Node} from "Node";
+import { Node } from "Node";
 import { AbstractMesh } from "Mesh";
-import { Effect } from "Materials";
 import { ShadowLight, Light } from "Lights";
 import { _TimeToken } from "Instrumentation";
 import { _DepthCullingState, _StencilState, _AlphaState } from "States";
+import { Effect } from "Materials";
     Node.AddNodeConstructor("Light_Type_1", (name, scene) => {
         return () => new DirectionalLight(name, Vector3.Zero(), scene);
     });
@@ -202,7 +201,7 @@ import { _DepthCullingState, _StencilState, _AlphaState } from "States";
          * @param lightIndex The index of the light in the effect to update
          * @returns The directional light
          */
-        public transferToEffect(lightIndex: string): DirectionalLight {
+        public transferToEffect(effect: Effect, lightIndex: string): DirectionalLight {
             if (this.computeTransformedInformation()) {
                 this._uniformBuffer.updateFloat4("vLightData", this.transformedDirection.x, this.transformedDirection.y, this.transformedDirection.z, 1, lightIndex);
                 return this;

+ 3 - 3
src/Lights/hemisphericLight.ts

@@ -1,12 +1,12 @@
 import { Nullable } from "types";
 import { Scene } from "scene";
 import { Matrix, Vector3, Color3 } from "Math";
-import {ArcRotateCameraInputsManager} from "Gamepad";
-import {Node} from "Node";
+import { Node } from "Node";
 import { Effect } from "Materials";
-import { Light } from "Lights";
+import { Light, IShadowGenerator } from "Lights";
 import { _TimeToken } from "Instrumentation";
 import { _DepthCullingState, _StencilState, _AlphaState } from "States";
+import { serializeAsColor3, serializeAsVector3 } from "index";
     Node.AddNodeConstructor("Light_Type_3", (name, scene) => {
         return () => new HemisphericLight(name, Vector3.Zero(), scene);
     });

+ 2 - 1
src/Lights/pointLight.ts

@@ -6,6 +6,7 @@ import { AbstractMesh } from "Mesh";
 import { ShadowLight, Light } from "Lights";
 import { _TimeToken } from "Instrumentation";
 import { _DepthCullingState, _StencilState, _AlphaState } from "States";
+import { Effect } from "Materials";
     Node.AddNodeConstructor("Light_Type_0", (name, scene) => {
         return () => new PointLight(name, Vector3.Zero(), scene);
     });
@@ -164,7 +165,7 @@ import { _DepthCullingState, _StencilState, _AlphaState } from "States";
          * @param lightIndex The index of the light in the effect to update
          * @returns The point light
          */
-        public transferToEffect(lightIndex: string): PointLight {
+        public transferToEffect(effect: Effect, lightIndex: string): PointLight {
             if (this.computeTransformedInformation()) {
                 this._uniformBuffer.updateFloat4("vLightData",
                     this.transformedPosition.x,

+ 1 - 1
src/Lights/shadowLight.ts

@@ -1,4 +1,4 @@
-import { serialize } from "Tools";
+import { serialize, serializeAsVector3 } from "Tools";
 import { Camera } from "Cameras";
 import { Scene } from "scene";
 import { Matrix, Vector3, Axis } from "Math";

+ 2 - 2
src/Lights/spotLight.ts

@@ -1,8 +1,8 @@
-import { serialize } from "Tools";
+import { serialize, serializeAsTexture } from "Tools";
 import { Nullable } from "types";
 import { Scene } from "scene";
 import { Matrix, Vector3 } from "Math";
-import {Node} from "Node";
+import { Node } from "Node";
 import { AbstractMesh } from "Mesh";
 import { Effect, BaseTexture } from "Materials";
 import { ShadowLight, Light } from "Lights";

+ 1 - 1
src/Loading/Plugins/babylonFileLoader.ts

@@ -5,7 +5,7 @@ import { Scene } from "scene";
 import { Vector3, Color3, Color4 } from "Math";
 import { Mesh, AbstractMesh, Geometry, TransformNode, BoxGeometry, SphereGeometry, CylinderGeometry, TorusGeometry, GroundGeometry, PlaneGeometry, TorusKnotGeometry } from "Mesh";
 import { Material, CubeTexture, HDRCubeTexture } from "Materials";
-import { Animation } from "Animations";
+import { Animation, AnimationGroup } from "Animations";
 import { Light } from "Lights";
 import { SceneComponentConstants } from "sceneComponent";
 import { _TimeToken } from "Instrumentation";

+ 0 - 1
src/Loading/loadingScreen.ts

@@ -191,4 +191,3 @@ import { _DepthCullingState, _StencilState, _AlphaState } from "States";
             this._loadingDiv.style.height = canvasRect.height + "px";
         }
     }
-

+ 2 - 2
src/Materials/Background/backgroundMaterial.ts

@@ -1,7 +1,7 @@
-import { serialize, Observer, Tools, SmartArray, SerializationHelper, serializeAsColor3, expandToProperty } from "Tools";
+import { serialize, Observer, Tools, SmartArray, SerializationHelper, serializeAsColor3, expandToProperty, serializeAsTexture, serializeAsVector3, serializeAsImageProcessingConfiguration } from "Tools";
 import { Nullable, int, float } from "types";
 import { Scene } from "scene";
-import { Matrix, Vector3, Color3 } from "Math";
+import { Matrix, Vector3, Color3, Vector4 } from "Math";
 import { Engine } from "Engine";
 import { Mesh, AbstractMesh, VertexBuffer, SubMesh } from "Mesh";
 import { StandardMaterial, ImageProcessingConfiguration, RenderTargetTexture, Texture, Effect, BaseTexture, MaterialHelper, IImageProcessingConfigurationDefines, PushMaterial, ColorCurves, EffectFallbacks, EffectCreationOptions, MaterialDefines } from "Materials";

+ 5 - 1
src/Materials/PBR/pbrBaseMaterial.ts

@@ -198,6 +198,11 @@ import { _DepthCullingState, _StencilState, _AlphaState } from "States";
         public static readonly LIGHTFALLOFF_STANDARD = 2;
 
         /**
+         * Stores the reflectivity values based on metallic roughness workflow.
+         */
+        private static _scaledReflectivity = new Color3();
+
+        /**
          * Intensity of the direct lights e.g. the four lights available in your scene.
          * This impacts both the direct diffuse and specular highlights.
          */
@@ -748,7 +753,6 @@ import { _DepthCullingState, _StencilState, _AlphaState } from "States";
             return this._albedoTexture;
         }
 
-
         /**
          * Specifies that the submesh is ready to be used.
          * @param mesh - BJS mesh.

+ 1 - 1
src/Materials/Textures/Procedurals/proceduralTexture.ts

@@ -464,7 +464,7 @@ import { _DepthCullingState, _StencilState, _AlphaState } from "States";
          * Render the texture to its associated render target.
          * @param useCameraPostProcess Define if camera post process should be applied to the texture
          */
-        public render(): void {
+        public render(useCameraPostProcess?: boolean): void {
             var scene = this.getScene();
 
             if (!scene) {

+ 0 - 1
src/Materials/Textures/Procedurals/proceduralTextureSceneComponent.ts

@@ -5,7 +5,6 @@ import { SceneComponentConstants, ISceneComponent } from "sceneComponent";
 import { _TimeToken } from "Instrumentation";
 import { _DepthCullingState, _StencilState, _AlphaState } from "States";
 import { Layer } from "Layer";
-import { AbstractScene } from "abstractScene";
 
 declare module "abstractScene" {
     export interface AbstractScene {

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

@@ -237,7 +237,7 @@ import { HDRTools, CubeMapToSphericalPolynomialTools } from "Tools";
             }
 
             var newTexture = new HDRCubeTexture(this.url, scene, this._size, this._noMipmap,
-                this._generateHarmonics, this.gammaSpace);
+                this.gammaSpace);
 
             // Base texture
             newTexture.level = this.level;

+ 2 - 2
src/Materials/material.ts

@@ -858,7 +858,7 @@ declare var BABYLON: any;
          * @param useInstances specifies if instances should be used
          * @returns a boolean indicating if the material is ready to be used
          */
-        public isReady(): boolean {
+        public isReady(mesh?: AbstractMesh, useInstances?: boolean): boolean {
             return true;
         }
 
@@ -1315,7 +1315,7 @@ declare var BABYLON: any;
          * @param forceDisposeTextures specifies if textures should be forcefully disposed
          * @param notBoundToMesh specifies if the material that is being disposed is known to be not bound to any mesh
          */
-        public dispose(forceDisposeEffect?: boolean, notBoundToMesh?: boolean): void {
+        public dispose(forceDisposeEffect?: boolean, forceDisposeTextures?: boolean, notBoundToMesh?: boolean): void {
             const scene = this.getScene();
             // Animations
             scene.stopAnimation(this);

+ 1 - 2
src/Mesh/geometry.ts

@@ -1,4 +1,3 @@
-    
     import { Tools, Tags } from "Tools";
     import { Nullable, FloatArray, DataArray, IndicesArray } from "types";
     import { Scene } from "scene";
@@ -7,7 +6,7 @@
     import { Mesh, AbstractMesh, VertexBuffer, SubMesh, IGetSetVerticesData, VertexData } from "Mesh";
     import { Effect } from "Materials";
     import { SceneLoader } from "Loading";
-import { BoundingInfo } from "index";
+    import { BoundingInfo } from "index";
     /**
      * Class used to store geometry data (vertex buffers + index buffer)
      */

+ 2 - 2
src/Mesh/instancedMesh.ts

@@ -2,11 +2,11 @@ import { Tools } from "Tools";
 import { Nullable, FloatArray, IndicesArray } from "types";
 import { Camera } from "Cameras";
 import { Vector3 } from "Math";
-import {Node} from "Node";
+import { Node } from "Node";
 import { Mesh, AbstractMesh } from "Mesh";
 import { Material } from "Materials";
 import { Skeleton } from "Bones";
-import { BoundingInfo } from "Culling";
+
     /**
      * Creates an instance based on a source mesh.
      */

+ 1 - 1
src/Mesh/linesMesh.ts

@@ -1,7 +1,7 @@
 import { Nullable } from "types";
 import { Scene } from "scene";
 import { Color3 } from "Math";
-import {Node} from "Node";
+import { Node } from "Node";
 import { Mesh, VertexBuffer, SubMesh } from "Mesh";
 import { Material, Effect, ShaderMaterial } from "Materials";
     /**

+ 3 - 3
src/Mesh/mesh.ts

@@ -2,10 +2,10 @@ import { Observer, Observable, Tools, IAnimatable, Tags, AsyncLoop } from "Tools
 import { Nullable, FloatArray, IndicesArray } from "types";
 import { Camera } from "Cameras";
 import { Scene } from "scene";
-import { Quaternion, Matrix, Vector3, Vector2, Color3, Color4, Plane, Tmp, Vector4, Path3D } from "Math";
+import { Quaternion, Matrix, Vector3, Vector2, Color3, Color4, Plane, Vector4, Path3D } from "Math";
 import { Engine } from "Engine";
-import {Node} from "Node";
-import { AbstractMesh, Geometry, InstancedMesh, VertexBuffer, SubMesh, LinesMesh, IGetSetVerticesData, MeshLODLevel, VertexData, GroundMesh, MeshBuilder } from "Mesh";
+import { Node } from "Node";
+import { AbstractMesh, Geometry, InstancedMesh, VertexBuffer, SubMesh, LinesMesh, IGetSetVerticesData, MeshLODLevel, VertexData, GroundMesh, MeshBuilder, Buffer } from "Mesh";
 import { BoundingSphere, BoundingInfo } from "Culling";
 import { Material, Effect } from "Materials";
 import { Animation } from "Animations";

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

@@ -1,5 +1,5 @@
 import { Nullable, FloatArray, IndicesArray } from "types";
-import { Matrix, Vector3, Vector2, Color3, Color4, Vector4 } from "Math";
+import { Matrix, Vector3, Vector2, Color3, Color4, Vector4, Axis, Epsilon } from "Math";
 import { Mesh, Geometry, VertexBuffer } from "Mesh";
     /**
      * Define an interface for all classes that will get and set the data on vertices

+ 5 - 4
src/Mesh/meshSimplification.ts

@@ -1,6 +1,7 @@
 import { IndicesArray } from "types";
-import { Vector3, Vector2, Color4, Epsilon } from "Math";
+import { Vector3, Epsilon } from "Math";
 import { Mesh, VertexBuffer, SubMesh } from "Mesh";
+import { AsyncLoop } from "index";
     /**
      * A simplifier interface for future simplification implementations
      * @see http://doc.babylonjs.com/how_to/in-browser_mesh_simplification
@@ -364,9 +365,9 @@ import { Mesh, VertexBuffer, SubMesh } from "Mesh";
                                 if (v0.isBorder || v1.isBorder) { continue; }
 
                                 var p = Vector3.Zero();
-                                var n = Vector3.Zero();
-                                var uv = Vector2.Zero();
-                                var color = new Color4(0, 0, 0, 1);
+                                // var n = Vector3.Zero();
+                                // var uv = Vector2.Zero();
+                                // var color = new Color4(0, 0, 0, 1);
 
                                 this.calculateError(v0, v1, p);
 

+ 1 - 1
src/Mesh/polygonMesh.ts

@@ -1,6 +1,6 @@
 import { Tools } from "Tools";
 import { Scene } from "scene";
-import { Vector3, Vector2 } from "Math";
+import { Vector3, Vector2, Path2 } from "Math";
 import { Mesh, VertexBuffer } from "Mesh";
     declare var earcut: any;
     /**

+ 2 - 2
src/Mesh/subMesh.ts

@@ -4,8 +4,8 @@ import { Matrix, Vector3, Plane } from "Math";
 import { Engine } from "Engine";
 import { Mesh, AbstractMesh, InstancedMesh, VertexBuffer, LinesMesh } from "Mesh";
 import { Collider, IntersectionInfo } from "Collisions";
-import { Ray, ICullable } from "Culling";
-import { Material, Effect, MaterialDefines } from "Materials";
+import { Ray, ICullable, BoundingInfo } from "Culling";
+import { Material, Effect, MaterialDefines, MultiMaterial } from "Materials";
     /**
      * Base class for submeshes
      */

+ 1 - 0
src/Mesh/vertexBuffer.ts

@@ -1,4 +1,5 @@
 import { Nullable, DataArray } from "types";
+import { Buffer } from ".";
     /**
      * Specialized buffer used to store vertex data
      */

+ 3 - 2
src/Particles/baseParticleSystem.ts

@@ -5,7 +5,8 @@ import { ImageProcessingConfiguration, Texture, ProceduralTexture, ImageProcessi
 import { Scene } from "scene";
 import { ColorGradient, FactorGradient, Color3Gradient, IValueGradient } from "Tools";
 import { BoxParticleEmitter, IParticleEmitterType, ParticleSystem, PointParticleEmitter, HemisphericParticleEmitter, SphereParticleEmitter, SphereDirectedParticleEmitter, CylinderParticleEmitter, CylinderDirectedParticleEmitter, ConeParticleEmitter } from "Particles";
-    
+import { Animation } from "Animations";
+
     /**
      * This represents the base class for particle system in Babylon.
      * Particles are often small sprites used to simulate hard-to-reproduce phenomena like fire, smoke, water, or abstract visual effects like magic glitter and faery dust.
@@ -724,4 +725,4 @@ import { BoxParticleEmitter, IParticleEmitterType, ParticleSystem, PointParticle
             this.maxEmitBox = maxEmitBox;
             return particleEmitter;
         }
-    }
+    }

+ 2 - 1
src/Particles/gpuParticleSystem.ts

@@ -1,12 +1,13 @@
 import { Nullable, float } from "types";
 import { IAnimatable, Observable, Tools, IValueGradient, ColorGradient, FactorGradient, Color3Gradient } from "Tools";
 import { Color4, Color3, Vector3, Matrix, Tmp, Scalar } from "Math";
-import { AbstractMesh, VertexBuffer } from "Mesh";
+import { AbstractMesh, VertexBuffer, Buffer } from "Mesh";
 import { IParticleSystem, BaseParticleSystem } from "Particles";
 import { Material, ImageProcessingConfiguration, Effect, Texture, RawTexture, EffectCreationOptions, MaterialHelper } from "Materials";
 import { Engine } from "Engine";
 import { BoxParticleEmitter, ParticleSystem } from "Particles";
 import { Scene, IDisposable } from "scene";
+
     /**
      * This represents a GPU particle system in Babylon
      * This is the fastest particle system in Babylon as it uses the GPU to update the individual particle data

+ 2 - 1
src/Physics/Plugins/oimoJSPlugin.ts

@@ -1,4 +1,5 @@
-import { IPhysicsEnginePlugin, PhysicsImpostor, IPhysicsEnabledObject, PhysicsEngine, PhysicsImpostorJoint, PhysicsJoint, SpringJointData, DistanceJointData, IMotorEnabledJoint, AbstractMesh } from "Physics";
+import { IPhysicsEnginePlugin, PhysicsImpostor, IPhysicsEnabledObject, PhysicsEngine, PhysicsImpostorJoint, PhysicsJoint, SpringJointData, DistanceJointData, IMotorEnabledJoint } from "Physics";
+import { AbstractMesh } from "Mesh";
 import { Vector3, Quaternion } from "Math";
 import { Nullable } from "types";
 import { Tools } from "Tools";

+ 2 - 1
src/Physics/physicsImpostor.ts

@@ -1,7 +1,8 @@
 import { Nullable, IndicesArray } from "types";
 import { Tools } from "Tools";
 import { Vector3, Matrix, Quaternion, Space } from "Math";
-import { TransformNode, AbstractMesh, Scene } from "Mesh";
+import { TransformNode, AbstractMesh } from "Mesh";
+import { Scene } from "scene";
 import { Bone } from "Bones";
 import { BoundingInfo } from "Culling";
 import { IPhysicsEngine, PhysicsJoint, PhysicsJointData } from "Physics";

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

@@ -2,11 +2,12 @@ import { Nullable } from "types";
 import { IAnimatable, Observer, serialize, SerializationHelper } from "Tools";
 import { Camera } from "Cameras";
 import { ImageProcessingConfiguration, Texture } from "Materials";
-import { PostProcess, PostProcessRenderPipeline, Scene, SharpenPostProcess, PostProcessRenderEffect, BloomEffect, DepthOfFieldEffect, FxaaPostProcess, ImageProcessingPostProcess, ChromaticAberrationPostProcess, GrainPostProcess, DepthOfFieldEffectBlurLevel } from "PostProcess";
+import { PostProcess, PostProcessRenderPipeline, SharpenPostProcess, PostProcessRenderEffect, BloomEffect, DepthOfFieldEffect, FxaaPostProcess, ImageProcessingPostProcess, ChromaticAberrationPostProcess, GrainPostProcess, DepthOfFieldEffectBlurLevel } from "PostProcess";
 import { Engine } from "Engine";
 import { IDisposable } from "scene";
 import { GlowLayer } from "Layer";
-    
+import { Scene } from "scene";
+import { Animation } from "Animations";
     /**
 	 * The default rendering pipeline can be added to a scene to apply common post processing effects such as anti-aliasing or depth of field.
      * See https://doc.babylonjs.com/how_to/using_default_rendering_pipeline

+ 1 - 0
src/PostProcess/postProcess.ts

@@ -5,6 +5,7 @@ import { Camera, WebVRFreeCamera } from "Cameras";
 import { Effect, Texture, InternalTexture } from "Materials";
 import { Engine } from "Engine";
 import { Scene } from "scene";
+import { Animation } from "Animations";
     /**
      * Size options for a post process
      */

+ 2 - 1
src/Rendering/edgesRenderer.ts

@@ -54,6 +54,7 @@ declare module "Mesh/AbstractMesh" {
         configurable: true
     });
 
+declare module "Mesh/LinesMesh" {
     export interface LinesMesh {
         /**
          * Enables the edge rendering mode on the mesh.
@@ -65,7 +66,7 @@ declare module "Mesh/AbstractMesh" {
          */
         enableEdgesRendering(epsilon?: number, checkVerticesInsteadOfIndices?: boolean): AbstractMesh;
     }
-
+}
     LinesMesh.prototype.enableEdgesRendering = function(epsilon = 0.95, checkVerticesInsteadOfIndices = false): AbstractMesh {
         this.disableEdgesRendering();
         this._edgesRenderer = new LineEdgesRenderer(this, epsilon, checkVerticesInsteadOfIndices);

+ 0 - 1
src/index.ts

@@ -22,7 +22,6 @@ export * from "./Loading";
 export * from "./Materials";
 export * from "./Math";
 export * from "./Mesh";
-export * from "./mixins";
 export * from "./Morph";
 export * from "./node";
 export * from "./Offline";