Explorar o código

add imports to a ton of files

Trevor Baron %!s(int64=6) %!d(string=hai) anos
pai
achega
aac30327f9
Modificáronse 100 ficheiros con 717 adicións e 171 borrados
  1. 8 0
      src/Actions/action.ts
  2. 36 27
      src/Actions/actionManager.ts
  3. 3 1
      src/Actions/condition.ts
  4. 5 1
      src/Actions/directActions.ts
  5. 7 3
      src/Actions/directAudioActions.ts
  6. 7 1
      src/Actions/interpolateValueAction.ts
  7. 8 0
      src/Animations/animatable.ts
  8. 7 0
      src/Animations/animation.ts
  9. 7 2
      src/Animations/animationGroup.ts
  10. 2 1
      src/Animations/animationPropertiesOverride.ts
  11. 4 0
      src/Animations/runtimeAnimation.ts
  12. 9 1
      src/Audio/analyser.ts
  13. 6 0
      src/Audio/audioEngine.ts
  14. 8 0
      src/Audio/audioSceneComponent.ts
  15. 16 1
      src/Audio/sound.ts
  16. 6 1
      src/Audio/soundtrack.ts
  17. 3 0
      src/Audio/weightedsound.ts
  18. 7 1
      src/Behaviors/Cameras/autoRotationBehavior.ts
  19. 9 1
      src/Behaviors/Cameras/bouncingBehavior.ts
  20. 10 0
      src/Behaviors/Cameras/framingBehavior.ts
  21. 16 9
      src/Behaviors/Mesh/attachToBoxBehavior.ts
  22. 5 1
      src/Behaviors/Mesh/fadeInOutBehavior.ts
  23. 8 1
      src/Behaviors/Mesh/multiPointerScaleBehavior.ts
  24. 16 1
      src/Behaviors/Mesh/pointerDragBehavior.ts
  25. 10 1
      src/Behaviors/Mesh/sixDofDragBehavior.ts
  26. 3 1
      src/Behaviors/behavior.ts
  27. 8 1
      src/Bones/bone.ts
  28. 6 1
      src/Bones/boneIKController.ts
  29. 7 1
      src/Bones/boneLookController.ts
  30. 11 1
      src/Bones/skeleton.ts
  31. 4 0
      src/Cameras/Inputs/arcRotateCameraGamepadInput.ts
  32. 8 1
      src/Cameras/Inputs/arcRotateCameraKeyboardMoveInput.ts
  33. 5 0
      src/Cameras/Inputs/arcRotateCameraMouseWheelInput.ts
  34. 5 0
      src/Cameras/Inputs/arcRotateCameraPointersInput.ts
  35. 3 0
      src/Cameras/Inputs/arcRotateCameraVRDeviceOrientationInput.ts
  36. 8 1
      src/Cameras/Inputs/flyCameraKeyboardInput.ts
  37. 6 1
      src/Cameras/Inputs/flyCameraMouseInput.ts
  38. 3 0
      src/Cameras/Inputs/freeCameraDeviceOrientationInput.ts
  39. 7 1
      src/Cameras/Inputs/freeCameraGamepadInput.ts
  40. 9 2
      src/Cameras/Inputs/freeCameraKeyboardMoveInput.ts
  41. 5 1
      src/Cameras/Inputs/freeCameraMouseInput.ts
  42. 7 2
      src/Cameras/Inputs/freeCameraTouchInput.ts
  43. 5 1
      src/Cameras/Inputs/freeCameraVirtualJoystickInput.ts
  44. 5 1
      src/Cameras/Stereoscopic/anaglyphArcRotateCamera.ts
  45. 6 1
      src/Cameras/Stereoscopic/anaglyphFreeCamera.ts
  46. 6 1
      src/Cameras/Stereoscopic/anaglyphGamepadCamera.ts
  47. 6 1
      src/Cameras/Stereoscopic/anaglyphUniversalCamera.ts
  48. 6 1
      src/Cameras/Stereoscopic/stereoscopicArcRotateCamera.ts
  49. 5 1
      src/Cameras/Stereoscopic/stereoscopicFreeCamera.ts
  50. 5 1
      src/Cameras/Stereoscopic/stereoscopicGamepadCamera.ts
  51. 5 1
      src/Cameras/Stereoscopic/stereoscopicUniversalCamera.ts
  52. 3 2
      src/Cameras/VR/vrCameraMetrics.ts
  53. 4 0
      src/Cameras/VR/vrDeviceOrientationArcRotateCamera.ts
  54. 4 0
      src/Cameras/VR/vrDeviceOrientationFreeCamera.ts
  55. 4 0
      src/Cameras/VR/vrDeviceOrientationGamepadCamera.ts
  56. 19 5
      src/Cameras/VR/vrExperienceHelper.ts
  57. 13 2
      src/Cameras/VR/webVRCamera.ts
  58. 3 1
      src/Cameras/XR/webXRCamera.ts
  59. 6 3
      src/Cameras/XR/webXREnterExitUI.ts
  60. 7 1
      src/Cameras/XR/webXRExperienceHelper.ts
  61. 5 1
      src/Cameras/XR/webXRInput.ts
  62. 4 1
      src/Cameras/XR/webXRManagedOutputCanvas.ts
  63. 13 8
      src/Cameras/XR/webXRSessionManager.ts
  64. 8 0
      src/Cameras/arcRotateCamera.ts
  65. 2 0
      src/Cameras/arcRotateCameraInputsManager.ts
  66. 16 5
      src/Cameras/camera.ts
  67. 3 0
      src/Cameras/cameraInputsManager.ts
  68. 4 0
      src/Cameras/deviceOrientationCamera.ts
  69. 9 1
      src/Cameras/flyCamera.ts
  70. 2 1
      src/Cameras/flyCameraInputsManager.ts
  71. 8 1
      src/Cameras/followCamera.ts
  72. 2 1
      src/Cameras/freeCameraInputsManager.ts
  73. 5 1
      src/Cameras/gamepadCamera.ts
  74. 8 3
      src/Cameras/targetCamera.ts
  75. 9 5
      src/Cameras/touchCamera.ts
  76. 8 5
      src/Cameras/universalCamera.ts
  77. 5 1
      src/Cameras/virtualJoysticksCamera.ts
  78. 19 16
      src/Collisions/collider.ts
  79. 7 0
      src/Collisions/collisionCoordinator.ts
  80. 6 2
      src/Collisions/collisionWorker.ts
  81. 4 0
      src/Collisions/pickingInfo.ts
  82. 5 1
      src/Culling/Octrees/octree.ts
  83. 4 1
      src/Culling/Octrees/octreeBlock.ts
  84. 7 0
      src/Culling/Octrees/octreeSceneComponent.ts
  85. 4 1
      src/Culling/boundingBox.ts
  86. 6 1
      src/Culling/boundingInfo.ts
  87. 3 1
      src/Culling/boundingSphere.ts
  88. 7 1
      src/Culling/ray.ts
  89. 5 1
      src/Engine/Extensions/engine.occlusionQuery.ts
  90. 4 1
      src/Engine/Extensions/engine.transformFeedback.ts
  91. 21 14
      src/Engine/engine.ts
  92. 9 0
      src/Engine/nullEngine.ts
  93. 7 1
      src/Events/pointerEvents.ts
  94. 8 1
      src/Gamepad/Controllers/daydreamController.ts
  95. 8 1
      src/Gamepad/Controllers/gearVRController.ts
  96. 7 1
      src/Gamepad/Controllers/genericController.ts
  97. 8 1
      src/Gamepad/Controllers/oculusTouchController.ts
  98. 10 0
      src/Gamepad/Controllers/poseEnabledController.ts
  99. 7 1
      src/Gamepad/Controllers/viveController.ts
  100. 0 0
      src/Gamepad/Controllers/webVRController.ts

+ 8 - 0
src/Actions/action.ts

@@ -1,3 +1,11 @@
+import { Observable } from "Tools";
+import { Vector2, Vector3, Color3, Color4 } from "Math";
+import { Scene } from "scene";
+import { Mesh } from "Mesh";
+import { Light } from "Lights";
+import { Camera } from "Cameras";
+import {Node} from "Node";
+import { ActionManager, Condition, ActionEvent } from "Actions";
     /**
      * The action to be carried out following a trigger
      * @see http://doc.babylonjs.com/how_to/how_to_use_actions#available-actions

+ 36 - 27
src/Actions/actionManager.ts

@@ -1,3 +1,12 @@
+import { Nullable } from "types";
+import { AbstractMesh } from "Mesh";
+import { Sprite } from "Sprites";
+import { Scene } from "scene";
+import { Vector2, Vector3, Vector4, Color3, Color4 } from "Math";
+import { Action, Condition, ValueCondition, DoNothingAction } from "Actions";
+import { Engine } from "Engine";
+import { Tools } from "Tools";
+
     /**
      * ActionEvent is the event being sent when an action is triggered.
      */
@@ -526,10 +535,10 @@
         public static Parse(parsedActions: any, object: Nullable<AbstractMesh>, scene: Scene): void {
             var actionManager = new ActionManager(scene);
             if (object === null) {
-                scene.actionManager = actionManager;
+                scene.actionManager = actionManager;
             }
             else {
-                object.actionManager = actionManager;
+                object.actionManager = actionManager;
             }
 
             // instanciate a new object
@@ -546,10 +555,10 @@
                     var floatValue = parseFloat(value);
 
                     if (value === "true" || value === "false") {
-                        return value === "true";
+                        return value === "true";
                     }
                     else {
-                        return isNaN(floatValue) ? value : floatValue;
+                        return isNaN(floatValue) ? value : floatValue;
                     }
                 }
 
@@ -563,33 +572,33 @@
 
                 // Return appropriate value with its type
                 if (typeof (target) === "boolean") {
-                    return values[0] === "true";
+                    return values[0] === "true";
                 }
 
                 if (typeof (target) === "string") {
-                    return values[0];
+                    return values[0];
                 }
 
                 // Parameters with multiple values such as Vector3 etc.
                 var split = new Array<number>();
                 for (var i = 0; i < values.length; i++) {
-                    split.push(parseFloat(values[i]));
+                    split.push(parseFloat(values[i]));
                 }
 
                 if (target instanceof Vector3) {
-                    return Vector3.FromArray(split);
+                    return Vector3.FromArray(split);
                 }
 
                 if (target instanceof Vector4) {
-                    return Vector4.FromArray(split);
+                    return Vector4.FromArray(split);
                 }
 
                 if (target instanceof Color3) {
-                    return Color3.FromArray(split);
+                    return Color3.FromArray(split);
                 }
 
                 if (target instanceof Color4) {
-                    return Color4.FromArray(split);
+                    return Color4.FromArray(split);
                 }
 
                 return parseFloat(values[0]);
@@ -598,7 +607,7 @@
             // traverse graph per trigger
             var traverse = (parsedAction: any, trigger: any, condition: Nullable<Condition>, action: Nullable<Action>, combineArray: Nullable<Array<Action>> = null) => {
                 if (parsedAction.detached) {
-                    return;
+                    return;
                 }
 
                 var parameters = new Array<any>();
@@ -608,10 +617,10 @@
 
                 // Parameters
                 if (parsedAction.type === 2) {
-                    parameters.push(actionManager);
+                    parameters.push(actionManager);
                 }
                 else {
-                    parameters.push(trigger);
+                    parameters.push(trigger);
                 }
 
                 if (combine) {
@@ -629,14 +638,14 @@
 
                         if (name === "target") {
                             if (targetType !== null && targetType === "SceneProperties") {
-                                value = target = scene;
+                                value = target = scene;
                             }
                             else {
-                                value = target = scene.getNodeByName(value);
-                        }
+                                value = target = scene.getNodeByName(value);
+                        }
                             }
                         else if (name === "parent") {
-                            value = scene.getNodeByName(value);
+                            value = scene.getNodeByName(value);
                              }
                         else if (name === "sound") {
                             // Can not externalize to component, so only checks for the presence off the API.
@@ -646,10 +655,10 @@
                         }
                         else if (name !== "propertyPath") {
                             if (parsedAction.type === 2 && name === "operator") {
-                                value = (<any>ValueCondition)[value];
+                                value = (<any>ValueCondition)[value];
                             }
                             else {
-                                value = parseParameter(name, value, target, name === "value" ? propertyPath : null);
+                                value = parseParameter(name, value, target, name === "value" ? propertyPath : null);
                             }
                         } else {
                             propertyPath = value;
@@ -680,10 +689,10 @@
                     var nothing = new DoNothingAction(trigger, condition);
 
                     if (action) {
-                        action.then(nothing);
+                        action.then(nothing);
                     }
                     else {
-                        actionManager.registerAction(nothing);
+                        actionManager.registerAction(nothing);
                     }
 
                     action = nothing;
@@ -696,10 +705,10 @@
                     } else {
                         condition = null;
                         if (action) {
-                            action.then(newAction);
+                            action.then(newAction);
                         }
                         else {
-                            actionManager.registerAction(newAction);
+                            actionManager.registerAction(newAction);
                         }
                     }
                 }
@@ -708,7 +717,7 @@
                 }
 
                 for (var i = 0; i < parsedAction.children.length; i++) {
-                    traverse(parsedAction.children[i], trigger, condition, newAction, null);
+                    traverse(parsedAction.children[i], trigger, condition, newAction, null);
                 }
             };
 
@@ -728,12 +737,12 @@
                     triggerParams = { trigger: (<any>ActionManager)[trigger.name], parameter: value };
                 }
                 else {
-                    triggerParams = (<any>ActionManager)[trigger.name];
+                    triggerParams = (<any>ActionManager)[trigger.name];
                 }
 
                 for (var j = 0; j < trigger.children.length; j++) {
                     if (!trigger.detached) {
-                        traverse(trigger.children[j], triggerParams, null, null);
+                        traverse(trigger.children[j], triggerParams, null, null);
                     }
                 }
             }

+ 3 - 1
src/Actions/condition.ts

@@ -1,3 +1,5 @@
+import { ActionManager, Action } from "Actions";
+
     /**
      * A Condition applied to an Action
      */
@@ -316,4 +318,4 @@
             });
         }
     }
-
+

+ 5 - 1
src/Actions/directActions.ts

@@ -1,3 +1,7 @@
+import { Action, Condition, ActionManager, ActionEvent } from "Actions";
+import { Tools } from "Tools";
+import { Vector3 } from "Math";
+
     /**
      * This defines an action responsible to toggle a boolean once triggered.
      * @see http://doc.babylonjs.com/how_to/how_to_use_actions
@@ -532,4 +536,4 @@
                 ]
             }, parent);
         }
-    }
+    }

+ 7 - 3
src/Actions/directAudioActions.ts

@@ -1,3 +1,7 @@
+import { Action, Condition } from "Actions";
+
+import { Sound } from "Audio";
+
     /**
      * This defines an action helpful to play a defined sound on a triggered action.
      */
@@ -24,7 +28,7 @@
          */
         public execute(): void {
             if (this._sound !== undefined) {
-                this._sound.play();
+                this._sound.play();
             }
         }
 
@@ -67,7 +71,7 @@
          */
         public execute(): void {
             if (this._sound !== undefined) {
-                this._sound.stop();
+                this._sound.stop();
             }
         }
 
@@ -82,4 +86,4 @@
                 properties: [{ name: "sound", value: this._sound.name }]
             }, parent);
         }
-    }
+    }

+ 7 - 1
src/Actions/interpolateValueAction.ts

@@ -1,3 +1,9 @@
+import { Action, Condition } from "Actions";
+
+import { Observable, Tools } from "Tools";
+
+import { Color3, Vector3, Matrix, Quaternion } from "Math";
+
     /**
      * This defines an action responsible to change the value of a property
      * by interpolating between its current value and the newly set one once triggered.
@@ -133,4 +139,4 @@
                 ]
             }, parent);
         }
-    }
+    }

+ 8 - 0
src/Animations/animatable.ts

@@ -1,3 +1,11 @@
+import { Nullable } from "types";
+
+import { RuntimeAnimation } from "Animations";
+
+import { Scene } from "Gamepad/gamepadSceneComponent";
+
+import { Observable } from "Tools";
+
     /**
      * Class used to store an actual running animation
      */

+ 7 - 0
src/Animations/animation.ts

@@ -1,3 +1,10 @@
+import { Path2, Vector3, Quaternion, Vector2, Color3, Size, Scalar, Matrix } from "Math";
+import { IEasingFunction, RuntimeAnimation, EasingFunction } from "Animations";
+import { Nullable } from "types";
+import { Scene } from "Debug/debugLayer";
+import { IAnimatable } from "Tools";
+import { Node } from "Node";
+
     /**
      * Represents the range of an animation
      */

+ 7 - 2
src/Animations/animationGroup.ts

@@ -1,3 +1,8 @@
+import { Scene, IDisposable } from "scene";
+import { Observable } from "Tools";
+import { Nullable } from "types";
+import { IAnimationKey, Animation, Animatable } from "Animations";
+import { Engine } from "Engine";
     /**
      * This class defines the direct association between an animation and a target
      */
@@ -403,12 +408,12 @@
                 var targetNode = scene.getNodeByID(id);
 
                 if (targetNode != null) {
-                    animationGroup.addTargetedAnimation(animation, targetNode);
+                    animationGroup.addTargetedAnimation(animation, targetNode);
                 }
             }
 
             if (parsedAnimationGroup.from !== null && parsedAnimationGroup.from !== null) {
-                animationGroup.normalize(parsedAnimationGroup.from, parsedAnimationGroup.to);
+                animationGroup.normalize(parsedAnimationGroup.from, parsedAnimationGroup.to);
             }
 
             return animationGroup;

+ 2 - 1
src/Animations/animationPropertiesOverride.ts

@@ -1,3 +1,4 @@
+    import {Animation} from "Animations"
     /**
      * Class used to override all child animations of a given target
      */
@@ -16,4 +17,4 @@
          * Gets or sets the default loop mode to use
          */
         public loopMode = Animation.ANIMATIONLOOPMODE_CYCLE;
-    }
+    }

+ 4 - 0
src/Animations/runtimeAnimation.ts

@@ -1,3 +1,7 @@
+import { Quaternion, Vector3, Vector2, Size, Color3, Matrix } from "Math";
+import {Animation, AnimationEvent} from "Animations";
+import { Scene } from "scene";
+
     // Static values to help the garbage collector
 
     // Quaternion

+ 9 - 1
src/Audio/analyser.ts

@@ -1,3 +1,11 @@
+import { Nullable } from "types";
+
+import { Scene } from "scene";
+
+import { IAudioEngine } from "Audio";
+
+import { Engine } from "Engine";
+
     /**
      * Class used to work with sound analyzer using fast fourier transform (FFT)
      * @see http://doc.babylonjs.com/how_to/playing_sounds_and_music
@@ -187,4 +195,4 @@
                 this._webAudioAnalyser.disconnect();
             }
         }
-    }
+    }

+ 6 - 0
src/Audio/audioEngine.ts

@@ -1,3 +1,9 @@
+import { IDisposable } from "scene";
+import { Nullable } from "types";
+import { Observable, Tools } from "Tools";
+import { Engine } from "Engine";
+import { Analyser } from "Audio";
+
     /**
      * This represents an audio engine and it is responsible
      * to play, synchronize and analyse sounds throughout the application.

+ 8 - 0
src/Audio/audioSceneComponent.ts

@@ -1,3 +1,11 @@
+import {Engine} from "Engine"
+import {Camera} from "Cameras"
+import { Sound, SoundTrack } from "Audio";
+import { Nullable } from "types";
+import { Scene } from "scene";
+import { Matrix, Vector3 } from "Math";
+import { SceneComponentConstants, ISceneSerializableComponent } from "sceneComponent";
+
     // Adds the parser to the scene parsers.
     AbstractScene.AddParser(SceneComponentConstants.NAME_AUDIO, (parsedData: any, scene: Scene, container: AssetContainer, rootUrl: string) => {
         // TODO: add sound

+ 16 - 1
src/Audio/sound.ts

@@ -1,3 +1,18 @@
+import { Observable, Tools } from "Tools";
+
+import { Vector3, Tmp } from "Math";
+
+import { Nullable } from "types";
+
+import { Scene } from "scene";
+
+import { Engine } from "Engine";
+
+import { AudioSceneComponent } from "Audio";
+
+import { TransformNode, AbstractMesh } from "Mesh";
+import { SceneComponentConstants } from "sceneComponent";
+
     /**
      * Defines a sound that can be played in the application.
      * The sound can either be an ambient track or a simple sound played in reaction to a user action.
@@ -905,7 +920,7 @@
 
             if (this.spatialSound) {
                 if (this._connectedMesh) {
-                    serializationObject.connectedMeshId = this._connectedMesh.id;
+                    serializationObject.connectedMeshId = this._connectedMesh.id;
                 }
 
                 serializationObject.position = this._position.asArray();

+ 6 - 1
src/Audio/soundtrack.ts

@@ -1,3 +1,8 @@
+import { Sound, Analyser } from "Audio";
+import { Nullable } from "types";
+import { Scene } from "scene";
+import { Engine } from "Engine";
+
     /**
      * Options allowed during the creation of a sound track.
      */
@@ -172,4 +177,4 @@
                 this._connectedAnalyser.connectAudioNodes(this._outputAudioNode, Engine.audioEngine.masterGain);
             }
         }
-    }
+    }

+ 3 - 0
src/Audio/weightedsound.ts

@@ -1,3 +1,6 @@
+import { Sound } from "Audio";
+import { Tools } from "Tools";
+
     /**
      * Wraps one or more Sound objects and selects one with random weight for playback.
      */

+ 7 - 1
src/Behaviors/Cameras/autoRotationBehavior.ts

@@ -1,3 +1,9 @@
+import { Behavior } from "Behaviors";
+import { ArcRotateCamera, Camera } from "Cameras";
+import { Nullable } from "types";
+import { Observer, Tools } from "Tools";
+import { PointerInfoPre, PointerEventTypes } from "Events";
+
     /**
      * The autoRotation behavior (BABYLON.AutoRotationBehavior) is designed to create a smooth rotation of an ArcRotateCamera when there is no user interaction.
      * @see http://doc.babylonjs.com/how_to/camera_behaviors#autorotation-behavior
@@ -201,4 +207,4 @@
                 this._attachedCamera.inertialPanningY !== 0 ||
                 this._isPointerDown;
         }
-    }
+    }

+ 9 - 1
src/Behaviors/Cameras/bouncingBehavior.ts

@@ -1,3 +1,11 @@
+import { Behavior } from "Behaviors";
+import { ArcRotateCamera, Camera } from "Cameras";
+import { BackEase, EasingFunction } from "Animations";
+import { Nullable } from "types";
+import { Observer } from "Tools";
+import { AbstractMesh } from "Mesh";
+import {Animation} from "Animations";
+
     /**
      * Add a bouncing effect to an ArcRotateCamera when reaching a specified minimum and maximum radius
      * @see http://doc.babylonjs.com/how_to/camera_behaviors#bouncing-behavior
@@ -203,4 +211,4 @@
                 this._animatables.shift();
             }
         }
-    }
+    }

+ 10 - 0
src/Behaviors/Cameras/framingBehavior.ts

@@ -1,3 +1,13 @@
+import { Behavior } from "Behaviors";
+import { ArcRotateCamera, Camera } from "Cameras";
+import { ExponentialEase } from "Animations";
+import { Nullable } from "types";
+import { PointerInfoPre, PointerEventTypes } from "Events";
+import { Observer, Tools } from "Tools";
+import { AbstractMesh } from "Mesh";
+import { Vector3, Vector2 } from "Math";
+import {Animation} from "Animations";
+
     /**
      * The framing behavior (BABYLON.FramingBehavior) is designed to automatically position an ArcRotateCamera when its target is set to a mesh. It is also useful if you want to prevent the camera to go under a virtual horizontal plane.
      * @see http://doc.babylonjs.com/how_to/camera_behaviors#framing-behavior

+ 16 - 9
src/Behaviors/Mesh/attachToBoxBehavior.ts

@@ -1,14 +1,21 @@
+import { Vector3, Matrix, Quaternion } from "Math";
+import { Mesh } from "Mesh";
+import { Scene } from "scene";
+import { Nullable } from "types";
+import { Observer } from "Tools";
+import { WebVRFreeCamera } from "Cameras";
+
     /**
      * @hidden
      */
     class FaceDirectionInfo {
-        constructor(public direction: Vector3, public rotatedDirection = new BABYLON.Vector3(), public diff = 0, public ignore = false) {}
+        constructor(public direction: Vector3, public rotatedDirection = new Vector3(), public diff = 0, public ignore = false) {}
     }
 
     /**
      * A behavior that when attached to a mesh will will place a specified node on the meshes face pointing towards the camera
      */
-    export class AttachToBoxBehavior implements BABYLON.Behavior<BABYLON.Mesh> {
+    export class AttachToBoxBehavior implements BABYLON.Behavior<Mesh> {
         /**
          *  The name of the behavior
          */
@@ -21,7 +28,7 @@
          * The distance from the bottom of the face that the UI should be attached to (default: 0.15)
          */
         public distanceAwayFromBottomOfFace = 0.15;
-        private _faceVectors = [new FaceDirectionInfo(BABYLON.Vector3.Up()), new FaceDirectionInfo(BABYLON.Vector3.Down()), new FaceDirectionInfo(BABYLON.Vector3.Left()), new FaceDirectionInfo(BABYLON.Vector3.Right()), new FaceDirectionInfo(BABYLON.Vector3.Forward()), new FaceDirectionInfo(BABYLON.Vector3.Forward().scaleInPlace(-1))];
+        private _faceVectors = [new FaceDirectionInfo(Vector3.Up()), new FaceDirectionInfo(Vector3.Down()), new FaceDirectionInfo(Vector3.Left()), new FaceDirectionInfo(Vector3.Right()), new FaceDirectionInfo(Vector3.Forward()), new FaceDirectionInfo(Vector3.Forward().scaleInPlace(-1))];
         private _target: Mesh;
         private _scene: Scene;
         private _onRenderObserver: Nullable<Observer<Scene>>;
@@ -50,8 +57,8 @@
                     this._target.rotationQuaternion = Quaternion.RotationYawPitchRoll(this._target.rotation.y, this._target.rotation.x, this._target.rotation.z);
                 }
                 this._target.rotationQuaternion.toRotationMatrix(this._tmpMatrix);
-                BABYLON.Vector3.TransformCoordinatesToRef(v.direction, this._tmpMatrix, v.rotatedDirection);
-                v.diff = BABYLON.Vector3.GetAngleBetweenVectors(v.rotatedDirection, targetDirection, BABYLON.Vector3.Cross(v.rotatedDirection, targetDirection));
+                Vector3.TransformCoordinatesToRef(v.direction, this._tmpMatrix, v.rotatedDirection);
+                v.diff = Vector3.GetAngleBetweenVectors(v.rotatedDirection, targetDirection, Vector3.Cross(v.rotatedDirection, targetDirection));
             });
             // Return the face information of the one with the normal closeset to target direction
             return this._faceVectors.reduce((min, p) => {
@@ -67,7 +74,7 @@
 
         private _zeroVector = Vector3.Zero();
         private _lookAtTmpMatrix = new Matrix();
-        private _lookAtToRef(pos: Vector3, up = new BABYLON.Vector3(0, 1, 0), ref: Quaternion) {
+        private _lookAtToRef(pos: Vector3, up = new Vector3(0, 1, 0), ref: Quaternion) {
             BABYLON.Matrix.LookAtLHToRef(this._zeroVector, pos, up, this._lookAtTmpMatrix);
             this._lookAtTmpMatrix.invert();
             BABYLON.Quaternion.FromRotationMatrixToRef(this._lookAtTmpMatrix, ref);
@@ -77,7 +84,7 @@
          * Attaches the AttachToBoxBehavior to the passed in mesh
          * @param target The mesh that the specified node will be attached to
          */
-        attach(target: BABYLON.Mesh) {
+        attach(target: Mesh) {
             this._target = target;
             this._scene = this._target.getScene();
 
@@ -100,7 +107,7 @@
                 }
 
                 // Get camera up direction
-                BABYLON.Vector3.TransformCoordinatesToRef(BABYLON.Vector3.Up(), this._tmpMatrix, this._tmpVector);
+                Vector3.TransformCoordinatesToRef(Vector3.Up(), this._tmpMatrix, this._tmpVector);
                 // Ignore faces to not select a parrelel face for the up vector of the UI
                 this._faceVectors.forEach((v) => {
                     if (facing.direction.x && v.direction.x) {
@@ -161,4 +168,4 @@
         detach() {
             this._scene.onBeforeRenderObservable.remove(this._onRenderObserver);
         }
-    }
+    }

+ 5 - 1
src/Behaviors/Mesh/fadeInOutBehavior.ts

@@ -1,3 +1,7 @@
+import { Behavior } from "index";
+import { Mesh, AbstractMesh } from "Mesh";
+import { Nullable } from "types";
+
     /**
      * A behavior that when attached to a mesh will allow the mesh to fade in and out
      */
@@ -87,4 +91,4 @@
             });
         }
 
-    }
+    }

+ 8 - 1
src/Behaviors/Mesh/multiPointerScaleBehavior.ts

@@ -1,3 +1,10 @@
+import { Mesh } from "Mesh";
+import { PointerDragBehavior, Behavior } from "Behaviors";
+import { Vector3 } from "Math";
+import { Nullable } from "types";
+import { Observer } from "Tools";
+import { Scene } from "scene";
+
     /**
      * A behavior that when attached to a mesh will allow the mesh to be scaled
      */
@@ -99,4 +106,4 @@
                 this._ownerNode.removeBehavior(behavior);
             });
         }
-    }
+    }

+ 16 - 1
src/Behaviors/Mesh/pointerDragBehavior.ts

@@ -1,3 +1,18 @@
+import { Behavior } from "Behaviors";
+
+import { Mesh, AbstractMesh } from "Mesh";
+
+import { Scene } from "scene";
+
+import { Nullable } from "types";
+
+import { Observer, Observable } from "Tools";
+
+import { Vector3 } from "Math";
+import { PointerInfo } from "Events";
+import { BoundingBoxGizmo } from "Gizmos";
+import { Ray } from "Culling/ray";
+
     /**
      * A behavior that when attached to a mesh will allow the mesh to be dragged around the screen based on pointer events
      */
@@ -396,4 +411,4 @@
                 this._scene.onBeforeRenderObservable.remove(this._beforeRenderObserver);
             }
         }
-    }
+    }

+ 10 - 1
src/Behaviors/Mesh/sixDofDragBehavior.ts

@@ -1,3 +1,12 @@
+import { Behavior } from "Behaviors";
+import { Mesh, AbstractMesh } from "Mesh";
+import {Scene} from "scene";
+import { Nullable } from "index";
+import { Vector3, Quaternion } from "Math";
+import {PointerInfo} from "Events";
+import { Observer, Observable } from "Tools";
+import {BoundingBoxGizmo} from "Gizmos";
+import {Camera} from "Cameras";
     /**
      * A behavior that when attached to a mesh will allow the mesh to be dragged around based on directions and origin of the pointer's ray
      */
@@ -228,4 +237,4 @@
             this.onDragEndObservable.clear();
             this.onDragStartObservable.clear();
         }
-    }
+    }

+ 3 - 1
src/Behaviors/behavior.ts

@@ -1,3 +1,5 @@
+import { Nullable } from "types";
+
     /**
      * Interface used to define a behavior
      */
@@ -42,4 +44,4 @@
          * @returns the behavior or null if not found
          */
         getBehaviorByName(name: string): Nullable<Behavior<T>>;
-    }
+    }

+ 8 - 1
src/Bones/bone.ts

@@ -1,3 +1,10 @@
+import { Vector3, Quaternion, Matrix, Space } from "Math";
+import { Tools } from "Tools";
+import { Nullable } from "types";
+import { Skeleton } from "Bones";
+import { AnimationPropertiesOverride } from "Animations";
+import { AbstractMesh } from "Mesh";
+
     /**
      * Class used to store bone information
      * @see http://doc.babylonjs.com/how_to/how_to_use_bones_and_skeletons
@@ -1103,4 +1110,4 @@
 
             Vector3.TransformCoordinatesToRef(position, tmat, result);
         }
-    }
+    }

+ 6 - 1
src/Bones/boneIKController.ts

@@ -1,3 +1,8 @@
+import { Vector3, Quaternion, Matrix, Space } from "Math";
+import { AbstractMesh } from "Mesh";
+import { Nullable } from "types";
+import { Bone } from "Bones";
+
     /**
      * Class used to apply inverse kinematics to bones
      * @see http://doc.babylonjs.com/how_to/how_to_use_bones_and_skeletons#boneikcontroller
@@ -339,4 +344,4 @@
             this._bone2.setAxisAngle(this._bendAxis, angC, Space.LOCAL);
             this._bone2Ang = angC;
         }
-    }
+    }

+ 7 - 1
src/Bones/boneLookController.ts

@@ -1,3 +1,9 @@
+import { Vector3, Quaternion, Matrix, Space, Axis } from "Math";
+import { Tools } from "Tools";
+import { AbstractMesh } from "Mesh";
+import { Bone } from "Bones";
+import { Nullable } from "types";
+
     /**
      * Class used to make a bone look toward a point in space
      * @see http://doc.babylonjs.com/how_to/how_to_use_bones_and_skeletons#bonelookcontroller
@@ -561,4 +567,4 @@
             return false;
         }
 
-    }
+    }

+ 11 - 1
src/Bones/skeleton.ts

@@ -1,3 +1,13 @@
+import { IAnimatable, Observable, Tools } from "Tools";
+import { Bone } from "Bones";
+import { Vector3, Matrix, Tmp } from "Math";
+import { Scene } from "scene";
+import { Nullable } from "types";
+import { AbstractMesh } from "Mesh";
+import { RawTexture } from "Materials";
+import { AnimationRange, AnimationPropertiesOverride } from "Animations";
+import { Engine } from "Engine";
+
     /**
      * Class used to handle skinning animations
      * @see http://doc.babylonjs.com/how_to/how_to_use_bones_and_skeletons
@@ -688,4 +698,4 @@
 
             bones.push(bone);
         }
-    }
+    }

+ 4 - 0
src/Cameras/Inputs/arcRotateCameraGamepadInput.ts

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

+ 8 - 1
src/Cameras/Inputs/arcRotateCameraKeyboardMoveInput.ts

@@ -1,3 +1,10 @@
+import { serialize, Observer } from "Tools";
+import { Nullable } from "types";
+import { Scene } from "scene";
+import { ICameraInput, ArcRotateCamera, CameraInputTypes } from "Cameras";
+import { Engine } from "Engine";
+import { KeyboardInfo, KeyboardEventTypes } from "Events";
+
     /**
      * Manage the keyboard inputs to control the movement of an arc rotate camera.
      * @see http://doc.babylonjs.com/how_to/customizing_camera_inputs
@@ -225,4 +232,4 @@
         }
     }
 
-    (<any>CameraInputTypes)["ArcRotateCameraKeyboardMoveInput"] = ArcRotateCameraKeyboardMoveInput;
+    (<any>CameraInputTypes)["ArcRotateCameraKeyboardMoveInput"] = ArcRotateCameraKeyboardMoveInput;

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

@@ -1,3 +1,8 @@
+import { serialize, Observer, EventState } from "Tools";
+import { Nullable } from "types";
+import { ICameraInput, ArcRotateCamera, CameraInputTypes } from "Cameras";
+import { PointerInfo, PointerEventTypes } from "Events";
+
     /**
      * Manage the mouse wheel inputs to control an arc rotate camera.
      * @see http://doc.babylonjs.com/how_to/customizing_camera_inputs

+ 5 - 0
src/Cameras/Inputs/arcRotateCameraPointersInput.ts

@@ -1,3 +1,8 @@
+import { serialize, EventState, Observer, Tools } from "Tools";
+import { Nullable } from "types";
+import { ICameraInput, ArcRotateCamera, CameraInputTypes } from "Cameras";
+import { PointerInfo, PointerEventTypes } from "Events";
+
     /**
      * Manage the pointers inputs to control an arc rotate camera.
      * @see http://doc.babylonjs.com/how_to/customizing_camera_inputs

+ 3 - 0
src/Cameras/Inputs/arcRotateCameraVRDeviceOrientationInput.ts

@@ -1,3 +1,6 @@
+import { Nullable } from "types";
+import { ICameraInput, ArcRotateCamera, CameraInputTypes } from "Cameras";
+
     /**
      * Manage the device orientation inputs (gyroscope) to control an arc rotate camera.
      * @see http://doc.babylonjs.com/how_to/customizing_camera_inputs

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

@@ -1,3 +1,10 @@
+import { serialize, Observer } from "Tools";
+import { Nullable } from "types";
+import { ICameraInput, CameraInputTypes, FlyCamera } from "Cameras";
+import { Engine } from "Engine";
+import { KeyboardInfo, KeyboardEventTypes } from "Events";
+import { Scene } from "scene";
+
     /**
      * Listen to keyboard events to control the camera.
      * @see http://doc.babylonjs.com/how_to/customizing_camera_inputs
@@ -189,4 +196,4 @@
         }
     }
 
-    (<any>CameraInputTypes)["FlyCameraKeyboardInput"] = FlyCameraKeyboardInput;
+    (<any>CameraInputTypes)["FlyCameraKeyboardInput"] = FlyCameraKeyboardInput;

+ 6 - 1
src/Cameras/Inputs/flyCameraMouseInput.ts

@@ -1,3 +1,8 @@
+import { serialize, Observer } from "Tools";
+import { Nullable } from "types";
+import { ICameraInput, CameraInputTypes, FlyCamera } from "Cameras";
+import { PointerInfo, PointerEventTypes } from "Events";
+import { Scene } from "scene";
     /**
      * Listen to mouse events to control the camera.
      * @see http://doc.babylonjs.com/how_to/customizing_camera_inputs
@@ -301,4 +306,4 @@
         }
     }
 
-    (<any>CameraInputTypes)["FlyCameraMouseInput"] = FlyCameraMouseInput;
+    (<any>CameraInputTypes)["FlyCameraMouseInput"] = FlyCameraMouseInput;

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

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

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

@@ -1,3 +1,9 @@
+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"
+
     /**
      * Manage the gamepad inputs to control a free camera.
      * @see http://doc.babylonjs.com/how_to/customizing_camera_inputs
@@ -127,4 +133,4 @@
         }
     }
 
-    (<any>CameraInputTypes)["FreeCameraGamepadInput"] = FreeCameraGamepadInput;
+    (<any>CameraInputTypes)["FreeCameraGamepadInput"] = FreeCameraGamepadInput;

+ 9 - 2
src/Cameras/Inputs/freeCameraKeyboardMoveInput.ts

@@ -1,3 +1,10 @@
+import { serialize, Observer } from "Tools";
+import { Nullable } from "types";
+import { ICameraInput, CameraInputTypes, FreeCamera } from "Cameras";
+import { KeyboardInfo, KeyboardEventTypes } from "Events";
+import { Scene } from "scene";
+import { Vector3 } from "Math";
+import { Engine } from "Engine";
     /**
      * Manage the keyboard inputs to control the movement of a free camera.
      * @see http://doc.babylonjs.com/how_to/customizing_camera_inputs
@@ -151,7 +158,7 @@
         }
 
         /** @hidden */
-        public _onLostFocus(e: FocusEvent): void {
+        public _onLostFocus(): void {
             this._keys = [];
         }
 
@@ -164,4 +171,4 @@
         }
     }
 
-    (<any>CameraInputTypes)["FreeCameraKeyboardMoveInput"] = FreeCameraKeyboardMoveInput;
+    (<any>CameraInputTypes)["FreeCameraKeyboardMoveInput"] = FreeCameraKeyboardMoveInput;

+ 5 - 1
src/Cameras/Inputs/freeCameraMouseInput.ts

@@ -1,3 +1,7 @@
+import { serialize, Observer, EventState } from "Tools";
+import { Nullable } from "types";
+import { ICameraInput, CameraInputTypes, FreeCamera } from "Cameras";
+import { PointerInfo, PointerEventTypes } from "Events";
     /**
      * Manage the mouse inputs to control the movement of a free camera.
      * @see http://doc.babylonjs.com/how_to/customizing_camera_inputs
@@ -46,7 +50,7 @@
             var engine = this.camera.getEngine();
 
             if (!this._pointerInput) {
-                this._pointerInput = (p, s) => {
+                this._pointerInput = (p) => {
                     var evt = <PointerEvent>p.event;
 
                     if (engine.isInVRExclusivePointerMode) {

+ 7 - 2
src/Cameras/Inputs/freeCameraTouchInput.ts

@@ -1,3 +1,8 @@
+import { serialize, Observer, EventState } from "Tools";
+import { Nullable } from "types";
+import { ICameraInput, CameraInputTypes, FreeCamera } from "Cameras";
+import { PointerInfo, PointerEventTypes } from "Events";
+import { Matrix, Vector3 } from "Math";
     /**
      * Manage the touch inputs to control the movement of a free camera.
      * @see http://doc.babylonjs.com/how_to/customizing_camera_inputs
@@ -39,12 +44,12 @@
             var previousPosition: Nullable<{ x: number, y: number }> = null;
 
             if (this._pointerInput === undefined) {
-                this._onLostFocus = (evt) => {
+                this._onLostFocus = () => {
                     this._offsetX = null;
                     this._offsetY = null;
                 };
 
-                this._pointerInput = (p, s) => {
+                this._pointerInput = (p) => {
                     var evt = <PointerEvent>p.event;
 
                     if (evt.pointerType === "mouse") {

+ 5 - 1
src/Cameras/Inputs/freeCameraVirtualJoystickInput.ts

@@ -1,3 +1,7 @@
+import { VirtualJoystick, JoystickAxis } from "Tools";
+import { Nullable } from "types";
+import { ICameraInput, CameraInputTypes, FreeCamera } from "Cameras";
+import { Matrix, Vector3 } from "Math";
     /**
      * Manage the Virtual Joystick inputs to control the movement of a free camera.
      * @see http://doc.babylonjs.com/how_to/customizing_camera_inputs
@@ -93,4 +97,4 @@
         }
     }
 
-    (<any>CameraInputTypes)["FreeCameraVirtualJoystickInput"] = FreeCameraVirtualJoystickInput;
+    (<any>CameraInputTypes)["FreeCameraVirtualJoystickInput"] = FreeCameraVirtualJoystickInput;

+ 5 - 1
src/Cameras/Stereoscopic/anaglyphArcRotateCamera.ts

@@ -1,3 +1,7 @@
+import { ArcRotateCamera } from "Cameras";
+import { Scene } from "scene";
+import { Vector3 } from "Math";
+import {Node} from "Node";
     Node.AddNodeConstructor("AnaglyphArcRotateCamera", (name, scene, options) => {
         return () => new AnaglyphArcRotateCamera(name, 0, 0, 1.0, Vector3.Zero(), options.interaxial_distance, scene);
     });
@@ -31,4 +35,4 @@
         public getClassName(): string {
             return "AnaglyphArcRotateCamera";
         }
-    }
+    }

+ 6 - 1
src/Cameras/Stereoscopic/anaglyphFreeCamera.ts

@@ -1,3 +1,8 @@
+import { FreeCamera } from "Cameras";
+import { Scene } from "scene";
+import { Vector3 } from "Math";
+import {Node} from "Node";
+
     Node.AddNodeConstructor("AnaglyphFreeCamera", (name, scene, options) => {
         return () => new AnaglyphFreeCamera(name, Vector3.Zero(), options.interaxial_distance, scene);
     });
@@ -27,4 +32,4 @@
         public getClassName(): string {
             return "AnaglyphFreeCamera";
         }
-    }
+    }

+ 6 - 1
src/Cameras/Stereoscopic/anaglyphGamepadCamera.ts

@@ -1,3 +1,8 @@
+import { GamepadCamera } from "Cameras";
+import { Scene } from "scene";
+import { Vector3 } from "Math";
+import {Node} from "Node";
+
     Node.AddNodeConstructor("AnaglyphGamepadCamera", (name, scene, options) => {
         return () => new AnaglyphGamepadCamera(name, Vector3.Zero(), options.interaxial_distance, scene);
     });
@@ -27,4 +32,4 @@
         public getClassName(): string {
             return "AnaglyphGamepadCamera";
         }
-    }
+    }

+ 6 - 1
src/Cameras/Stereoscopic/anaglyphUniversalCamera.ts

@@ -1,3 +1,8 @@
+import { UniversalCamera } from "Cameras";
+import { Scene } from "scene";
+import { Vector3 } from "Math";
+import {Node} from "Node";
+
     Node.AddNodeConstructor("AnaglyphUniversalCamera", (name, scene, options) => {
         return () => new AnaglyphUniversalCamera(name, Vector3.Zero(), options.interaxial_distance, scene);
     });
@@ -27,4 +32,4 @@
         public getClassName(): string {
             return "AnaglyphUniversalCamera";
         }
-    }
+    }

+ 6 - 1
src/Cameras/Stereoscopic/stereoscopicArcRotateCamera.ts

@@ -1,3 +1,8 @@
+import { ArcRotateCamera } from "Cameras";
+import { Scene } from "scene";
+import { Vector3 } from "Math";
+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);
     });
@@ -32,4 +37,4 @@
         public getClassName(): string {
             return "StereoscopicArcRotateCamera";
         }
-    }
+    }

+ 5 - 1
src/Cameras/Stereoscopic/stereoscopicFreeCamera.ts

@@ -1,3 +1,7 @@
+import { FreeCamera } from "Cameras";
+import { Scene } from "scene";
+import { Vector3 } from "Math";
+import {Node} from "Node";
     Node.AddNodeConstructor("StereoscopicFreeCamera", (name, scene, options) => {
         return () => new StereoscopicFreeCamera(name, Vector3.Zero(), options.interaxial_distance, options.isStereoscopicSideBySide, scene);
     });
@@ -29,4 +33,4 @@
         public getClassName(): string {
             return "StereoscopicFreeCamera";
         }
-    }
+    }

+ 5 - 1
src/Cameras/Stereoscopic/stereoscopicGamepadCamera.ts

@@ -1,3 +1,7 @@
+import { GamepadCamera } from "Cameras";
+import { Scene } from "scene";
+import { Vector3 } from "Math";
+import {Node} from "Node";
     Node.AddNodeConstructor("StereoscopicGamepadCamera", (name, scene, options) => {
         return () => new StereoscopicGamepadCamera(name, Vector3.Zero(), options.interaxial_distance, options.isStereoscopicSideBySide, scene);
     });
@@ -29,4 +33,4 @@
         public getClassName(): string {
             return "StereoscopicGamepadCamera";
         }
-    }
+    }

+ 5 - 1
src/Cameras/Stereoscopic/stereoscopicUniversalCamera.ts

@@ -1,3 +1,7 @@
+import { UniversalCamera } from "Cameras";
+import { Scene } from "scene";
+import { Vector3 } from "Math";
+import {Node} from "Node";
     Node.AddNodeConstructor("StereoscopicFreeCamera", (name, scene, options) => {
         return () => new StereoscopicUniversalCamera(name, Vector3.Zero(), options.interaxial_distance, options.isStereoscopicSideBySide, scene);
     });
@@ -28,4 +32,4 @@
         public getClassName(): string {
             return "StereoscopicUniversalCamera";
         }
-    }
+    }

+ 3 - 2
src/Cameras/VR/vrCameraMetrics.ts

@@ -1,4 +1,5 @@
-    /**
+import { Matrix } from "Math";
+    /**
      * This represents all the required metrics to create a VR camera.
      * @see http://doc.babylonjs.com/babylon101/cameras#device-orientation-camera
      */
@@ -128,4 +129,4 @@
 
             return result;
         }
-    }
+    }

+ 4 - 0
src/Cameras/VR/vrDeviceOrientationArcRotateCamera.ts

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

+ 4 - 0
src/Cameras/VR/vrDeviceOrientationFreeCamera.ts

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

+ 4 - 0
src/Cameras/VR/vrDeviceOrientationGamepadCamera.ts

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

+ 19 - 5
src/Cameras/VR/vrExperienceHelper.ts

@@ -1,3 +1,17 @@
+import { Observer, Observable, Tools } from "Tools";
+import { Nullable } from "types";
+import { FreeCamera, DeviceOrientationCamera, Camera, VRDeviceOrientationFreeCamera, WebVROptions, WebVRFreeCamera, TargetCamera } from "Cameras";
+import { PointerEventTypes } from "Events";
+import { Scene, IDisposable } from "scene";
+import { Quaternion, Matrix, Vector3, Color3, Color4 } from "Math";
+import {Gamepad, WebVRController, PoseEnabledController, Xbox360Pad, Xbox360Button, StickValues, PoseEnabledControllerType} from "Gamepad"
+import { IDisplayChangedEventArgs } from "Engine";
+import { Mesh, AbstractMesh } from "Mesh";
+import { PickingInfo } from "Collisions";
+import { Ray } from "Culling";
+import { StandardMaterial, ImageProcessingConfiguration, DynamicTexture } from "Materials";
+import { ImageProcessingPostProcess } from "PostProcess";
+import { SineEase, EasingFunction, Animation } from "Animations";
     /**
      * Options to modify the vr teleportation behavior.
      */
@@ -122,7 +136,7 @@
         }
 
         /** @hidden */
-        public _updatePointerDistance(distance: number = 100) {
+        public _updatePointerDistance() {
         }
 
         public dispose() {
@@ -705,7 +719,7 @@
             document.addEventListener("keydown", this._onKeyDown);
 
             // Exiting VR mode double tapping the touch screen
-            this._scene.onPrePointerObservable.add((pointerInfo, eventState) => {
+            this._scene.onPrePointerObservable.add(() => {
                 if (this.isInVRMode) {
                     this.exitVR();
                     if (this._fullscreenVRpresenting) {
@@ -721,7 +735,7 @@
                 this._webVRrequesting = true;
                 this.updateButtonVisibility();
             };
-            this._onVRRequestPresentComplete = (success: boolean) => {
+            this._onVRRequestPresentComplete = () => {
                 this._webVRrequesting = false;
                 this.updateButtonVisibility();
             };
@@ -999,7 +1013,7 @@
                     return mesh.isVisible && (mesh.isPickable || mesh.name === this._floorMeshName);
                 };
 
-                this.meshSelectionPredicate = (mesh) => {
+                this.meshSelectionPredicate = () => {
                     return true;
                 };
 
@@ -1730,7 +1744,7 @@
                 }
 
                 // Changing the size of the laser pointer based on the distance from the targetted point
-                gazer._updatePointerDistance(hit.distance);
+                gazer._updatePointerDistance();
             }
             else {
                 gazer._updatePointerDistance();

+ 13 - 2
src/Cameras/VR/webVRCamera.ts

@@ -1,3 +1,14 @@
+import { Observer, Observable } from "Tools";
+import { Nullable } from "types";
+import { FreeCamera, Camera, WebVROptions, WebVRFreeCamera, TargetCamera } from "Cameras";
+import { Scene } from "scene";
+import { Quaternion, Matrix, Vector3 } from "Math";
+import {Gamepad, WebVRController, PoseEnabledControllerType} from "Gamepad"
+import { IDisplayChangedEventArgs } from "Engine";
+import {Node} from "Node";
+import { AbstractMesh } from "Mesh";
+import { Ray } from "Culling";
+import { HemisphericLight } from "Lights";
     Node.AddNodeConstructor("WebVRFreeCamera", (name, scene) => {
         return () => new WebVRFreeCamera(name, Vector3.Zero(), scene);
     });
@@ -310,7 +321,7 @@
          * 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 = (bool: boolean) => { }) {
+        public useStandingMatrix(callback = () => { }) {
             // Use standing matrix if available
             this.getEngine().initWebVRAsync().then((result) => {
                 if (!result.vrDisplay || !result.vrDisplay.stageParameters || !result.vrDisplay.stageParameters.sittingToStandingTransform  || !this.webVROptions.trackPosition) {
@@ -333,7 +344,7 @@
          * @returns A promise with a boolean set to if the standing matrix is supported.
          */
         public useStandingMatrixAsync(): Promise<boolean> {
-            return new Promise((res, rej) => {
+            return new Promise((res) => {
                 this.useStandingMatrix((supported) => {
                     res(supported);
                 });

+ 3 - 1
src/Cameras/XR/webXRCamera.ts

@@ -1,3 +1,5 @@
+import { FreeCamera, WebXRSessionManager } from "Cameras";
+
     /**
      * WebXR Camera which holds the views for the xrSession
      * @see https://doc.babylonjs.com/how_to/webxr
@@ -98,4 +100,4 @@
             });
             return true;
         }
-    }
+    }

+ 6 - 3
src/Cameras/XR/webXREnterExitUI.ts

@@ -1,3 +1,6 @@
+import { Nullable } from "types";
+import { WebXRExperienceHelper, WebXRState } from "Cameras";
+import { IDisposable } from "scene";
     /**
      * Button which can be used to enter a different mode of XR
      */
@@ -17,7 +20,7 @@
          * 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(activeButton: Nullable<WebXREnterExitUIButton>) {
+        update() {
         }
     }
 
@@ -126,7 +129,7 @@
         private _updateButtons(activeButton: Nullable<WebXREnterExitUIButton>) {
             this._activeButton = activeButton;
             this._buttons.forEach((b) => {
-                b.update(this._activeButton);
+                b.update();
             });
             this.activeButtonChangedObservable.notifyObservers(this._activeButton);
         }
@@ -141,4 +144,4 @@
             }
             this.activeButtonChangedObservable.clear();
         }
-    }
+    }

+ 7 - 1
src/Cameras/XR/webXRExperienceHelper.ts

@@ -1,3 +1,9 @@
+import { Observable } from "Tools";
+import { Nullable } from "types";
+import { Camera, WebXRSessionManager, WebXRCamera } from "Cameras";
+import { IDisposable } from "scene";
+import { Quaternion, Vector3 } from "Math";
+import { AbstractMesh } from "Mesh";
     /**
      * States of the webXR experience
      */
@@ -185,4 +191,4 @@
             this.onStateChangedObservable.clear();
             this._sessionManager.dispose();
         }
-    }
+    }

+ 5 - 1
src/Cameras/XR/webXRInput.ts

@@ -1,3 +1,7 @@
+import { Observer } from "Tools";
+import { Nullable } from "types";
+import { WebXRExperienceHelper } from "Cameras";
+import { IDisposable } from "scene";
     /**
      * Represents an XR input
      */
@@ -99,4 +103,4 @@
             });
             this.helper._sessionManager.onXRFrameObservable.remove(this._frameObserver);
         }
-    }
+    }

+ 4 - 1
src/Cameras/XR/webXRManagedOutputCanvas.ts

@@ -1,3 +1,6 @@
+import { Nullable } from "types";
+import { WebXRExperienceHelper, WebXRState } from "Cameras";
+import { IDisposable } from "scene";
     /**
      * Creates a canvas that is added/removed from the webpage when entering/exiting XR
      */
@@ -57,4 +60,4 @@
                 document.body.removeChild(this._canvas);
             }
         }
-    }
+    }

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

@@ -1,3 +1,8 @@
+import { Observable } from "Tools";
+import { Nullable } from "types";
+import { IDisposable } from "scene";
+import { Vector3 } from "Math";
+import { RenderTargetTexture } from "Materials";
     /**
      * Manages an XRSession
      * @see https://doc.babylonjs.com/how_to/webxr
@@ -112,7 +117,7 @@
          * @returns Promise which resolves with a collision point in the environment if it exists
          */
         public environmentPointHitTestAsync(ray: BABYLON.Ray): Promise<Nullable<Vector3>> {
-            return new Promise((res, rej) => {
+            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]);
                 var direction = new Float32Array([ray.direction.x, ray.direction.y, ray.direction.z]);
@@ -134,9 +139,9 @@
                     }else {
                         res(null);
                     }
-                }).catch((e: Error) => {
-                    res(null);
-                });
+                }).catch(() => {
+                        res(null);
+                    });
             });
         }
 
@@ -148,9 +153,9 @@
         public supportsSessionAsync(options: XRSessionCreationOptions) {
             return this._xrDevice.supportsSession(options).then(() => {
                 return true;
-            }).catch((e) => {
-                return false;
-            });
+            }).catch(() => {
+                    return false;
+                });
         }
 
         /**
@@ -180,4 +185,4 @@
             this.onXRFrameObservable.clear();
             this.onXRSessionEnded.clear();
         }
-    }
+    }

+ 8 - 0
src/Cameras/arcRotateCamera.ts

@@ -1,3 +1,11 @@
+import { serialize, Observable } 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 { Mesh, AbstractMesh } from "Mesh";
+import { BouncingBehavior, FramingBehavior, AutoRotationBehavior } from "Behaviors";
     Node.AddNodeConstructor("ArcRotateCamera", (name, scene) => {
         return () => new ArcRotateCamera(name, 0, 0, 1.0, Vector3.Zero(), scene);
     });

+ 2 - 0
src/Cameras/arcRotateCameraInputsManager.ts

@@ -1,3 +1,5 @@
+import { ArcRotateCamera, ArcRotateCameraPointersInput, ArcRotateCameraKeyboardMoveInput, ArcRotateCameraMouseWheelInput, CameraInputsManager, ArcRotateCameraVRDeviceOrientationInput } from "Cameras";
+
     /**
      * Default Inputs manager for the ArcRotateCamera.
      * It groups all the default supported inputs for ease of use.

+ 16 - 5
src/Cameras/camera.ts

@@ -1,3 +1,14 @@
+import { serialize, Observable, Tools, SmartArray, SerializationHelper } from "Tools";
+import { Nullable } from "types";
+import { FreeCamera, UniversalCamera, VRCameraMetrics, TargetCamera, CameraInputsManager } from "Cameras";
+import { Scene } from "scene";
+import { Matrix, Vector3, Viewport, Plane, Frustum } from "Math";
+import {Node} from "Node";
+import { Mesh, AbstractMesh } from "Mesh";
+import { Ray, ICullable } from "Culling";
+import { RenderTargetTexture } from "Materials";
+import { PostProcess, PassPostProcess, AnaglyphPostProcess, StereoscopicInterlacePostProcess, VRDistortionCorrectionPostProcess } from "PostProcess";
+import { Animation } from "Animations";
     /**
      * This is the base class of all the camera used in the application.
      * @see http://doc.babylonjs.com/features/cameras
@@ -465,14 +476,14 @@
          * @param element Defines the element the controls should be listened from
          * @param noPreventDefault Defines whether event caught by the controls should call preventdefault() (https://developer.mozilla.org/en-US/docs/Web/API/Event/preventDefault)
          */
-        public attachControl(element: HTMLElement, noPreventDefault?: boolean): void {
+        public attachControl(): void {
         }
 
         /**
          * Detach the current controls from the specified dom element.
          * @param element Defines the element to stop listening the inputs from
          */
-        public detachControl(element: HTMLElement): void {
+        public detachControl(): void {
         }
 
         /**
@@ -924,8 +935,8 @@
 
             // create the rig cameras, unless none
             if (this.cameraRigMode !== Camera.RIG_MODE_NONE) {
-                let leftCamera = this.createRigCamera(this.name + "_L", 0);
-                let rightCamera = this.createRigCamera(this.name + "_R", 1);
+                let leftCamera = this.createRigCamera();
+                let rightCamera = this.createRigCamera();
                 if (leftCamera && rightCamera) {
                     this._rigCameras.push(leftCamera);
                     this._rigCameras.push(rightCamera);
@@ -1057,7 +1068,7 @@
          * needs to be overridden by children so sub has required properties to be copied
          * @hidden
          */
-        public createRigCamera(name: string, cameraIndex: number): Nullable<Camera> {
+        public createRigCamera(): Nullable<Camera> {
             return null;
         }
 

+ 3 - 0
src/Cameras/cameraInputsManager.ts

@@ -1,3 +1,6 @@
+import { Tools, SerializationHelper } from "Tools";
+import { Nullable } from "types";
+import { ICameraInput, Camera } from "Cameras";
     /**
      * @ignore
      * This is a list of all the different input types that are available in the application.

+ 4 - 0
src/Cameras/deviceOrientationCamera.ts

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

+ 9 - 1
src/Cameras/flyCamera.ts

@@ -1,4 +1,12 @@
-    /**
+import { serialize } from "Tools";
+import { Nullable } from "types";
+import { TargetCamera, FlyCameraInputsManager, FlyCameraMouseInput, FlyCameraKeyboardInput } from "Cameras";
+import { Scene } from "scene";
+import { Vector3 } from "Math";
+import { Engine } from "Engine";
+import { AbstractMesh } from "Mesh";
+import { Collider } from "Collisions";
+    /**
      * This is a flying camera, designed for 3D movement and rotation in all directions,
      * such as in a 3D Space Shooter or a Flight Simulator.
      */

+ 2 - 1
src/Cameras/flyCameraInputsManager.ts

@@ -1,3 +1,4 @@
+import { FlyCamera, CameraInputsManager, FlyCameraMouseInput, FlyCameraKeyboardInput } from "Cameras";
     /**
      * Default Inputs manager for the FlyCamera.
      * It groups all the default supported inputs for ease of use.
@@ -30,4 +31,4 @@
             this.add(new FlyCameraMouseInput(touchEnabled));
             return this;
         }
-    }
+    }

+ 8 - 1
src/Cameras/followCamera.ts

@@ -1,3 +1,10 @@
+import { serialize, Tools } from "Tools";
+import { Nullable } from "types";
+import { TargetCamera } from "Cameras";
+import { Scene } from "scene";
+import { Matrix, Vector3 } from "Math";
+import {Node} from "Node";
+import { AbstractMesh } from "Mesh";
     Node.AddNodeConstructor("FollowCamera", (name, scene) => {
         return () => new FollowCamera(name, Vector3.Zero(), scene);
     });
@@ -65,7 +72,7 @@
 
         private _follow(cameraTarget: AbstractMesh) {
             if (!cameraTarget) {
-                return;
+                return;
             }
 
             var yRotation;

+ 2 - 1
src/Cameras/freeCameraInputsManager.ts

@@ -1,3 +1,4 @@
+import { FreeCamera, CameraInputsManager, FreeCameraKeyboardMoveInput, FreeCameraMouseInput, FreeCameraDeviceOrientationInput, FreeCameraTouchInput, FreeCameraVirtualJoystickInput } from "Cameras";
     /**
      * Default Inputs manager for the FreeCamera.
      * It groups all the default supported inputs for ease of use.
@@ -57,4 +58,4 @@
             this.add(new FreeCameraVirtualJoystickInput());
             return this;
         }
-    }
+    }

+ 5 - 1
src/Cameras/gamepadCamera.ts

@@ -1,3 +1,7 @@
+import { UniversalCamera } from "Cameras";
+import { Scene } from "scene";
+import { Vector3 } from "Math";
+import {Node} from "Node";
     Node.AddNodeConstructor("GamepadCamera", (name, scene) => {
         return () => new GamepadCamera(name, Vector3.Zero(), scene);
     });
@@ -28,4 +32,4 @@
         public getClassName(): string {
             return "GamepadCamera";
         }
-    }
+    }

+ 8 - 3
src/Cameras/targetCamera.ts

@@ -1,3 +1,8 @@
+import { serialize } from "Tools";
+import { Nullable } from "types";
+import { Camera } from "Cameras";
+import { Scene } from "scene";
+import { Quaternion, Matrix, Vector3, Vector2, Epsilon, Tmp } from "Math";
     /**
      * A target camera takes a mesh or position as a target and continues to look at it while it moves.
      * This is the base of the follow, arc rotate cameras and Free camera
@@ -177,7 +182,7 @@
 
             this._cache.rotation.copyFrom(this.rotation);
             if (this.rotationQuaternion) {
-                this._cache.rotationQuaternion.copyFrom(this.rotationQuaternion);
+                this._cache.rotationQuaternion.copyFrom(this.rotationQuaternion);
             }
         }
 
@@ -293,10 +298,10 @@
                     var limit = (Math.PI / 2) * 0.95;
 
                     if (this.rotation.x > limit) {
-                        this.rotation.x = limit;
+                        this.rotation.x = limit;
                     }
                     if (this.rotation.x < -limit) {
-                        this.rotation.x = -limit;
+                        this.rotation.x = -limit;
                     }
                 }
             }

+ 9 - 5
src/Cameras/touchCamera.ts

@@ -1,3 +1,7 @@
+import { FreeCamera, FreeCameraTouchInput, FreeCameraMouseInput } from "Cameras";
+import { Scene } from "scene";
+import { Vector3 } from "Math";
+import {Node} from "Node";
     Node.AddNodeConstructor("TouchCamera", (name, scene) => {
         return () => new TouchCamera(name, Vector3.Zero(), scene);
     });
@@ -15,7 +19,7 @@
         public get touchAngularSensibility(): number {
             var touch = <FreeCameraTouchInput>this.inputs.attached["touch"];
             if (touch) {
-                return touch.touchAngularSensibility;
+                return touch.touchAngularSensibility;
             }
 
             return 0;
@@ -24,7 +28,7 @@
         public set touchAngularSensibility(value: number) {
             var touch = <FreeCameraTouchInput>this.inputs.attached["touch"];
             if (touch) {
-                touch.touchAngularSensibility = value;
+                touch.touchAngularSensibility = value;
             }
         }
 
@@ -35,7 +39,7 @@
         public get touchMoveSensibility(): number {
             var touch = <FreeCameraTouchInput>this.inputs.attached["touch"];
             if (touch) {
-                return touch.touchMoveSensibility;
+                return touch.touchMoveSensibility;
             }
 
             return 0;
@@ -44,7 +48,7 @@
         public set touchMoveSensibility(value: number) {
             var touch = <FreeCameraTouchInput>this.inputs.attached["touch"];
             if (touch) {
-                touch.touchMoveSensibility = value;
+                touch.touchMoveSensibility = value;
             }
         }
 
@@ -79,4 +83,4 @@
                 mouse.touchEnabled = false;
             }
         }
-    }
+    }

+ 8 - 5
src/Cameras/universalCamera.ts

@@ -1,3 +1,6 @@
+import { UniversalCamera, TouchCamera, FreeCameraGamepadInput } from "Cameras";
+import { Scene } from "scene";
+import { Vector3 } from "Math";
     /**
      * The Universal Camera is the one to choose for first person shooter type games, and works with all the keyboard, mouse, touch and gamepads. This replaces the earlier Free Camera,
      * which still works and will still be found in many Playgrounds.
@@ -11,7 +14,7 @@
         public get gamepadAngularSensibility(): number {
             var gamepad = <FreeCameraGamepadInput>this.inputs.attached["gamepad"];
             if (gamepad) {
-                return gamepad.gamepadAngularSensibility;
+                return gamepad.gamepadAngularSensibility;
             }
 
             return 0;
@@ -20,7 +23,7 @@
         public set gamepadAngularSensibility(value: number) {
             var gamepad = <FreeCameraGamepadInput>this.inputs.attached["gamepad"];
             if (gamepad) {
-                gamepad.gamepadAngularSensibility = value;
+                gamepad.gamepadAngularSensibility = value;
             }
         }
 
@@ -31,7 +34,7 @@
         public get gamepadMoveSensibility(): number {
             var gamepad = <FreeCameraGamepadInput>this.inputs.attached["gamepad"];
             if (gamepad) {
-                return gamepad.gamepadMoveSensibility;
+                return gamepad.gamepadMoveSensibility;
             }
 
             return 0;
@@ -40,7 +43,7 @@
         public set gamepadMoveSensibility(value: number) {
             var gamepad = <FreeCameraGamepadInput>this.inputs.attached["gamepad"];
             if (gamepad) {
-                gamepad.gamepadMoveSensibility = value;
+                gamepad.gamepadMoveSensibility = value;
             }
         }
 
@@ -64,4 +67,4 @@
         public getClassName(): string {
             return "UniversalCamera";
         }
-    }
+    }

+ 5 - 1
src/Cameras/virtualJoysticksCamera.ts

@@ -1,3 +1,7 @@
+import { FreeCamera } from "Cameras";
+import { Scene } from "scene";
+import { Vector3 } from "Math";
+import {Node} from "Node";
     Node.AddNodeConstructor("VirtualJoysticksCamera", (name, scene) => {
         return () => new VirtualJoysticksCamera(name, Vector3.Zero(), scene);
     });
@@ -31,4 +35,4 @@
         public getClassName(): string {
             return "VirtualJoysticksCamera";
         }
-    }
+    }

+ 19 - 16
src/Collisions/collider.ts

@@ -1,26 +1,29 @@
+import { Nullable } from "types";
+import { Vector3, Plane } from "Math";
+import { AbstractMesh } from "Mesh";
     var intersectBoxAASphere = (boxMin: Vector3, boxMax: Vector3, sphereCenter: Vector3, sphereRadius: number): boolean => {
         if (boxMin.x > sphereCenter.x + sphereRadius) {
-            return false;
+            return false;
         }
 
         if (sphereCenter.x - sphereRadius > boxMax.x) {
-            return false;
+            return false;
         }
 
         if (boxMin.y > sphereCenter.y + sphereRadius) {
-            return false;
+            return false;
         }
 
         if (sphereCenter.y - sphereRadius > boxMax.y) {
-            return false;
+            return false;
         }
 
         if (boxMin.z > sphereCenter.z + sphereRadius) {
-            return false;
+            return false;
         }
 
         if (sphereCenter.z - sphereRadius > boxMax.z) {
-            return false;
+            return false;
         }
 
         return true;
@@ -33,7 +36,7 @@
                 result.root = 0; result.found = false;
                 var determinant = b * b - 4.0 * a * c;
                 if (determinant < 0) {
-                    return result;
+                    return result;
                 }
 
                 var sqrtD = Math.sqrt(determinant);
@@ -150,14 +153,14 @@
             Vector3.CrossToRef(this._tempVector, this._tempVector2, this._tempVector4);
             var d = Vector3.Dot(this._tempVector4, n);
             if (d < 0) {
-                return false;
+                return false;
             }
 
             pc.subtractToRef(point, this._tempVector3);
             Vector3.CrossToRef(this._tempVector2, this._tempVector3, this._tempVector4);
             d = Vector3.Dot(this._tempVector4, n);
             if (d < 0) {
-                return false;
+                return false;
             }
 
             Vector3.CrossToRef(this._tempVector3, this._tempVector, this._tempVector4);
@@ -176,7 +179,7 @@
             }
 
             if (!intersectBoxAASphere(vecMin, vecMax, this._basePointWorld, this._velocityWorldLength + max)) {
-                return false;
+                return false;
             }
 
             return true;
@@ -200,7 +203,7 @@
             var trianglePlane = trianglePlaneArray[faceIndex];
 
             if ((!hasMaterial) && !trianglePlane.isFrontFacingTo(this._normalizedVelocity, 0)) {
-                return;
+                return;
             }
 
             var signedDistToTrianglePlane = trianglePlane.signedDistanceTo(this._basePoint);
@@ -208,7 +211,7 @@
 
             if (normalDotVelocity == 0) {
                 if (Math.abs(signedDistToTrianglePlane) >= 1.0) {
-                    return;
+                    return;
                 }
                 embeddedInPlane = true;
                 t0 = 0;
@@ -224,14 +227,14 @@
                 }
 
                 if (t0 > 1.0 || t1 < 0.0) {
-                    return;
+                    return;
                 }
 
                 if (t0 < 0) {
-                    t0 = 0;
+                    t0 = 0;
                 }
                 if (t0 > 1.0) {
-                    t0 = 1.0;
+                    t0 = 1.0;
                 }
             }
 
@@ -400,4 +403,4 @@
 
             this._destinationPoint.subtractToRef(this.intersectionPoint, vel);
         }
-    }
+    }

+ 7 - 0
src/Collisions/collisionCoordinator.ts

@@ -1,3 +1,10 @@
+import { Tools } from "Tools";
+import { Nullable } from "types";
+import { Scene } from "scene";
+import { Vector3 } from "Math";
+import { Engine } from "Engine";
+import { Mesh, AbstractMesh, Geometry, InstancedMesh, VertexBuffer, TransformNode } from "Mesh";
+import { Collider, WorkerIncluded } from "Collisions";
     //WebWorker code will be inserted to this variable.
     /** @hidden */
     export var CollisionWorker = "";

+ 6 - 2
src/Collisions/collisionWorker.ts

@@ -1,3 +1,7 @@
+import { Nullable } from "types";
+import { Matrix, Vector3 } from "Math";
+import { Collider, SerializedMesh, SerializedGeometry, SerializedSubMesh, InitPayload, UpdatePayload, CollidePayload, WorkerReply, WorkerReplyType, WorkerTaskType, CollisionReplyPayload, BabylonMessage } from "Collisions";
+
 declare function importScripts(...urls: string[]): void;
 
 // since typescript doesn't understand the file's execution context, we need to override postMessage's signature for error-free compilation
@@ -77,7 +81,7 @@ const safePostMessage: any = self.postMessage;
                 if (parseInt(uniqueId) != excludedMeshUniqueId) {
                     var mesh: SerializedMesh = (<any>meshes)[uniqueId];
                     if (mesh.checkCollisions) {
-                        this.checkCollision(mesh);
+                        this.checkCollision(mesh);
                     }
                 }
             }
@@ -144,7 +148,7 @@ const safePostMessage: any = self.postMessage;
 
                 // Bounding test
                 if (len > 1 && !this.checkSubmeshCollision(subMesh)) {
-                    continue;
+                    continue;
                 }
 
                 this.collideForSubMesh(subMesh, transformMatrix, meshGeometry);

+ 4 - 0
src/Collisions/pickingInfo.ts

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

+ 5 - 1
src/Culling/Octrees/octree.ts

@@ -1,3 +1,7 @@
+import { SmartArray, SmartArrayNoDuplicate } from "Tools";
+import { Vector3, Plane } from "Math";
+import { AbstractMesh, SubMesh } from "Mesh";
+import { Ray, OctreeBlock } from "Culling";
     /**
      * Contains an array of blocks representing the octree
      */
@@ -173,4 +177,4 @@
                 block.entries.push(entry);
             }
         }
-    }
+    }

+ 4 - 1
src/Culling/Octrees/octreeBlock.ts

@@ -1,3 +1,6 @@
+import { SmartArrayNoDuplicate } from "Tools";
+import { Vector3, Plane } from "Math";
+import { Ray, BoundingBox, Octree } from "Culling";
     /**
      * Class used to store a cell in an octree
      * @see http://doc.babylonjs.com/how_to/optimizing_your_scene_with_octrees
@@ -190,4 +193,4 @@
         public createInnerBlocks(): void {
             Octree._CreateBlocks(this._minPoint, this._maxPoint, this.entries, this._capacity, this._depth, this._maxDepth, this, this._creationFunc);
         }
-    }
+    }

+ 7 - 0
src/Culling/Octrees/octreeSceneComponent.ts

@@ -1,3 +1,10 @@
+import { ISmartArrayLike } from "Tools";
+import { Scene } from "scene";
+import { Vector3 } from "Math";
+import { AbstractMesh, SubMesh } from "Mesh";
+import { Collider } from "Collisions";
+import { Ray, Octree } from "Culling";
+import { SceneComponentConstants } from "sceneComponent";
     export interface Scene {
         /**
          * @hidden

+ 4 - 1
src/Culling/boundingBox.ts

@@ -1,3 +1,6 @@
+import { Tools } from "Tools";
+import { Matrix, Vector3, Plane, Epsilon } from "Math";
+import { ICullable, BoundingSphere } from "Culling";
     /**
      * Class used to store bounding box information
      */
@@ -313,4 +316,4 @@
             }
             return true;
         }
-    }
+    }

+ 6 - 1
src/Culling/boundingInfo.ts

@@ -1,3 +1,8 @@
+import { Tools } from "Tools";
+import { Matrix, Vector3, Plane } from "Math";
+import { AbstractMesh } from "Mesh";
+import { Collider } from "Collisions";
+import { ICullable, BoundingBox, BoundingSphere } from "Culling";
     const _result0 = { min: 0, max: 0};
     const _result1 = { min: 0, max: 0};
     const computeBoxExtents = (axis: Readonly<Vector3>, box: Readonly<BoundingBox>, result: {min: number, max: number}) => {
@@ -247,4 +252,4 @@
 
             return true;
         }
-    }
+    }

+ 3 - 1
src/Culling/boundingSphere.ts

@@ -1,3 +1,5 @@
+import { Tools } from "Tools";
+import { Matrix, Vector3, Plane } from "Math";
     /**
      * Class used to store bounding sphere information
      */
@@ -144,4 +146,4 @@
 
             return true;
         }
-    }
+    }

+ 7 - 1
src/Culling/ray.ts

@@ -1,3 +1,9 @@
+import { Tools } from "Tools";
+import { Nullable } from "types";
+import { Matrix, Vector3, Plane, Tmp } from "Math";
+import { AbstractMesh } from "Mesh";
+import { PickingInfo, IntersectionInfo } from "Collisions";
+import { BoundingBox, BoundingSphere } from "Culling";
     /**
      * Class representing a ray with position and direction
      */
@@ -489,4 +495,4 @@
                 result.length *= len;
             }
         }
-    }
+    }

+ 5 - 1
src/Engine/Extensions/engine.occlusionQuery.ts

@@ -1,3 +1,7 @@
+import { Nullable, int } from "types";
+import { Engine } from "Engine";
+import { AbstractMesh } from "Mesh";
+import { _TimeToken } from "Instrumentation";
     /** @hidden */
     class _OcclusionDataStorage {
         /** @hidden */
@@ -445,4 +449,4 @@
         }
 
         return dataStorage.isOccluded;
-    };
+    };

+ 4 - 1
src/Engine/Extensions/engine.transformFeedback.ts

@@ -1,3 +1,6 @@
+import { Nullable } from "types";
+import { Engine } from "Engine";
+import { _TimeToken } from "Instrumentation";
     export interface Engine {
         /**
          * Creates a webGL transform feedback object
@@ -69,4 +72,4 @@
 
     Engine.prototype.bindTransformFeedbackBuffer = function(value: Nullable<WebGLBuffer>): void {
         this._gl.bindBufferBase(this._gl.TRANSFORM_FEEDBACK_BUFFER, 0, value);
-    };
+    };

+ 21 - 14
src/Engine/engine.ts

@@ -1,3 +1,17 @@
+import { Observer, Observable, Tools, ICustomAnimationFrameRequester, PerfCounter, PerformanceMonitor, StringDictionary, IFileRequest, PromisePolyfill, DDSTools, DDSInfo } from "Tools";
+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 { IDisplayChangedEventArgs } from "Engine";
+import { VertexBuffer } from "Mesh";
+import { RenderTargetTexture, Material, IInternalTextureLoader, Texture, UniformBuffer, InternalTexture, Effect, DummyInternalTextureTracker, IMultiRenderTargetOptions, BaseTexture, IInternalTextureTracker, VideoTexture } from "Materials";
+import { PostProcess, PassPostProcess } from "PostProcess";
+import { _TimeToken } from "Instrumentation";
+import { IAudioEngine } from "Audio";
+import { IOfflineProvider } from "Offline";
+import { ILoadingScreen, DefaultLoadingScreen } from "Loading";
+import { _DepthCullingState, _StencilState, _AlphaState } from "States";
     /**
      * Keeps track of all the buffer info used in engine.
      */
@@ -1110,28 +1124,21 @@
                         this.onContextLostObservable.notifyObservers(this);
                     };
 
-                    this._onContextRestored = (evt: Event) => {
+                    this._onContextRestored = () => {
                         // Adding a timeout to avoid race condition at browser level
                         setTimeout(() => {
                             // Rebuild gl context
                             this._initGLContext();
-
                             // Rebuild effects
                             this._rebuildEffects();
-
                             // Rebuild textures
                             this._rebuildInternalTextures();
-
                             // Rebuild buffers
                             this._rebuildBuffers();
-
                             // Cache
                             this.wipeCaches(true);
-
                             Tools.Warn("WebGL context successfully restored.");
-
                             this.onContextRestoredObservable.notifyObservers(this);
-
                             this._contextWasLost = false;
                         }, 0);
                     };
@@ -2241,7 +2248,7 @@
         }
 
         private _getVRDisplaysAsync(): Promise<IDisplayChangedEventArgs> {
-            return new Promise((res, rej) => {
+            return new Promise((res) => {
                 if (navigator.getVRDisplays) {
                     navigator.getVRDisplays().then((devices: Array<any>) => {
                         this._vrSupported = true;
@@ -2613,7 +2620,7 @@
          * @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, offset: number = 0): void {
+        public updateDynamicIndexBuffer(indexBuffer: WebGLBuffer, indices: IndicesArray): void {
             // Force cache update
             this._currentBoundBuffer[this._gl.ELEMENT_ARRAY_BUFFER] = null;
             this.bindIndexBuffer(indexBuffer);
@@ -4192,7 +4199,7 @@
             }
         }
 
-        private _cascadeLoadImgs(rootUrl: string, scene: Nullable<Scene>,
+        private _cascadeLoadImgs(scene: Nullable<Scene>,
             onfinish: (images: HTMLImageElement[]) => void, files: string[], onError: Nullable<(message?: string, exception?: any) => void> = null) {
 
             var loadedImages: HTMLImageElement[] = [];
@@ -5727,7 +5734,7 @@
                     throw new Error("Cannot load cubemap because files were not defined");
                 }
 
-                this._cascadeLoadImgs(rootUrl, scene, (imgs) => {
+                this._cascadeLoadImgs(scene, (imgs) => {
                     var width = this.needPOTTextures ? Tools.GetExponentOfTwo(imgs[0].width, this._caps.maxCubemapTextureSize) : imgs[0].width;
                     var height = width;
 
@@ -7498,7 +7505,7 @@
             });
         }
 
-        private _partialLoadFile(url: string, index: number, loadedFiles: (string | ArrayBuffer)[], scene: Nullable<Scene>, onfinish: (files: (string | ArrayBuffer)[]) => void, onErrorCallBack: Nullable<(message?: string, exception?: any) => void> = null): void {
+        private _partialLoadFile(url: string, index: number, loadedFiles: (string | ArrayBuffer)[], onfinish: (files: (string | ArrayBuffer)[]) => void, onErrorCallBack: Nullable<(message?: string, exception?: any) => void> = null): void {
             var onload = (data: string | ArrayBuffer) => {
                 loadedFiles[index] = data;
                 (<any>loadedFiles)._internalCount++;
@@ -7522,7 +7529,7 @@
             (<any>loadedFiles)._internalCount = 0;
 
             for (let index = 0; index < 6; index++) {
-                this._partialLoadFile(files[index], index, loadedFiles, scene, onfinish, onError);
+                this._partialLoadFile(files[index], index, loadedFiles, onfinish, onError);
             }
         }
 

+ 9 - 0
src/Engine/nullEngine.ts

@@ -1,3 +1,12 @@
+import { Tools } from "Tools";
+import { Nullable, FloatArray, IndicesArray } from "types";
+import { Scene } from "scene";
+import { Matrix, Color3, Color4, Viewport } from "Math";
+import { Engine, EngineCapabilities, RenderTargetCreationOptions } from "Engine";
+import { VertexBuffer } from "Mesh";
+import { Texture, InternalTexture, Effect } from "Materials";
+import { _TimeToken } from "Instrumentation";
+import { _DepthCullingState, _StencilState, _AlphaState } from "States";
     /**
      * Options to create the null engine
      */

+ 7 - 1
src/Events/pointerEvents.ts

@@ -1,3 +1,9 @@
+import { Nullable } from "types";
+import { Vector2 } from "Math";
+import { PickingInfo } from "Collisions";
+import { Ray } from "Culling";
+import { _TimeToken } from "Instrumentation";
+import { _DepthCullingState, _StencilState, _AlphaState } from "States";
     /**
      * Gather the list of pointer event types as constants.
      */
@@ -106,4 +112,4 @@
             public pickInfo: Nullable<PickingInfo>) {
             super(type, event);
         }
-    }
+    }

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

@@ -1,3 +1,10 @@
+import { Tools } from "Tools";
+import { Scene } from "scene";
+import {WebVRController, PoseEnabledControllerType, ExtendedGamepadButton, GamepadButtonChanges} from "Gamepad"
+import { AbstractMesh } from "Mesh";
+import { _TimeToken } from "Instrumentation";
+import { SceneLoader } from "Loading";
+import { _DepthCullingState, _StencilState, _AlphaState } from "States";
     /**
      * Google Daydream controller
      */
@@ -60,4 +67,4 @@
                 Tools.Warn(`Unrecognized Daydream button index: ${buttonIdx}`);
             }
         }
-    }
+    }

+ 8 - 1
src/Gamepad/Controllers/gearVRController.ts

@@ -1,3 +1,10 @@
+import { Scene } from "scene";
+import { Vector3 } from "Math";
+import {WebVRController, PoseEnabledControllerType, ExtendedGamepadButton, GamepadButtonChanges} from "Gamepad"
+import { AbstractMesh } from "Mesh";
+import { _TimeToken } from "Instrumentation";
+import { SceneLoader } from "Loading";
+import { _DepthCullingState, _StencilState, _AlphaState } from "States";
     /**
      * Gear VR Controller
      */
@@ -69,4 +76,4 @@
                 }
             }
         }
-    }
+    }

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

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

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

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

+ 10 - 0
src/Gamepad/Controllers/poseEnabledController.ts

@@ -1,3 +1,13 @@
+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 { AbstractMesh } from "Mesh";
+import { Ray } from "Culling";
+import { _TimeToken } from "Instrumentation";
+import { _DepthCullingState, _StencilState, _AlphaState } from "States";
     /**
     * Defines the types of pose enabled controllers that are supported
     */

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

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

+ 0 - 0
src/Gamepad/Controllers/webVRController.ts


Algúns arquivos non se mostraron porque demasiados arquivos cambiaron neste cambio