Forráskód Böngészése

Merge pull request #5140 from sebavan/master

Doc
sebavan 7 éve
szülő
commit
c8d475a0d3

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