Ver código fonte

Merge branch 'master' of https://github.com/BabylonJS/Babylon.js

David Catuhe 7 anos atrás
pai
commit
d6d061d523
26 arquivos alterados com 801 adições e 146 exclusões
  1. 20 75
      src/Actions/babylon.actionManager.ts
  2. 260 7
      src/Actions/babylon.directActions.ts
  3. 60 3
      src/Actions/babylon.interpolateValueAction.ts
  4. 25 0
      src/Audio/babylon.sound.ts
  5. 14 0
      src/Behaviors/Cameras/babylon.bouncingBehavior.ts
  6. 17 0
      src/Behaviors/Cameras/babylon.framingBehavior.ts
  7. 2 2
      src/Cameras/Inputs/babylon.arcRotateCameraKeyboardMoveInput.ts
  8. 34 5
      src/Cameras/Inputs/babylon.freeCameraDeviceOrientationInput.ts
  9. 49 10
      src/Cameras/Inputs/babylon.freeCameraGamepadInput.ts
  10. 53 12
      src/Cameras/Inputs/babylon.freeCameraKeyboardMoveInput.ts
  11. 46 8
      src/Cameras/Inputs/babylon.freeCameraMouseInput.ts
  12. 48 12
      src/Cameras/Inputs/babylon.freeCameraTouchInput.ts
  13. 44 8
      src/Cameras/Inputs/babylon.freeCameraVirtualJoystickInput.ts
  14. 2 1
      src/Cameras/Stereoscopic/babylon.anaglyphArcRotateCamera.ts
  15. 1 0
      src/Cameras/Stereoscopic/babylon.anaglyphFreeCamera.ts
  16. 1 0
      src/Cameras/Stereoscopic/babylon.anaglyphGamepadCamera.ts
  17. 1 0
      src/Cameras/Stereoscopic/babylon.anaglyphUniversalCamera.ts
  18. 2 1
      src/Cameras/Stereoscopic/babylon.stereoscopicArcRotateCamera.ts
  19. 1 0
      src/Cameras/Stereoscopic/babylon.stereoscopicFreeCamera.ts
  20. 1 0
      src/Cameras/Stereoscopic/babylon.stereoscopicGamepadCamera.ts
  21. 1 0
      src/Cameras/Stereoscopic/babylon.stereoscopicUniversalCamera.ts
  22. 67 0
      src/Cameras/VR/babylon.vrCameraMetrics.ts
  23. 19 0
      src/Cameras/VR/babylon.vrDeviceOrientationArcRotateCamera.ts
  24. 16 1
      src/Cameras/VR/babylon.vrDeviceOrientationFreeCamera.ts
  25. 16 0
      src/Cameras/VR/babylon.vrDeviceOrientationGamepadCamera.ts
  26. 1 1
      src/Cameras/babylon.camera.ts

+ 20 - 75
src/Actions/babylon.actionManager.ts

@@ -82,161 +82,106 @@
      * @see http://doc.babylonjs.com/how_to/how_to_use_actions
      */
     export class ActionManager {
-        // Statics
-        private static _NothingTrigger = 0;
-        private static _OnPickTrigger = 1;
-        private static _OnLeftPickTrigger = 2;
-        private static _OnRightPickTrigger = 3;
-        private static _OnCenterPickTrigger = 4;
-        private static _OnPickDownTrigger = 5;
-        private static _OnDoublePickTrigger = 6;
-        private static _OnPickUpTrigger = 7;
-        private static _OnLongPressTrigger = 8;
-        private static _OnPointerOverTrigger = 9;
-        private static _OnPointerOutTrigger = 10;
-        private static _OnEveryFrameTrigger = 11;
-        private static _OnIntersectionEnterTrigger = 12;
-        private static _OnIntersectionExitTrigger = 13;
-        private static _OnKeyDownTrigger = 14;
-        private static _OnKeyUpTrigger = 15;
-        private static _OnPickOutTrigger = 16;
-
         /**
          * Nothing
          * @see http://doc.babylonjs.com/how_to/how_to_use_actions#triggers
          */
-        public static get NothingTrigger(): number {
-            return ActionManager._NothingTrigger;
-        }
+        public static readonly NothingTrigger = 0;
 
         /** 
          * On pick 
          * @see http://doc.babylonjs.com/how_to/how_to_use_actions#triggers
          */
-        public static get OnPickTrigger(): number {
-            return ActionManager._OnPickTrigger;
-        }
+        public static readonly OnPickTrigger = 1;
 
         /** 
          * On left pick
          * @see http://doc.babylonjs.com/how_to/how_to_use_actions#triggers
          */
-        public static get OnLeftPickTrigger(): number {
-            return ActionManager._OnLeftPickTrigger;
-        }
+        public static readonly OnLeftPickTrigger  = 2;
 
         /** 
          * On right pick
          * @see http://doc.babylonjs.com/how_to/how_to_use_actions#triggers
          */
-        public static get OnRightPickTrigger(): number {
-            return ActionManager._OnRightPickTrigger;
-        }
+        public static readonly OnRightPickTrigger = 3;
 
         /** 
          * On center pick 
          * @see http://doc.babylonjs.com/how_to/how_to_use_actions#triggers
          */
-        public static get OnCenterPickTrigger(): number {
-            return ActionManager._OnCenterPickTrigger;
-        }
+        public static readonly OnCenterPickTrigger = 4;
 
         /** 
          * On pick down
          * @see http://doc.babylonjs.com/how_to/how_to_use_actions#triggers
          */
-        public static get OnPickDownTrigger(): number {
-            return ActionManager._OnPickDownTrigger;
-        }
+        public static readonly OnPickDownTrigger = 5;
 
         /** 
          * On double pick
          * @see http://doc.babylonjs.com/how_to/how_to_use_actions#triggers
          */
-        public static get OnDoublePickTrigger(): number {
-            return ActionManager._OnDoublePickTrigger;
-        }
+        public static readonly OnDoublePickTrigger = 6;
 
         /** 
          * On pick up
          * @see http://doc.babylonjs.com/how_to/how_to_use_actions#triggers
          */
-        public static get OnPickUpTrigger(): number {
-            return ActionManager._OnPickUpTrigger;
-        }
-
+        public static readonly OnPickUpTrigger = 7;
         /**
          * On pick out.
          * This trigger will only be raised if you also declared a OnPickDown
          * @see http://doc.babylonjs.com/how_to/how_to_use_actions#triggers
          */
-        public static get OnPickOutTrigger(): number {
-            return ActionManager._OnPickOutTrigger;
-        }
+        public static readonly OnPickOutTrigger = 16;
 
         /** 
          * On long press
          * @see http://doc.babylonjs.com/how_to/how_to_use_actions#triggers
          */
-        public static get OnLongPressTrigger(): number {
-            return ActionManager._OnLongPressTrigger;
-        }
+        public static readonly OnLongPressTrigger = 8;
 
         /** 
          * On pointer over
          * @see http://doc.babylonjs.com/how_to/how_to_use_actions#triggers
          */
-        public static get OnPointerOverTrigger(): number {
-            return ActionManager._OnPointerOverTrigger;
-        }
+        public static readonly OnPointerOverTrigger = 9;
 
         /** 
          * On pointer out
          * @see http://doc.babylonjs.com/how_to/how_to_use_actions#triggers
          */
-        public static get OnPointerOutTrigger(): number {
-            return ActionManager._OnPointerOutTrigger;
-        }
+        public static readonly OnPointerOutTrigger = 10;
 
         /** 
          * On every frame
          * @see http://doc.babylonjs.com/how_to/how_to_use_actions#triggers
          */
-        public static get OnEveryFrameTrigger(): number {
-            return ActionManager._OnEveryFrameTrigger;
-        }
-
+        public static readonly OnEveryFrameTrigger = 11;
         /** 
          * On intersection enter
          * @see http://doc.babylonjs.com/how_to/how_to_use_actions#triggers
          */
-        public static get OnIntersectionEnterTrigger(): number {
-            return ActionManager._OnIntersectionEnterTrigger;
-        }
+        public static readonly OnIntersectionEnterTrigger = 12;
 
         /** 
          * On intersection exit
          * @see http://doc.babylonjs.com/how_to/how_to_use_actions#triggers
          */
-        public static get OnIntersectionExitTrigger(): number {
-            return ActionManager._OnIntersectionExitTrigger;
-        }
+        public static readonly OnIntersectionExitTrigger = 13;
 
         /**
          * On key down
          * @see http://doc.babylonjs.com/how_to/how_to_use_actions#triggers
          */
-        public static get OnKeyDownTrigger(): number {
-            return ActionManager._OnKeyDownTrigger;
-        }
+        public static readonly OnKeyDownTrigger = 14;
 
         /**
          * On key up
          * @see http://doc.babylonjs.com/how_to/how_to_use_actions#triggers
          */
-        public static get OnKeyUpTrigger(): number {
-            return ActionManager._OnKeyUpTrigger;
-        }
+        public static readonly OnKeyUpTrigger = 15;
 
         /** Gets the list of active triggers */
         public static Triggers: { [key: string]: number } = {};
@@ -356,7 +301,7 @@
             for (var index = 0; index < this.actions.length; index++) {
                 var action = this.actions[index];
 
-                if (action.trigger >= ActionManager._OnPickTrigger && action.trigger <= ActionManager._OnPointerOutTrigger) {
+                if (action.trigger >= ActionManager.OnPickTrigger && action.trigger <= ActionManager.OnPointerOutTrigger) {
                     return true;
                 }
             }
@@ -371,7 +316,7 @@
             for (var index = 0; index < this.actions.length; index++) {
                 var action = this.actions[index];
 
-                if (action.trigger >= ActionManager._OnPickTrigger && action.trigger <= ActionManager._OnPickUpTrigger) {
+                if (action.trigger >= ActionManager.OnPickTrigger && action.trigger <= ActionManager.OnPickUpTrigger) {
                     return true;
                 }
             }
@@ -398,7 +343,7 @@
             for (var t in ActionManager.Triggers) {
                 if (ActionManager.Triggers.hasOwnProperty(t)) {
                     let t_int = parseInt(t);
-                    if (t_int >= ActionManager._OnPickTrigger && t_int <= ActionManager._OnPickUpTrigger) {
+                    if (t_int >= ActionManager.OnPickTrigger && t_int <= ActionManager.OnPickUpTrigger) {
                         return true;
                     }
                 }

+ 260 - 7
src/Actions/babylon.directActions.ts

@@ -1,11 +1,28 @@
 module BABYLON {
+    /**
+     * This defines an action responsible to toggle a boolean once triggered.
+     * @see http://doc.babylonjs.com/how_to/how_to_use_actions
+     */
     export class SwitchBooleanAction extends Action {
+        /**
+         * The path to the boolean property in the target object
+         */
+        public propertyPath: string;
+
         private _target: any;
         private _effectiveTarget: any;
         private _property: string;
 
-        constructor(triggerOptions: any, target: any, public propertyPath: string, condition?: Condition) {
+        /**
+         * Instantiate the action
+         * @param triggerOptions defines the trigger options
+         * @param target defines the object containing the boolean
+         * @param propertyPath defines the path to the boolean property in the target object
+         * @param condition defines the trigger related conditions
+         */
+        constructor(triggerOptions: any, target: any, propertyPath: string, condition?: Condition) {
             super(triggerOptions, condition);
+            this.propertyPath = propertyPath;
             this._target = this._effectiveTarget = target;
         }
 
@@ -15,10 +32,18 @@
             this._property = this._getProperty(this.propertyPath);
         }
 
+        /**
+         * Execute the action toggle the boolean value.
+         */
         public execute(): void {
             this._effectiveTarget[this._property] = !this._effectiveTarget[this._property];
         }
 
+        /**
+         * Serializes the actions and its related information.
+         * @param parent defines the object to serialize in
+         * @returns the serialized object
+         */
         public serialize(parent: any): any {
             return super._serialize({
                 name: "SwitchBooleanAction",
@@ -30,18 +55,44 @@
         }
     }
 
+    /**
+     * This defines an action responsible to set a the state field of the target
+     *  to a desired value once triggered.
+     * @see http://doc.babylonjs.com/how_to/how_to_use_actions
+     */
     export class SetStateAction extends Action {
+        /**
+         * The value to store in the state field.
+         */
+        public value: string;
+
         private _target: any;
 
-        constructor(triggerOptions: any, target: any, public value: string, condition?: Condition) {
+        /**
+         * Instantiate the action
+         * @param triggerOptions defines the trigger options
+         * @param target defines the object containing the state property
+         * @param value defines the value to store in the state field
+         * @param condition defines the trigger related conditions
+         */
+        constructor(triggerOptions: any, target: any, value: string, condition?: Condition) {
             super(triggerOptions, condition);
+            this.value = value;
             this._target = target;
         }
 
+        /**
+         * Execute the action and store the value on the target state property.
+         */
         public execute(): void {
             this._target.state = this.value;
         }
 
+        /**
+         * Serializes the actions and its related information.
+         * @param parent defines the object to serialize in
+         * @returns the serialized object
+         */
         public serialize(parent: any): any {
             return super._serialize({
                 name: "SetStateAction",
@@ -53,13 +104,38 @@
         }
     }
 
+    /**
+     * This defines an action responsible to set a property of the target
+     *  to a desired value once triggered.
+     * @see http://doc.babylonjs.com/how_to/how_to_use_actions
+     */
     export class SetValueAction extends Action {
+        /**
+         * The path of the property to set in the target.
+         */
+        public propertyPath: string;
+
+        /**
+         * The value to set in the property
+         */
+        public value: any;
+
         private _target: any;
         private _effectiveTarget: any;
         private _property: string;
 
-        constructor(triggerOptions: any, target: any, public propertyPath: string, public value: any, condition?: Condition) {
+        /**
+         * Instantiate the action
+         * @param triggerOptions defines the trigger options
+         * @param target defines the object containing the property
+         * @param propertyPath defines the path of the property to set in the target
+         * @param value defines the value to set in the property
+         * @param condition defines the trigger related conditions
+         */
+        constructor(triggerOptions: any, target: any, propertyPath: string, value: any, condition?: Condition) {
             super(triggerOptions, condition);
+            this.propertyPath = propertyPath;
+            this.value = value;
             this._target = this._effectiveTarget = target;
         }
 
@@ -69,6 +145,9 @@
             this._property = this._getProperty(this.propertyPath);
         }
 
+        /**
+         * Execute the action and set the targetted property to the desired value.
+         */
         public execute(): void {
             this._effectiveTarget[this._property] = this.value;
 
@@ -77,6 +156,11 @@
             }
         }
 
+        /**
+         * Serializes the actions and its related information.
+         * @param parent defines the object to serialize in
+         * @returns the serialized object
+         */
         public serialize(parent: any): any {
             return super._serialize({
                 name: "SetValueAction",
@@ -89,13 +173,38 @@
         }
     }
 
+    /**
+     * This defines an action responsible to increment the target value
+     *  to a desired value once triggered.
+     * @see http://doc.babylonjs.com/how_to/how_to_use_actions
+     */
     export class IncrementValueAction extends Action {
+        /**
+         * The path of the property to increment in the target.
+         */
+        public propertyPath: string;
+
+        /**
+         * The value we should increment the property by.
+         */
+        public value: any;
+
         private _target: any;
         private _effectiveTarget: any;
         private _property: string;
 
-        constructor(triggerOptions: any, target: any, public propertyPath: string, public value: any, condition?: Condition) {
+        /**
+         * Instantiate the action
+         * @param triggerOptions defines the trigger options
+         * @param target defines the object containing the property
+         * @param propertyPath defines the path of the property to increment in the target
+         * @param value defines the value value we should increment the property by
+         * @param condition defines the trigger related conditions
+         */
+        constructor(triggerOptions: any, target: any, propertyPath: string, value: any, condition?: Condition) {
             super(triggerOptions, condition);
+            this.propertyPath = propertyPath;
+            this.value = value;
             this._target = this._effectiveTarget = target;
         }
 
@@ -109,6 +218,9 @@
             }
         }
 
+        /**
+         * Execute the action and increment the target of the value amount.
+         */
         public execute(): void {
             this._effectiveTarget[this._property] += this.value;
 
@@ -117,6 +229,11 @@
             }
         }
 
+        /**
+         * Serializes the actions and its related information.
+         * @param parent defines the object to serialize in
+         * @returns the serialized object
+         */
         public serialize(parent: any): any {
             return super._serialize({
                 name: "IncrementValueAction",
@@ -129,11 +246,42 @@
         }
     }
 
+    /**
+     * This defines an action responsible to start an animation once triggered.
+     * @see http://doc.babylonjs.com/how_to/how_to_use_actions
+     */
     export class PlayAnimationAction extends Action {
+        /**
+         * Where the animation should start (animation frame)
+         */
+        public from: number;
+
+        /**
+         * Where the animation should stop (animation frame)
+         */
+        public to: number;
+
+        /**
+         * Define if the animation should loop or stop after the first play.
+         */
+        public loop?: boolean;
+
         private _target: any;
 
-        constructor(triggerOptions: any, target: any, public from: number, public to: number, public loop?: boolean, condition?: Condition) {
+        /**
+         * Instantiate the action
+         * @param triggerOptions defines the trigger options
+         * @param target defines the target animation or animation name
+         * @param from defines from where the animation should start (animation frame)
+         * @param end defines where the animation should stop (animation frame)
+         * @param loop defines if the animation should loop or stop after the first play
+         * @param condition defines the trigger related conditions
+         */
+        constructor(triggerOptions: any, target: any, from: number, to: number, loop?: boolean, condition?: Condition) {
             super(triggerOptions, condition);
+            this.from = from;
+            this.to = to;
+            this.loop = loop;
             this._target = target;
         }
 
@@ -141,11 +289,19 @@
         public _prepare(): void {
         }
 
+        /**
+         * Execute the action and play the animation.
+         */
         public execute(): void {
             var scene = this._actionManager.getScene();
             scene.beginAnimation(this._target, this.from, this.to, this.loop);
         }
 
+        /**
+         * Serializes the actions and its related information.
+         * @param parent defines the object to serialize in
+         * @returns the serialized object
+         */
         public serialize(parent: any): any {
             return super._serialize({
                 name: "PlayAnimationAction",
@@ -159,9 +315,19 @@
         }
     }
 
+    /**
+     * This defines an action responsible to stop an animation once triggered.
+     * @see http://doc.babylonjs.com/how_to/how_to_use_actions
+     */
     export class StopAnimationAction extends Action {
         private _target: any;
 
+        /**
+         * Instantiate the action
+         * @param triggerOptions defines the trigger options
+         * @param target defines the target animation or animation name
+         * @param condition defines the trigger related conditions
+         */
         constructor(triggerOptions: any, target: any, condition?: Condition) {
             super(triggerOptions, condition);
             this._target = target;
@@ -171,11 +337,19 @@
         public _prepare(): void {
         }
 
+        /**
+         * Execute the action and stop the animation.
+         */
         public execute(): void {
             var scene = this._actionManager.getScene();
             scene.stopAnimation(this._target);
         }
 
+        /**
+         * Serializes the actions and its related information.
+         * @param parent defines the object to serialize in
+         * @returns the serialized object
+         */
         public serialize(parent: any): any {
             return super._serialize({
                 name: "StopAnimationAction",
@@ -184,14 +358,31 @@
         }
     }
 
+    /**
+     * This defines an action responsible that does nothing once triggered.
+     * @see http://doc.babylonjs.com/how_to/how_to_use_actions
+     */
     export class DoNothingAction extends Action {
+        /**
+         * Instantiate the action
+         * @param triggerOptions defines the trigger options
+         * @param condition defines the trigger related conditions
+         */
         constructor(triggerOptions: any = ActionManager.NothingTrigger, condition?: Condition) {
             super(triggerOptions, condition);
         }
 
+        /**
+         * Execute the action and do nothing.
+         */
         public execute(): void {
         }
 
+        /**
+         * Serializes the actions and its related information.
+         * @param parent defines the object to serialize in
+         * @returns the serialized object
+         */
         public serialize(parent: any): any {
             return super._serialize({
                 name: "DoNothingAction",
@@ -200,9 +391,25 @@
         }
     }
 
+    /**
+     * This defines an action responsible to trigger several actions once triggered.
+     * @see http://doc.babylonjs.com/how_to/how_to_use_actions
+     */
     export class CombineAction extends Action {
-        constructor(triggerOptions: any, public children: Action[], condition?: Condition) {
+        /**
+         * The list of aggregated animations to run.
+         */
+        public children: Action[];
+
+        /**
+         * Instantiate the action
+         * @param triggerOptions defines the trigger options
+         * @param children defines the list of aggregated animations to run
+         * @param condition defines the trigger related conditions
+         */
+        constructor(triggerOptions: any, children: Action[], condition?: Condition) {
             super(triggerOptions, condition);
+            this.children = children;
         }
 
         /** @hidden */
@@ -213,12 +420,20 @@
             }
         }
 
+        /**
+         * Execute the action and executes all the aggregated actions.
+         */
         public execute(evt: ActionEvent): void {
             for (var index = 0; index < this.children.length; index++) {
                 this.children[index].execute(evt);
             }
         }
 
+        /**
+         * Serializes the actions and its related information.
+         * @param parent defines the object to serialize in
+         * @returns the serialized object
+         */
         public serialize(parent: any): any {
             var serializationObject = super._serialize({
                 name: "CombineAction",
@@ -234,20 +449,50 @@
         }
     }
 
+    /**
+     * This defines an action responsible to run code (external event) once triggered.
+     * @see http://doc.babylonjs.com/how_to/how_to_use_actions
+     */
     export class ExecuteCodeAction extends Action {
-        constructor(triggerOptions: any, public func: (evt: ActionEvent) => void, condition?: Condition) {
+        /**
+         * The callback function to run.
+         */
+        public func: (evt: ActionEvent) => void;
+
+        /**
+         * Instantiate the action
+         * @param triggerOptions defines the trigger options
+         * @param func defines the callback function to run
+         * @param condition defines the trigger related conditions
+         */
+        constructor(triggerOptions: any, func: (evt: ActionEvent) => void, condition?: Condition) {
             super(triggerOptions, condition);
+            this.func = func;
         }
 
+        /**
+         * Execute the action and run the attached code.
+         */
         public execute(evt: ActionEvent): void {
             this.func(evt);
         }
     }
 
+    /**
+     * This defines an action responsible to set the parent property of the target once triggered.
+     * @see http://doc.babylonjs.com/how_to/how_to_use_actions
+     */
     export class SetParentAction extends Action {
         private _parent: any;
         private _target: any;
 
+        /**
+         * Instantiate the action
+         * @param triggerOptions defines the trigger options
+         * @param target defines the target containing the parent property
+         * @param parent defines from where the animation should start (animation frame)
+         * @param condition defines the trigger related conditions
+         */
         constructor(triggerOptions: any, target: any, parent: any, condition?: Condition) {
             super(triggerOptions, condition);
             this._target = target;
@@ -258,6 +503,9 @@
         public _prepare(): void {
         }
 
+        /**
+         * Execute the action and set the parent property.
+         */
         public execute(): void {
             if (this._target.parent === this._parent) {
                 return;
@@ -271,6 +519,11 @@
             this._target.parent = this._parent;
         }
 
+        /**
+         * Serializes the actions and its related information.
+         * @param parent defines the object to serialize in
+         * @returns the serialized object
+         */
         public serialize(parent: any): any {
             return super._serialize({
                 name: "SetParentAction",

+ 60 - 3
src/Actions/babylon.interpolateValueAction.ts

@@ -1,14 +1,63 @@
 module BABYLON {
+    /**
+     * 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.
+     * @see http://doc.babylonjs.com/how_to/how_to_use_actions
+     */
     export class InterpolateValueAction extends Action {
+        /**
+         * Defines the path of the property where the value should be interpolated
+         */
+        public propertyPath: string;
+        
+        /**
+         * Defines the target value at the end of the interpolation.
+         */
+        public value: any;
+
+        /**
+         * Defines the time it will take for the property to interpolate to the value.
+         */
+        public duration: number = 1000;
+
+        /**
+         * Defines if the other scene animations should be stopped when the action has been triggered
+         */
+        public stopOtherAnimations?: boolean;
+
+        /**
+         * Defines a callback raised once the interpolation animation has been done.
+         */
+        public onInterpolationDone?: () => void;
+        
+        /**
+         * Observable triggered once the interpolation animation has been done.
+         */
+        public onInterpolationDoneObservable = new Observable<InterpolateValueAction>();
+
         private _target: any;
         private _effectiveTarget: any;
         private _property: string;
 
-        public onInterpolationDoneObservable = new Observable<InterpolateValueAction>();
-
-        constructor(triggerOptions: any, target: any, public propertyPath: string, public value: any, public duration: number = 1000, condition?: Condition, public stopOtherAnimations?: boolean, public onInterpolationDone?: () => void) {
+        /**
+         * Instantiate the action
+         * @param triggerOptions defines the trigger options
+         * @param target defines the object containing the value to interpolate
+         * @param propertyPath defines the path to the property in the target object
+         * @param value defines the target value at the end of the interpolation
+         * @param duration deines the time it will take for the property to interpolate to the value.
+         * @param condition defines the trigger related conditions
+         * @param stopOtherAnimations defines if the other scene animations should be stopped when the action has been triggered
+         * @param onInterpolationDone defines a callback raised once the interpolation animation has been done
+         */
+        constructor(triggerOptions: any, target: any, propertyPath: string, value: any, duration: number = 1000, condition?: Condition, stopOtherAnimations?: boolean, onInterpolationDone?: () => void) {
             super(triggerOptions, condition);
 
+            this.propertyPath = propertyPath;
+            this.value = value;
+            this.duration = duration;
+            this.stopOtherAnimations = stopOtherAnimations;
+            this.onInterpolationDone = onInterpolationDone;
             this._target = this._effectiveTarget = target;
         }
 
@@ -18,6 +67,9 @@
             this._property = this._getProperty(this.propertyPath);
         }
 
+        /**
+         * Execute the action starts the value interpolation.
+         */
         public execute(): void {
             var scene = this._actionManager.getScene();
             var keys = [
@@ -65,6 +117,11 @@
             scene.beginDirectAnimation(this._effectiveTarget, [animation], 0, 100, false, 1, wrapper);
         }
 
+        /**
+         * Serializes the actions and its related information.
+         * @param parent defines the object to serialize in
+         * @returns the serialized object
+         */
         public serialize(parent: any): any {
             return super._serialize({
                 name: "InterpolateValueAction",

+ 25 - 0
src/Audio/babylon.sound.ts

@@ -1,10 +1,35 @@
 module BABYLON {
+    /**
+     * 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.
+     * @see http://doc.babylonjs.com/how_to/playing_sounds_and_music
+     */
     export class Sound {
+        /**
+         * The name of the sound in the scene.
+         */
         public name: string;
+        /**
+         * Does the sound autoplay once loaded.
+         */
         public autoplay: boolean = false;
+        /**
+         * Does the sound loop after it finishes playing once.
+         */
         public loop: boolean = false;
+        /**
+         * Does the sound use a custom attenuation curve to simulate the falloff
+         * happening when the source gets further away from the camera.
+         * @see http://doc.babylonjs.com/how_to/playing_sounds_and_music#creating-your-own-custom-attenuation-function
+         */
         public useCustomAttenuation: boolean = false;
+        /**
+         * The sound track id this sound belongs to.
+         */
         public soundTrackId: number;
+        /**
+         * Does this sound enables spatial sound.
+         */
         public spatialSound: boolean = false;
         public refDistance: number = 1;
         public rolloffFactor: number = 1;

+ 14 - 0
src/Behaviors/Cameras/babylon.bouncingBehavior.ts

@@ -1,8 +1,12 @@
 module BABYLON {
     /**
      * 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
      */
     export class BouncingBehavior implements Behavior<ArcRotateCamera> {
+        /**
+         * Gets the name of the behavior.
+         */
         public get name(): string {
             return "Bouncing";
         }
@@ -79,10 +83,17 @@ module BABYLON {
         private _onAfterCheckInputsObserver: Nullable<Observer<Camera>>;
         private _onMeshTargetChangedObserver: Nullable<Observer<Nullable<AbstractMesh>>>;
 
+        /**
+         * Initializes the behavior.
+         */
         public init(): void {
             // Do notihng
         }
 
+        /**
+         * Attaches the behavior to its arc rotate camera.
+         * @param camera Defines the camera to attach the behavior to
+         */
         public attach(camera: ArcRotateCamera): void {
             this._attachedCamera = camera;
             this._onAfterCheckInputsObserver = camera.onAfterCheckInputsObservable.add(() => {
@@ -102,6 +113,9 @@ module BABYLON {
             });
         }
 
+        /**
+         * Detaches the behavior from its current arc rotate camera.
+         */
         public detach(): void {
             if (!this._attachedCamera) {
                 return;

+ 17 - 0
src/Behaviors/Cameras/babylon.framingBehavior.ts

@@ -1,5 +1,12 @@
 module BABYLON {
+    /**
+     * 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
+     */
     export class FramingBehavior implements Behavior<ArcRotateCamera> {
+        /**
+         * Gets the name of the behavior.
+         */
         public get name(): string {
             return "Framing";
         }
@@ -147,10 +154,17 @@ module BABYLON {
         private _isPointerDown = false;
         private _lastInteractionTime = -Infinity;
 
+        /**
+         * Initializes the behavior.
+         */
         public init(): void {
             // Do notihng
         }
 
+        /**
+         * Attaches the behavior to its arc rotate camera.
+         * @param camera Defines the camera to attach the behavior to
+         */
         public attach(camera: ArcRotateCamera): void {
             this._attachedCamera = camera;
             let scene = this._attachedCamera.getScene();
@@ -184,6 +198,9 @@ module BABYLON {
             });
         }
 
+        /**
+         * Detaches the behavior from its current arc rotate camera.
+         */
         public detach(): void {
             if (!this._attachedCamera) {
                 return;

+ 2 - 2
src/Cameras/Inputs/babylon.arcRotateCameraKeyboardMoveInput.ts

@@ -1,6 +1,6 @@
 module BABYLON {
     /**
-     * Manage the keyboard inputs to control the movment of an arc rotate camera.
+     * Manage the keyboard inputs to control the movement of an arc rotate camera.
      * @see http://doc.babylonjs.com/how_to/customizing_camera_inputs
      */
     export class ArcRotateCameraKeyboardMoveInput implements ICameraInput<ArcRotateCamera> {
@@ -55,7 +55,7 @@ module BABYLON {
         public zoomingSensibility: number = 25.0;
 
         /**
-         * Defines wether maintaining the alt key down switch the movment mode from
+         * Defines wether maintaining the alt key down switch the movement mode from
          * orientation to zoom.
          */
         @serialize()

+ 34 - 5
src/Cameras/Inputs/babylon.freeCameraDeviceOrientationInput.ts

@@ -2,6 +2,7 @@ module BABYLON {
     /**
      * Takes information about the orientation of the device as reported by the deviceorientation event to orient the camera.
      * Screen rotation is taken into account.
+     * @see http://doc.babylonjs.com/how_to/customizing_camera_inputs
      */
     export class FreeCameraDeviceOrientationInput implements ICameraInput<FreeCamera> {
         private _camera: FreeCamera;
@@ -15,11 +16,18 @@ module BABYLON {
         private _beta: number = 0;
         private _gamma: number = 0;
 
+        /**
+         * Instantiates a new input
+         * @see http://doc.babylonjs.com/how_to/customizing_camera_inputs
+         */
         constructor() {
             this._constantTranform = new Quaternion(- Math.sqrt(0.5), 0, 0, Math.sqrt(0.5));
             this._orientationChanged();
         }
 
+        /**
+         * Define the camera controlled by the input.
+         */
         public get camera(): FreeCamera {
             return this._camera;
         }
@@ -31,7 +39,12 @@ module BABYLON {
             }
         }
 
-        attachControl(element: HTMLElement, noPreventDefault?: boolean) {
+        /**
+         * Attach the input controls to a specific dom element to get the input from.
+         * @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 {
             window.addEventListener("orientationchange", this._orientationChanged);
             window.addEventListener("deviceorientation", this._deviceOrientation);
             //In certain cases, the attach control is called AFTER orientation was changed,
@@ -51,12 +64,20 @@ module BABYLON {
             this._gamma = evt.gamma !== null ? evt.gamma : 0;
         }
 
-        detachControl(element: Nullable<HTMLElement>) {
+        /**
+         * Detach the current controls from the specified dom element.
+         * @param element Defines the element to stop listening the inputs from
+         */
+        public detachControl(element: Nullable<HTMLElement>): void {
             window.removeEventListener("orientationchange", this._orientationChanged);
             window.removeEventListener("deviceorientation", this._deviceOrientation);
         }
 
-        public checkInputs() {
+        /**
+         * Update the current camera state depending on the inputs that have been used this frame.
+         * This is a dynamically created lambda to avoid the performance penalty of looping for inputs in the render loop.
+         */
+        public checkInputs(): void {
             //if no device orientation provided, don't update the rotation.
             //Only testing against alpha under the assumption thatnorientation will never be so exact when set.
             if (!this._alpha) return;
@@ -68,11 +89,19 @@ module BABYLON {
             this._camera.rotationQuaternion.w *= -1;
         }
 
-        getClassName(): string {
+        /**
+         * Gets the class name of the current intput.
+         * @returns the class name
+         */
+        public getClassName(): string {
             return "FreeCameraDeviceOrientationInput";
         }
 
-        getSimpleName() {
+        /**
+         * Get the friendly name associated with the input class.
+         * @returns the input friendly name
+         */
+        public getSimpleName(): string {
             return "deviceOrientation";
         }
     }

+ 49 - 10
src/Cameras/Inputs/babylon.freeCameraGamepadInput.ts

@@ -1,24 +1,47 @@
 module BABYLON {
+    /**
+     * Manage the gamepad inputs to control a free camera.
+     * @see http://doc.babylonjs.com/how_to/customizing_camera_inputs
+     */
     export class FreeCameraGamepadInput implements ICameraInput<FreeCamera> {
-        camera: FreeCamera;
+        /**
+         * Define the camera the input is attached to.
+         */
+        public camera: FreeCamera;
 
-        public gamepad: Nullable<Gamepad>;        
-        private _onGamepadConnectedObserver : Nullable<Observer<Gamepad>>;
-        private _onGamepadDisconnectedObserver : Nullable<Observer<Gamepad>>;
+        /**
+         * Define the Gamepad controlling the input
+         */
+        public gamepad: Nullable<Gamepad>;
 
+        /**
+         * Defines the gamepad rotation sensiblity.
+         * This is the threshold from when rotation starts to be accounted for to prevent jittering.
+         */
         @serialize()
         public gamepadAngularSensibility = 200;
 
+        /**
+         * Defines the gamepad move sensiblity.
+         * This is the threshold from when moving starts to be accounted for for to prevent jittering.
+         */
         @serialize()
         public gamepadMoveSensibility = 40;
-
+        
         // private members
+        private _onGamepadConnectedObserver : Nullable<Observer<Gamepad>>;
+        private _onGamepadDisconnectedObserver : Nullable<Observer<Gamepad>>;
         private _cameraTransform: Matrix = Matrix.Identity();
         private _deltaTransform: Vector3 = Vector3.Zero();
         private _vector3: Vector3 = Vector3.Zero();
         private _vector2: Vector2 = Vector2.Zero();
 
-        attachControl(element: HTMLElement, noPreventDefault?: boolean) {
+        /**
+         * Attach the input controls to a specific dom element to get the input from.
+         * @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 {
             let manager = this.camera.getScene().gamepadManager;
             this._onGamepadConnectedObserver = manager.onGamepadConnectedObservable.add((gamepad) => {
                 if (gamepad.type !== Gamepad.POSE_ENABLED) {
@@ -38,13 +61,21 @@ module BABYLON {
             this.gamepad = manager.getGamepadByType(Gamepad.XBOX);
         }
 
-        detachControl(element: Nullable<HTMLElement>) {
+        /**
+         * Detach the current controls from the specified dom element.
+         * @param element Defines the element to stop listening the inputs from
+         */
+        public detachControl(element: Nullable<HTMLElement>): void {
             this.camera.getScene().gamepadManager.onGamepadConnectedObservable.remove(this._onGamepadConnectedObserver);
             this.camera.getScene().gamepadManager.onGamepadDisconnectedObservable.remove(this._onGamepadDisconnectedObserver);
             this.gamepad = null;
         }
 
-        checkInputs() {
+        /**
+         * Update the current camera state depending on the inputs that have been used this frame.
+         * This is a dynamically created lambda to avoid the performance penalty of looping for inputs in the render loop.
+         */
+        public checkInputs(): void {
             if (this.gamepad && this.gamepad.leftStick) {
                 var camera = this.camera;
                 var LSValues = this.gamepad.leftStick;
@@ -80,11 +111,19 @@ module BABYLON {
             }
         }
 
-        getClassName(): string {
+        /**
+         * Gets the class name of the current intput.
+         * @returns the class name
+         */
+        public getClassName(): string {
             return "FreeCameraGamepadInput";
         }
 
-        getSimpleName() {
+        /**
+         * Get the friendly name associated with the input class.
+         * @returns the input friendly name
+         */
+        public getSimpleName(): string {
             return "gamepad";
         }
     }

+ 53 - 12
src/Cameras/Inputs/babylon.freeCameraKeyboardMoveInput.ts

@@ -1,25 +1,50 @@
 module BABYLON {
+    /**
+     * Manage the keyboard inputs to control the movement of a free camera.
+     * @see http://doc.babylonjs.com/how_to/customizing_camera_inputs
+     */
     export class FreeCameraKeyboardMoveInput implements ICameraInput<FreeCamera> {
-        camera: FreeCamera;
-        private _keys = new Array<number>();
-        private _onCanvasBlurObserver: Nullable<Observer<Engine>>;
-        private _onKeyboardObserver: Nullable<Observer<KeyboardInfo>>;
-        private _engine: Engine;
-        private _scene: Scene;
-
+        /**
+         * Defines the camera the input is attached to.
+         */
+        public camera: FreeCamera;
+
+        /**
+         * Gets or Set the list of keyboard keys used to control the forward move of the camera.
+         */
         @serialize()
         public keysUp = [38];
 
+        /**
+         * Gets or Set the list of keyboard keys used to control the backward move of the camera.
+         */
         @serialize()
         public keysDown = [40];
 
+        /**
+         * Gets or Set the list of keyboard keys used to control the left strafe move of the camera.
+         */
         @serialize()
         public keysLeft = [37];
 
+        /**
+         * Gets or Set the list of keyboard keys used to control the right strafe move of the camera.
+         */
         @serialize()
         public keysRight = [39];
 
-        attachControl(element: HTMLElement, noPreventDefault?: boolean) {
+        private _keys = new Array<number>();
+        private _onCanvasBlurObserver: Nullable<Observer<Engine>>;
+        private _onKeyboardObserver: Nullable<Observer<KeyboardInfo>>;
+        private _engine: Engine;
+        private _scene: Scene;
+
+        /**
+         * Attach the input controls to a specific dom element to get the input from.
+         * @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 {
             if (this._onCanvasBlurObserver) {
                 return;
             }
@@ -66,7 +91,11 @@ module BABYLON {
             });
         }
 
-        detachControl(element: Nullable<HTMLElement>) {
+        /**
+         * Detach the current controls from the specified dom element.
+         * @param element Defines the element to stop listening the inputs from
+         */
+        public detachControl(element: Nullable<HTMLElement>): void {
             if (this._scene) {
                 if (this._onKeyboardObserver) {
                     this._scene.onKeyboardObservable.remove(this._onKeyboardObserver);
@@ -81,7 +110,11 @@ module BABYLON {
             this._keys = [];
         }
 
-        public checkInputs() {
+        /**
+         * Update the current camera state depending on the inputs that have been used this frame.
+         * This is a dynamically created lambda to avoid the performance penalty of looping for inputs in the render loop.
+         */
+        public checkInputs(): void {
             if (this._onKeyboardObserver) {
                 var camera = this.camera;
                 // Keyboard
@@ -110,7 +143,11 @@ module BABYLON {
             }
         }
 
-        getClassName(): string {
+        /**
+         * Gets the class name of the current intput.
+         * @returns the class name
+         */
+        public getClassName(): string {
             return "FreeCameraKeyboardMoveInput";
         }
 
@@ -119,7 +156,11 @@ module BABYLON {
             this._keys = [];
         }
 
-        getSimpleName() {
+        /**
+         * Get the friendly name associated with the input class.
+         * @returns the input friendly name
+         */
+        public getSimpleName(): string {
             return "keyboard";
         }
     }

+ 46 - 8
src/Cameras/Inputs/babylon.freeCameraMouseInput.ts

@@ -1,23 +1,49 @@
 module BABYLON {
+    /**
+     * Manage the mouse inputs to control the movement of a free camera.
+     * @see http://doc.babylonjs.com/how_to/customizing_camera_inputs
+     */
     export class FreeCameraMouseInput implements ICameraInput<FreeCamera> {
-        camera: FreeCamera;
-
+        /**
+         * Defines the camera the input is attached to.
+         */
+        public camera: FreeCamera;
+
+        /**
+         * Defines the buttons associated with the input to handle camera move.
+         */
         @serialize()
         public buttons = [0, 1, 2];
 
+        /**
+         * Defines the pointer angular sensibility  along the X and Y axis or how fast is the camera rotating.
+         */
         @serialize()
         public angularSensibility = 2000.0;
 
         private _pointerInput: (p: PointerInfo, s: EventState) => void;
         private _onMouseMove: Nullable<(e: MouseEvent) => any>;
         private _observer: Nullable<Observer<PointerInfo>>;
-
         private previousPosition: Nullable<{ x: number, y: number }> = null;
 
-        constructor(public touchEnabled = true) {
+        /**
+         * Manage the mouse inputs to control the movement of a free camera.
+         * @see http://doc.babylonjs.com/how_to/customizing_camera_inputs
+         * @param touchEnabled Defines if touch is enabled or not
+         */
+        constructor(
+            /**
+             * Define if touch is enabled in the mouse input
+             */
+            public touchEnabled = true) {
         }
 
-        attachControl(element: HTMLElement, noPreventDefault?: boolean) {
+        /**
+         * Attach the input controls to a specific dom element to get the input from.
+         * @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 {
             var engine = this.camera.getEngine();
 
             if (!this._pointerInput) {
@@ -122,7 +148,11 @@ module BABYLON {
 
         }
 
-        detachControl(element: Nullable<HTMLElement>) {
+        /**
+         * Detach the current controls from the specified dom element.
+         * @param element Defines the element to stop listening the inputs from
+         */
+        public detachControl(element: Nullable<HTMLElement>):void {
             if (this._observer && element) {
                 this.camera.getScene().onPointerObservable.remove(this._observer);
 
@@ -136,11 +166,19 @@ module BABYLON {
             }
         }
 
-        getClassName(): string {
+        /**
+         * Gets the class name of the current intput.
+         * @returns the class name
+         */
+        public getClassName(): string {
             return "FreeCameraMouseInput";
         }
 
-        getSimpleName() {
+        /**
+         * Get the friendly name associated with the input class.
+         * @returns the input friendly name
+         */
+        public getSimpleName(): string {
             return "mouse";
         }
     }

+ 48 - 12
src/Cameras/Inputs/babylon.freeCameraTouchInput.ts

@@ -1,6 +1,27 @@
 module BABYLON {
+    /**
+     * Manage the touch inputs to control the movement of a free camera.
+     * @see http://doc.babylonjs.com/how_to/customizing_camera_inputs
+     */
     export class FreeCameraTouchInput implements ICameraInput<FreeCamera> {
-        camera: FreeCamera;
+        /**
+         * Defines the camera the input is attached to.
+         */
+        public camera: FreeCamera;
+
+        /**
+         * Defines the touch sensibility for rotation.
+         * The higher the faster.
+         */
+        @serialize()
+        public touchAngularSensibility: number = 200000.0;
+
+        /**
+         * Defines the touch sensibility for move.
+         * The higher the faster.
+         */
+        @serialize()
+        public touchMoveSensibility: number = 250.0;
 
         private _offsetX: Nullable<number> = null;
         private _offsetY: Nullable<number> = null;
@@ -10,13 +31,12 @@ module BABYLON {
         private _observer: Nullable<Observer<PointerInfo>>;
         private _onLostFocus: Nullable<(e: FocusEvent) => any>;
 
-        @serialize()
-        public touchAngularSensibility: number = 200000.0;
-
-        @serialize()
-        public touchMoveSensibility: number = 250.0;
-
-        attachControl(element: HTMLElement, noPreventDefault?: boolean) {
+        /**
+         * Attach the input controls to a specific dom element to get the input from.
+         * @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 {
             var previousPosition: Nullable<{ x: number, y: number }> = null;
 
             if (this._pointerInput === undefined) {
@@ -98,7 +118,11 @@ module BABYLON {
             }
         }
 
-        detachControl(element: Nullable<HTMLElement>) {
+        /**
+         * Detach the current controls from the specified dom element.
+         * @param element Defines the element to stop listening the inputs from
+         */
+        public detachControl(element: Nullable<HTMLElement>): void {
             if (this._pointerInput && element) {
                 if (this._observer) {
                     this.camera.getScene().onPointerObservable.remove(this._observer);
@@ -115,7 +139,11 @@ module BABYLON {
             }
         }
 
-        checkInputs() {
+        /**
+         * Update the current camera state depending on the inputs that have been used this frame.
+         * This is a dynamically created lambda to avoid the performance penalty of looping for inputs in the render loop.
+         */
+        public checkInputs(): void {
             if (this._offsetX && this._offsetY) {
                 var camera = this.camera;
                 camera.cameraRotation.y += this._offsetX / this.touchAngularSensibility;
@@ -132,11 +160,19 @@ module BABYLON {
             }
         }
 
-        getClassName(): string {
+        /**
+         * Gets the class name of the current intput.
+         * @returns the class name
+         */
+        public getClassName(): string {
             return "FreeCameraTouchInput";
         }
 
-        getSimpleName() {
+        /**
+         * Get the friendly name associated with the input class.
+         * @returns the input friendly name
+         */
+        public getSimpleName(): string {
             return "touch";
         }
     }

+ 44 - 8
src/Cameras/Inputs/babylon.freeCameraVirtualJoystickInput.ts

@@ -1,18 +1,37 @@
 module BABYLON {
+    /**
+     * Manage the Virtual Joystick inputs to control the movement of a free camera.
+     * @see http://doc.babylonjs.com/how_to/customizing_camera_inputs
+     */
     export class FreeCameraVirtualJoystickInput implements ICameraInput<FreeCamera> {
-        camera: FreeCamera;
+        /**
+         * Defines the camera the input is attached to.
+         */
+        public camera: FreeCamera;
 
         private _leftjoystick: VirtualJoystick;
         private _rightjoystick: VirtualJoystick;
-        
+
+        /**
+         * Gets the left stick of the virtual joystick.
+         * @returns The virtual Joystick
+         */
         public getLeftJoystick(): VirtualJoystick {
             return this._leftjoystick;
         }
 
+        /**
+         * Gets the right stick of the virtual joystick.
+         * @returns The virtual Joystick
+         */
         public getRightJoystick(): VirtualJoystick {
             return this._rightjoystick;
         }
 
+        /**
+         * Update the current camera state depending on the inputs that have been used this frame.
+         * This is a dynamically created lambda to avoid the performance penalty of looping for inputs in the render loop.
+         */
         public checkInputs() {
             if (this._leftjoystick){
                 var camera = this.camera;
@@ -30,8 +49,13 @@ module BABYLON {
                 }
             }
         }
-        
-        attachControl(element : HTMLElement, noPreventDefault?: boolean) {
+
+        /**
+         * Attach the input controls to a specific dom element to get the input from.
+         * @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 {
             this._leftjoystick = new VirtualJoystick(true);
             this._leftjoystick.setAxisForUpDown(JoystickAxis.Z);
             this._leftjoystick.setAxisForLeftRight(JoystickAxis.X);
@@ -44,16 +68,28 @@ module BABYLON {
             this._rightjoystick.setJoystickColor("yellow");
         }
 
-        detachControl(element: Nullable<HTMLElement>) {
+        /**
+         * Detach the current controls from the specified dom element.
+         * @param element Defines the element to stop listening the inputs from
+         */
+        public detachControl(element: Nullable<HTMLElement>): void {
             this._leftjoystick.releaseCanvas();
             this._rightjoystick.releaseCanvas();
         }
 
-        getClassName(): string {
+        /**
+         * Gets the class name of the current intput.
+         * @returns the class name
+         */
+        public getClassName(): string {
             return "FreeCameraVirtualJoystickInput";
         }
-        
-        getSimpleName(){
+
+        /**
+         * Get the friendly name associated with the input class.
+         * @returns the input friendly name
+         */
+        public getSimpleName(): string {
             return "virtualJoystick";
         }
     }

+ 2 - 1
src/Cameras/Stereoscopic/babylon.anaglyphArcRotateCamera.ts

@@ -5,7 +5,8 @@ module BABYLON {
 
     /**
      * Camera used to simulate anaglyphic rendering (based on ArcRotateCamera)
-     */    
+     * @see http://doc.babylonjs.com/features/cameras#anaglyph-cameras
+     */
     export class AnaglyphArcRotateCamera extends ArcRotateCamera {
 
         /**

+ 1 - 0
src/Cameras/Stereoscopic/babylon.anaglyphFreeCamera.ts

@@ -5,6 +5,7 @@ module BABYLON {
 
     /**
      * Camera used to simulate anaglyphic rendering (based on FreeCamera)
+     * @see http://doc.babylonjs.com/features/cameras#anaglyph-cameras
      */
     export class AnaglyphFreeCamera extends FreeCamera {
         /**

+ 1 - 0
src/Cameras/Stereoscopic/babylon.anaglyphGamepadCamera.ts

@@ -5,6 +5,7 @@ module BABYLON {
 
     /**
      * Camera used to simulate anaglyphic rendering (based on GamepadCamera)
+     * @see http://doc.babylonjs.com/features/cameras#anaglyph-cameras
      */       
     export class AnaglyphGamepadCamera extends GamepadCamera {
         /**

+ 1 - 0
src/Cameras/Stereoscopic/babylon.anaglyphUniversalCamera.ts

@@ -5,6 +5,7 @@ module BABYLON {
 
     /**
      * Camera used to simulate anaglyphic rendering (based on UniversalCamera)
+     * @see http://doc.babylonjs.com/features/cameras#anaglyph-cameras
      */        
     export class AnaglyphUniversalCamera extends UniversalCamera {
         /**

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

@@ -5,7 +5,8 @@ module BABYLON {
 
     /**
      * Camera used to simulate stereoscopic rendering (based on ArcRotateCamera)
-     */      
+     * @see http://doc.babylonjs.com/features/cameras
+     */
     export class StereoscopicArcRotateCamera extends ArcRotateCamera {
         /**
          * Creates a new StereoscopicArcRotateCamera

+ 1 - 0
src/Cameras/Stereoscopic/babylon.stereoscopicFreeCamera.ts

@@ -5,6 +5,7 @@ module BABYLON {
 
     /**
      * Camera used to simulate stereoscopic rendering (based on FreeCamera)
+     * @see http://doc.babylonjs.com/features/cameras
      */    
     export class StereoscopicFreeCamera extends FreeCamera {
         /**

+ 1 - 0
src/Cameras/Stereoscopic/babylon.stereoscopicGamepadCamera.ts

@@ -5,6 +5,7 @@ module BABYLON {
 
     /**
      * Camera used to simulate stereoscopic rendering (based on GamepadCamera)
+     * @see http://doc.babylonjs.com/features/cameras
      */      
     export class StereoscopicGamepadCamera extends GamepadCamera {
         /**

+ 1 - 0
src/Cameras/Stereoscopic/babylon.stereoscopicUniversalCamera.ts

@@ -4,6 +4,7 @@ module BABYLON {
     });    
     /**
      * Camera used to simulate stereoscopic rendering (based on UniversalCamera)
+     * @see http://doc.babylonjs.com/features/cameras
      */      
     export class StereoscopicUniversalCamera extends UniversalCamera {
         /**

+ 67 - 0
src/Cameras/VR/babylon.vrCameraMetrics.ts

@@ -1,27 +1,81 @@
 module BABYLON {
+    /**
+     * This represents all the required metrics to create a VR camera.
+     * @see http://doc.babylonjs.com/babylon101/cameras#device-orientation-camera
+     */
     export class VRCameraMetrics {
+        /**
+         * Define the horizontal resolution off the screen.
+         */
         public hResolution: number;
+        /**
+         * Define the vertical resolution off the screen.
+         */
         public vResolution: number;
+        /**
+         * Define the horizontal screen size.
+         */
         public hScreenSize: number;
+        /**
+         * Define the vertical screen size.
+         */
         public vScreenSize: number;
+        /**
+         * Define the vertical screen center position.
+         */
         public vScreenCenter: number;
+        /**
+         * Define the distance of the eyes to the screen.
+         */
         public eyeToScreenDistance: number;
+        /**
+         * Define the distance between both lenses
+         */
         public lensSeparationDistance: number;
+        /**
+         * Define the distance between both viewer's eyes.
+         */
         public interpupillaryDistance: number;
+        /**
+         * Define the distortion factor of the VR postprocess.
+         * Please, touch with care.
+         */
         public distortionK: number[];
+        /**
+         * Define the chromatic aberration correction factors for the VR post process.
+         */
         public chromaAbCorrection: number[];
+        /**
+         * Define the scale factor of the post process.
+         * The smaller the better but the slower.
+         */
         public postProcessScaleFactor: number;
+        /**
+         * Define an offset for the lens center.
+         */
         public lensCenterOffset: number;
+        /**
+         * Define if the current vr camera should compensate the distortion of the lense or not.
+         */
         public compensateDistortion = true;
 
+        /**
+         * Gets the rendering aspect ratio based on the provided resolutions.
+         */
         public get aspectRatio(): number {
             return this.hResolution / (2 * this.vResolution);
         }
 
+        /**
+         * Gets the aspect ratio based on the FOV, scale factors, and real screen sizes.
+         */
         public get aspectRatioFov(): number {
             return (2 * Math.atan((this.postProcessScaleFactor * this.vScreenSize) / (2 * this.eyeToScreenDistance)));
         }
 
+        /**
+         * @hidden
+         */
         public get leftHMatrix(): Matrix {
             var meters = (this.hScreenSize / 4) - (this.lensSeparationDistance / 2);
             var h = (4 * meters) / this.hScreenSize;
@@ -29,6 +83,9 @@
             return Matrix.Translation(h, 0, 0);
         }
 
+        /**
+         * @hidden
+         */
         public get rightHMatrix(): Matrix {
             var meters = (this.hScreenSize / 4) - (this.lensSeparationDistance / 2);
             var h = (4 * meters) / this.hScreenSize;
@@ -36,14 +93,24 @@
             return Matrix.Translation(-h, 0, 0);
         }
 
+        /**
+         * @hidden
+         */
         public get leftPreViewMatrix(): Matrix {
             return Matrix.Translation(0.5 * this.interpupillaryDistance, 0, 0);
         }
 
+        /**
+         * @hidden
+         */
         public get rightPreViewMatrix(): Matrix {
             return Matrix.Translation(-0.5 * this.interpupillaryDistance, 0, 0);
         }
 
+        /**
+         * Get the default VRMetrics based on the most generic setup.
+         * @returns the default vr metrics
+         */
         public static GetDefault(): VRCameraMetrics {
             var result = new VRCameraMetrics();
 

+ 19 - 0
src/Cameras/VR/babylon.vrDeviceOrientationArcRotateCamera.ts

@@ -3,8 +3,23 @@ module BABYLON {
         return () => new VRDeviceOrientationArcRotateCamera(name, 0, 0, 1.0, Vector3.Zero(), scene);
     });
 
+    /**
+     * Camera used to simulate VR rendering (based on ArcRotateCamera)
+     * @see http://doc.babylonjs.com/babylon101/cameras#vr-device-orientation-cameras
+     */
     export class VRDeviceOrientationArcRotateCamera extends ArcRotateCamera {
 
+        /**
+         * Creates a new VRDeviceOrientationArcRotateCamera
+         * @param name defines camera name
+         * @param alpha defines the camera rotation along the logitudinal axis
+         * @param beta defines the camera rotation along the latitudinal axis
+         * @param radius defines the camera distance from its target
+         * @param target defines the camera target
+         * @param scene defines the scene the camera belongs to
+         * @param compensateDistortion defines if the camera needs to compensate the lens distorsion
+         * @param vrCameraMetrics defines the vr metrics associated to the camera
+         */
         constructor(name: string, alpha: number, beta: number, radius: number, target: Vector3, scene: Scene, compensateDistortion = true, vrCameraMetrics: VRCameraMetrics = VRCameraMetrics.GetDefault()) {
             super(name, alpha, beta, radius, target, scene);
 
@@ -14,6 +29,10 @@ module BABYLON {
             this.inputs.addVRDeviceOrientation();
         }
 
+        /**
+         * Gets camera class name
+         * @returns VRDeviceOrientationArcRotateCamera
+         */
         public getClassName(): string {
             return "VRDeviceOrientationArcRotateCamera";
         }

+ 16 - 1
src/Cameras/VR/babylon.vrDeviceOrientationFreeCamera.ts

@@ -3,8 +3,20 @@ module BABYLON {
         return () => new VRDeviceOrientationFreeCamera(name, Vector3.Zero(), scene);
     });
 
+    /**
+     * Camera used to simulate VR rendering (based on FreeCamera)
+     * @see http://doc.babylonjs.com/babylon101/cameras#vr-device-orientation-cameras
+     */
     export class VRDeviceOrientationFreeCamera extends DeviceOrientationCamera {
 
+        /**
+         * Creates a new VRDeviceOrientationFreeCamera
+         * @param name defines camera name
+         * @param position defines the start position of the camera
+         * @param scene defines the scene the camera belongs to
+         * @param compensateDistortion defines if the camera needs to compensate the lens distorsion
+         * @param vrCameraMetrics defines the vr metrics associated to the camera
+         */
         constructor(name: string, position: Vector3, scene: Scene, compensateDistortion = true, vrCameraMetrics: VRCameraMetrics = VRCameraMetrics.GetDefault()) {
             super(name, position, scene);
 
@@ -12,7 +24,10 @@ module BABYLON {
             this.setCameraRigMode(Camera.RIG_MODE_VR, { vrCameraMetrics: vrCameraMetrics });
         }
 
-
+        /**
+         * Gets camera class name
+         * @returns VRDeviceOrientationFreeCamera
+         */
         public getClassName(): string {
             return "VRDeviceOrientationFreeCamera";
         }

+ 16 - 0
src/Cameras/VR/babylon.vrDeviceOrientationGamepadCamera.ts

@@ -3,14 +3,30 @@ module BABYLON {
         return () => new VRDeviceOrientationGamepadCamera(name, Vector3.Zero(), scene);
     });
 
+    /**
+     * Camera used to simulate VR rendering (based on VRDeviceOrientationFreeCamera)
+     * @see http://doc.babylonjs.com/babylon101/cameras#vr-device-orientation-cameras
+     */
     export class VRDeviceOrientationGamepadCamera extends VRDeviceOrientationFreeCamera {
 
+        /**
+         * Creates a new VRDeviceOrientationGamepadCamera
+         * @param name defines camera name
+         * @param position defines the start position of the camera
+         * @param scene defines the scene the camera belongs to
+         * @param compensateDistortion defines if the camera needs to compensate the lens distorsion
+         * @param vrCameraMetrics defines the vr metrics associated to the camera
+         */
         constructor(name: string, position: Vector3, scene: Scene, compensateDistortion = true, vrCameraMetrics: VRCameraMetrics = VRCameraMetrics.GetDefault()) {
             super(name, position, scene, compensateDistortion, vrCameraMetrics);
             
             this.inputs.addGamepad();
         }
 
+        /**
+         * Gets camera class name
+         * @returns VRDeviceOrientationGamepadCamera
+         */
         public getClassName(): string {
             return "VRDeviceOrientationGamepadCamera";
         }

+ 1 - 1
src/Cameras/babylon.camera.ts

@@ -138,7 +138,7 @@
 
         /**
          * Define the default inertia of the camera.
-         * This helps giving a smooth feeling to the camera movment.
+         * This helps giving a smooth feeling to the camera movement.
          */
         @serialize()
         public inertia = 0.9;