Bladeren bron

Merge pull request #2616 from Temechon/master

Updated to run the inspector with npm
David Catuhe 8 jaren geleden
bovenliggende
commit
c6cc88ccff

+ 2 - 1
Tools/Gulp/config.json

@@ -1496,7 +1496,8 @@
                     "../../inspector/sass/**/*.scss"
                 ],
                 "output": "babylon.inspector.js",
-                "webpack": "../../inspector/webpack.config.js"
+                "webpack": "../../inspector/webpack.config.js",
+                "bundle":"true"
             }
         ],
         "build": {

+ 23 - 11
Tools/Gulp/gulpfile.js

@@ -292,16 +292,28 @@ var buildExternalLibrary = function (library, settings, watch) {
         return merge2([shader, includeShader, dev, css]);
     }
     else {
-        var code = merge2([tsProcess.js, shader, includeShader])
-            .pipe(concat(library.output))
-            .pipe(gulp.dest(outputDirectory))
-            .pipe(cleants())
-            .pipe(replace(extendsSearchRegex, ""))
-            .pipe(replace(decorateSearchRegex, ""))
-            .pipe(rename({ extname: ".min.js" }))
-            .pipe(uglify())
-            .pipe(optimisejs())
-            .pipe(gulp.dest(outputDirectory));
+        if (library.bundle) {
+            // Don't remove extends and decorate functions
+            var code = merge2([tsProcess.js, shader, includeShader])
+                .pipe(concat(library.output))
+                .pipe(gulp.dest(outputDirectory))
+                .pipe(cleants())
+                .pipe(rename({ extname: ".min.js" }))
+                .pipe(uglify())
+                .pipe(optimisejs())
+                .pipe(gulp.dest(outputDirectory));
+        } else {
+            var code = merge2([tsProcess.js, shader, includeShader])
+                .pipe(concat(library.output))
+                .pipe(gulp.dest(outputDirectory))
+                .pipe(cleants())
+                .pipe(replace(extendsSearchRegex, ""))
+                .pipe(replace(decorateSearchRegex, ""))
+                .pipe(rename({ extname: ".min.js" }))
+                .pipe(uglify())
+                .pipe(optimisejs())
+                .pipe(gulp.dest(outputDirectory));
+        }
 
         var dts = tsProcess.dts
             .pipe(concat(library.output))
@@ -426,7 +438,7 @@ gulp.task('webserver', function () {
     gulp.src('../../.').pipe(webserver({
         port: 1338,
         livereload: false
-        }));
+    }));
 });
 
 /**

File diff suppressed because it is too large
+ 1 - 568
dist/preview release/split.js


+ 1 - 1
inspector/webpack.config.js

@@ -13,7 +13,7 @@ module.exports = {
             split: '../split.js'
         }
     },
-    module: {        
+    module: {
         loaders: [
             { test: /\.css$/, loader: "style!css" },
             { test: /babylon.inspector.min.js$/, loader: "imports?Split=split!exports?INSPECTOR" }

+ 21 - 22
src/Actions/babylon.actionManager.ts

@@ -5,7 +5,6 @@
      */
     export class ActionEvent {
         /**
-         * @constructor
          * @param source The mesh or sprite that triggered the action.
          * @param pointerX The X mouse cursor position at the time of the event
          * @param pointerY The Y mouse cursor position at the time of the event
@@ -306,11 +305,11 @@
 
             this.actions.push(action);
 
-          if(ActionManager.Triggers[action.trigger]) {
-              ActionManager.Triggers[action.trigger]++;
+            if (ActionManager.Triggers[action.trigger]) {
+                ActionManager.Triggers[action.trigger]++;
             }
-            else{
-              ActionManager.Triggers[action.trigger] = 1;
+            else {
+                ActionManager.Triggers[action.trigger] = 1;
             }
 
             action._actionManager = this;
@@ -369,7 +368,7 @@
 
             return properties[properties.length - 1];
         }
-        
+
         public serialize(name: string): any {
             var root = {
                 children: [],
@@ -377,15 +376,15 @@
                 type: 3, // Root node
                 properties: [] // Empty for root but required
             };
-            
+
             for (var i = 0; i < this.actions.length; i++) {
-                var triggerObject = { 
+                var triggerObject = {
                     type: 0, // Trigger
                     children: [],
                     name: ActionManager.GetTriggerName(this.actions[i].trigger),
                     properties: []
                 };
-                
+
                 var triggerOptions = this.actions[i].triggerOptions;
 
                 if (triggerOptions && typeof triggerOptions !== "number") {
@@ -403,14 +402,14 @@
                         triggerObject.properties.push({ name: "parameter", targetType: null, value: parameter });
                     }
                 }
-                
+
                 // Serialize child action, recursively
                 this.actions[i].serialize(triggerObject);
-                
+
                 // Add serialized trigger
                 root.children.push(triggerObject);
             }
-            
+
             return root;
         }
 
@@ -600,16 +599,16 @@
 
         public static GetTriggerName(trigger: number): string {
             switch (trigger) {
-                case 0:  return "NothingTrigger";
-                case 1:  return "OnPickTrigger";
-                case 2:  return "OnLeftPickTrigger";
-                case 3:  return "OnRightPickTrigger";
-                case 4:  return "OnCenterPickTrigger";
-                case 5:  return "OnPickDownTrigger";
-                case 6:  return "OnPickUpTrigger";
-                case 7:  return "OnLongPressTrigger";
-                case 8:  return "OnPointerOverTrigger";
-                case 9:  return "OnPointerOutTrigger";
+                case 0: return "NothingTrigger";
+                case 1: return "OnPickTrigger";
+                case 2: return "OnLeftPickTrigger";
+                case 3: return "OnRightPickTrigger";
+                case 4: return "OnCenterPickTrigger";
+                case 5: return "OnPickDownTrigger";
+                case 6: return "OnPickUpTrigger";
+                case 7: return "OnLongPressTrigger";
+                case 8: return "OnPointerOverTrigger";
+                case 9: return "OnPointerOutTrigger";
                 case 10: return "OnEveryFrameTrigger";
                 case 11: return "OnIntersectionEnterTrigger";
                 case 12: return "OnIntersectionExitTrigger";

+ 68 - 58
src/babylon.engine.ts

@@ -15,7 +15,7 @@
         var magFilter = gl.NEAREST;
         var minFilter = gl.NEAREST;
 
-        switch(samplingMode) {
+        switch (samplingMode) {
             case Texture.BILINEAR_SAMPLINGMODE:
                 magFilter = gl.LINEAR;
                 if (generateMipMaps) {
@@ -38,7 +38,7 @@
                     minFilter = gl.NEAREST_MIPMAP_LINEAR;
                 } else {
                     minFilter = gl.NEAREST;
-                }            
+                }
                 break;
             case Texture.NEAREST_NEAREST_MIPNEAREST:
                 magFilter = gl.NEAREST;
@@ -46,56 +46,56 @@
                     minFilter = gl.NEAREST_MIPMAP_NEAREST;
                 } else {
                     minFilter = gl.NEAREST;
-                }            
-                break;                
+                }
+                break;
             case Texture.NEAREST_LINEAR_MIPNEAREST:
                 magFilter = gl.NEAREST;
                 if (generateMipMaps) {
                     minFilter = gl.LINEAR_MIPMAP_NEAREST;
                 } else {
                     minFilter = gl.LINEAR;
-                }            
-                break;      
+                }
+                break;
             case Texture.NEAREST_LINEAR_MIPLINEAR:
                 magFilter = gl.NEAREST;
                 if (generateMipMaps) {
                     minFilter = gl.LINEAR_MIPMAP_LINEAR;
                 } else {
                     minFilter = gl.LINEAR;
-                }            
-                break;        
+                }
+                break;
             case Texture.NEAREST_LINEAR:
                 magFilter = gl.NEAREST;
                 minFilter = gl.LINEAR;
-                break;                                       
+                break;
             case Texture.NEAREST_NEAREST:
                 magFilter = gl.NEAREST;
                 minFilter = gl.NEAREST;
-                break;                                       
+                break;
             case Texture.LINEAR_NEAREST_MIPNEAREST:
                 magFilter = gl.LINEAR;
                 if (generateMipMaps) {
                     minFilter = gl.NEAREST_MIPMAP_NEAREST;
                 } else {
                     minFilter = gl.NEAREST;
-                }     
-                break;                                       
+                }
+                break;
             case Texture.LINEAR_NEAREST_MIPLINEAR:
                 magFilter = gl.LINEAR;
                 if (generateMipMaps) {
                     minFilter = gl.NEAREST_MIPMAP_LINEAR;
                 } else {
                     minFilter = gl.NEAREST;
-                }     
-                break;   
+                }
+                break;
             case Texture.LINEAR_LINEAR:
                 magFilter = gl.LINEAR;
                 minFilter = gl.LINEAR;
-                break;                                       
+                break;
             case Texture.LINEAR_NEAREST:
                 magFilter = gl.LINEAR;
                 minFilter = gl.NEAREST;
-                break;                          
+                break;
         }
 
         return {
@@ -228,9 +228,14 @@
         attributeName: string;
     }
 
+    /**
+     * Regroup several parameters relative to the browser in use
+     */
     export class EngineCapabilities {
+        /** The maximum textures image */
         public maxTexturesImageUnits: number;
         public maxVertexTextureImageUnits: number;
+        /** The maximum texture size */
         public maxTextureSize: number;
         public maxCubemapTextureSize: number;
         public maxRenderTextureSize: number;
@@ -299,7 +304,7 @@
         /**
          * Will flag all materials in all scenes in all engines as dirty to trigger new shader compilation
          */
-        public static MarkAllMaterialsAsDirty(flag:number, predicate?: (mat: Material) => boolean): void {
+        public static MarkAllMaterialsAsDirty(flag: number, predicate?: (mat: Material) => boolean): void {
             for (var engineIndex = 0; engineIndex < Engine.Instances.length; engineIndex++) {
                 var engine = Engine.Instances[engineIndex];
 
@@ -454,11 +459,11 @@
 
         public static get ALPHA_INTERPOLATE(): number {
             return Engine._ALPHA_INTERPOLATE;
-        }        
+        }
 
         public static get ALPHA_SCREENMODE(): number {
             return Engine._ALPHA_SCREENMODE;
-        }           
+        }
 
         public static get DELAYLOADSTATE_NONE(): number {
             return Engine._DELAYLOADSTATE_NONE;
@@ -520,11 +525,11 @@
 
         public static get SCALEMODE_NEAREST(): number {
             return Engine._SCALEMODE_NEAREST;
-        }      
+        }
 
         public static get SCALEMODE_CEILING(): number {
             return Engine._SCALEMODE_CEILING;
-        }           
+        }
 
         public static get Version(): string {
             return "3.1-alpha";
@@ -707,7 +712,7 @@
          */
         constructor(canvasOrContext: HTMLCanvasElement | WebGLRenderingContext, antialias?: boolean, options?: EngineOptions, adaptToDeviceRatio = false) {
             var canvas: HTMLCanvasElement;
-            Engine.Instances.push(this);            
+            Engine.Instances.push(this);
             options = options || {};
 
             if ((<HTMLCanvasElement>canvasOrContext).getContext) {
@@ -833,9 +838,9 @@
             this._caps.astc = this._gl.getExtension('WEBGL_compressed_texture_astc') || this._gl.getExtension('WEBKIT_WEBGL_compressed_texture_astc');
             this._caps.s3tc = this._gl.getExtension('WEBGL_compressed_texture_s3tc') || this._gl.getExtension('WEBKIT_WEBGL_compressed_texture_s3tc');
             this._caps.pvrtc = this._gl.getExtension('WEBGL_compressed_texture_pvrtc') || this._gl.getExtension('WEBKIT_WEBGL_compressed_texture_pvrtc');
-            this._caps.etc1  = this._gl.getExtension('WEBGL_compressed_texture_etc1' ) || this._gl.getExtension('WEBKIT_WEBGL_compressed_texture_etc1' );
-            this._caps.etc2  = this._gl.getExtension('WEBGL_compressed_texture_etc'  ) || this._gl.getExtension('WEBKIT_WEBGL_compressed_texture_etc'  ) ||
-                               this._gl.getExtension('WEBGL_compressed_texture_es3_0'); // also a requirement of OpenGL ES 3
+            this._caps.etc1 = this._gl.getExtension('WEBGL_compressed_texture_etc1') || this._gl.getExtension('WEBKIT_WEBGL_compressed_texture_etc1');
+            this._caps.etc2 = this._gl.getExtension('WEBGL_compressed_texture_etc') || this._gl.getExtension('WEBKIT_WEBGL_compressed_texture_etc') ||
+                this._gl.getExtension('WEBGL_compressed_texture_es3_0'); // also a requirement of OpenGL ES 3
 
             this._caps.textureAnisotropicFilterExtension = this._gl.getExtension('EXT_texture_filter_anisotropic') || this._gl.getExtension('WEBKIT_EXT_texture_filter_anisotropic') || this._gl.getExtension('MOZ_EXT_texture_filter_anisotropic');
             this._caps.maxAnisotropy = this._caps.textureAnisotropicFilterExtension ? this._gl.getParameter(this._caps.textureAnisotropicFilterExtension.MAX_TEXTURE_MAX_ANISOTROPY_EXT) : 0;
@@ -896,11 +901,11 @@
             // Next PVRTC & DXT, which are probably superior to ETC1/2.  
             // Likely no hardware which supports both PVR & DXT, so order matters little.
             // ETC2 is newer and handles ETC1 (no alpha capability), so check for first.
-            if (this._caps.astc ) this.texturesSupported.push('-astc.ktx');
-            if (this._caps.s3tc ) this.texturesSupported.push('-dxt.ktx');
+            if (this._caps.astc) this.texturesSupported.push('-astc.ktx');
+            if (this._caps.s3tc) this.texturesSupported.push('-dxt.ktx');
             if (this._caps.pvrtc) this.texturesSupported.push('-pvrtc.ktx');
-            if (this._caps.etc2 ) this.texturesSupported.push('-etc2.ktx');
-            if (this._caps.etc1 ) this.texturesSupported.push('-etc1.ktx');
+            if (this._caps.etc2) this.texturesSupported.push('-etc2.ktx');
+            if (this._caps.etc1) this.texturesSupported.push('-etc1.ktx');
 
             if (this._gl.getShaderPrecisionFormat) {
                 var highp = this._gl.getShaderPrecisionFormat(this._gl.FRAGMENT_SHADER, this._gl.HIGH_FLOAT);
@@ -1063,6 +1068,7 @@
             return this._caps;
         }
 
+        /** The number of draw calls submitted last frame */
         public get drawCalls(): number {
             return this._drawCalls.current;
         }
@@ -1420,7 +1426,7 @@
                     Tools.Error("No WebVR devices found!");
                     callback(null);
                 }
-            });            
+            });
         }
 
         public initWebVR(): void {
@@ -1481,7 +1487,7 @@
         public bindFramebuffer(texture: WebGLTexture, faceIndex?: number, requiredWidth?: number, requiredHeight?: number): void {
             if (this._currentRenderTarget) {
                 this.unBindFramebuffer(this._currentRenderTarget);
-            }            
+            }
             this._currentRenderTarget = texture;
             this.bindUnboundFramebuffer(texture._MSAAFramebuffer ? texture._MSAAFramebuffer : texture._framebuffer);
             var gl = this._gl;
@@ -2063,7 +2069,11 @@
             }
         }
 
-        
+
+        /**
+         * @param baseName The base name of the effect (The name of file without .fragment.fx or .vertex.fx)
+         * @param samplers An array of string used to represent textures
+         */
         public createEffect(baseName: any, attributesNamesOrOptions: string[] | EffectCreationOptions, uniformsNamesOrEngine: string[] | Engine, samplers?: string[], defines?: string, fallbacks?: EffectFallbacks,
             onCompiled?: (effect: Effect) => void, onError?: (effect: Effect, errors: string) => void, indexParameters?: any): Effect {
             var vertex = baseName.vertexElement || baseName.vertex || baseName;
@@ -2348,7 +2358,7 @@
             this._depthCullingState.zOffset = value;
         }
 
-        public getZOffset():number {
+        public getZOffset(): number {
             return this._depthCullingState.zOffset;
         }
 
@@ -2416,11 +2426,11 @@
                 case Engine.ALPHA_INTERPOLATE:
                     this._alphaState.setAlphaBlendFunctionParameters(this._gl.CONSTANT_COLOR, this._gl.ONE_MINUS_CONSTANT_COLOR, this._gl.CONSTANT_ALPHA, this._gl.ONE_MINUS_CONSTANT_ALPHA);
                     this._alphaState.alphaBlend = true;
-                    break;    
+                    break;
                 case Engine.ALPHA_SCREENMODE:
                     this._alphaState.setAlphaBlendFunctionParameters(this._gl.ONE, this._gl.ONE_MINUS_SRC_COLOR, this._gl.ONE, this._gl.ONE_MINUS_SRC_ALPHA);
                     this._alphaState.alphaBlend = true;
-                    break;                                      
+                    break;
             }
             if (!noDepthWriteChange) {
                 this.setDepthWrite(mode === Engine.ALPHA_DISABLE);
@@ -2532,7 +2542,7 @@
             var extension = (lastDot > 0) ? url.substring(lastDot).toLowerCase() : "";
             var isDDS = this.getCaps().s3tc && (extension === ".dds");
             var isTGA = (extension === ".tga");
-            
+
             // determine if a ktx file should be substituted
             var isKTX = false;
             if (this._textureFormatInUse && !isBase64 && !fallBack) {
@@ -2546,7 +2556,7 @@
             texture.references = 1;
             texture.samplingMode = samplingMode;
             texture.onLoadedCallbacks = [];
-           
+
             if (onLoad) {
                 texture.onLoadedCallbacks.push(onLoad);
             }
@@ -2562,7 +2572,7 @@
                     onError();
                 }
             };
-            
+
             var callback: (arrayBuffer: any) => void;
 
             // processing for non-image formats
@@ -2590,10 +2600,10 @@
                     callback = (data) => {
                         var info = Internals.DDSTools.GetDDSInfo(data);
 
-                         var loadMipmap = (info.isRGB || info.isLuminance || info.mipmapCount > 1) && !noMipmap && ((info.width >> (info.mipmapCount - 1)) === 1);
-                         prepareWebGLTexture(texture, this._gl, scene, info.width, info.height, invertY, !loadMipmap, info.isFourCC, () => {
-                             Internals.DDSTools.UploadDDSLevels(this, data, info, loadMipmap, 1);
-                         }, samplingMode);
+                        var loadMipmap = (info.isRGB || info.isLuminance || info.mipmapCount > 1) && !noMipmap && ((info.width >> (info.mipmapCount - 1)) === 1);
+                        prepareWebGLTexture(texture, this._gl, scene, info.width, info.height, invertY, !loadMipmap, info.isFourCC, () => {
+                            Internals.DDSTools.UploadDDSLevels(this, data, info, loadMipmap, 1);
+                        }, samplingMode);
                     };
                 }
 
@@ -2604,7 +2614,7 @@
                 } else {
                     callback(buffer);
                 }
-            // image format processing
+                // image format processing
             } else {
                 var onload = (img) => {
                     prepareWebGLTexture(texture, this._gl, scene, img.width, img.height, invertY, noMipmap, false, (potWidth, potHeight) => {
@@ -2633,7 +2643,7 @@
                             }
                         }
 
-                        let internalFormat = format ? this._getInternalFormat(format) : ((extension === ".jpg") ? this._gl.RGB :this._gl.RGBA);
+                        let internalFormat = format ? this._getInternalFormat(format) : ((extension === ".jpg") ? this._gl.RGB : this._gl.RGBA);
                         this._gl.texImage2D(this._gl.TEXTURE_2D, 0, internalFormat, internalFormat, this._gl.UNSIGNED_BYTE, isPot ? img : this._workingCanvas);
                     }, samplingMode);
                 };
@@ -2643,7 +2653,7 @@
                 else if (buffer instanceof Array || typeof buffer === "string")
                     Tools.LoadImage(buffer, onload, onerror, scene.database);
                 else
-                    onload(buffer);                
+                    onload(buffer);
             }
 
             return texture;
@@ -2961,7 +2971,7 @@
 
             var width = size.width || size;
             var height = size.height || size;
-            
+
             var textures = [];
             var attachments = []
 
@@ -3000,7 +3010,7 @@
                 gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);
 
                 gl.texImage2D(gl.TEXTURE_2D, 0, this._getRGBABufferInternalSizedFormat(type), width, height, 0, gl.RGBA, this._getWebGLTextureType(type), null);
-            
+
                 gl.framebufferTexture2D(gl.DRAW_FRAMEBUFFER, attachment, gl.TEXTURE_2D, texture, 0);
 
                 if (generateMipMaps) {
@@ -3255,7 +3265,7 @@
                 }
 
                 const mipSlices = 3;
-                
+
                 var gl = this._gl;
                 const width = loadData.width;
                 if (!width) {
@@ -3568,8 +3578,8 @@
 
         public createRawCubeTextureFromUrl(url: string, scene: Scene, size: number, format: number, type: number, noMipmap: boolean,
             callback: (ArrayBuffer: ArrayBuffer) => ArrayBufferView[],
-            mipmmapGenerator: ((faces: ArrayBufferView[]) => ArrayBufferView[][]), 
-            onLoad: () => void = null, 
+            mipmmapGenerator: ((faces: ArrayBufferView[]) => ArrayBufferView[][]),
+            onLoad: () => void = null,
             onError: () => void = null,
             samplingMode = Texture.TRILINEAR_SAMPLINGMODE,
             invertY = false): WebGLTexture {
@@ -3586,7 +3596,7 @@
                     onError();
                 }
             };
-            
+
             var internalCallback = (data) => {
                 var width = texture._width;
                 var height = texture._height;
@@ -3605,7 +3615,7 @@
 
                     this._bindTextureDirectly(gl.TEXTURE_CUBE_MAP, texture);
                     gl.pixelStorei(gl.UNPACK_FLIP_Y_WEBGL, 0);
-                    
+
                     var mipData = mipmmapGenerator(faceDataArrays);
                     for (var level = 0; level < mipData.length; level++) {
                         var mipSize = width >> level;
@@ -3677,7 +3687,7 @@
             if (texture._framebuffer) {
                 gl.deleteFramebuffer(texture._framebuffer);
                 texture._framebuffer = null;
-            }            
+            }
 
             if (texture._depthStencilBuffer) {
                 gl.deleteRenderbuffer(texture._depthStencilBuffer);
@@ -3692,7 +3702,7 @@
             if (texture._MSAARenderBuffer) {
                 gl.deleteRenderbuffer(texture._MSAARenderBuffer);
                 texture._MSAARenderBuffer = null;
-            }            
+            }
         }
 
         public _releaseTexture(texture: WebGLTexture): void {
@@ -3807,7 +3817,7 @@
             }
 
 
-            var internalTexture = texture.isReady() ? texture.getInternalTexture() : 
+            var internalTexture = texture.isReady() ? texture.getInternalTexture() :
                 (texture.isCube ? this.emptyCubeTexture : this.emptyTexture);
 
             if (this._activeTexturesCache[channel] === internalTexture) {
@@ -3955,7 +3965,7 @@
             if (!this._externalData) {
                 this._externalData = new StringDictionary<Object>();
             }
-            
+
             return this._externalData.remove(key);
         }
 
@@ -4088,7 +4098,7 @@
         }
 
         public get loadingScreen(): ILoadingScreen {
-            if (!this._loadingScreen && DefaultLoadingScreen) 
+            if (!this._loadingScreen && DefaultLoadingScreen)
                 this._loadingScreen = new DefaultLoadingScreen(this._renderingCanvas)
             return this._loadingScreen;
         }
@@ -4127,7 +4137,7 @@
 
         public getError(): number {
             return this._gl.getError();
-        }        
+        }
 
         // FPS
         public getFps(): number {

+ 180 - 153
src/babylon.scene.ts

@@ -15,10 +15,10 @@
         public get doubleClick(): boolean {
             return this._doubleClick;
         }
-        public get hasSwiped(): boolean{
+        public get hasSwiped(): boolean {
             return this._hasSwiped;
         }
-        public get ignore(): boolean{
+        public get ignore(): boolean {
             return this._ignore;
         }
 
@@ -64,7 +64,7 @@
         public static get POINTERPICK(): number {
             return PointerEventTypes._POINTERPICK;
         }
-        
+
         public static get POINTERTAP(): number {
             return PointerEventTypes._POINTERTAP;
         }
@@ -168,18 +168,22 @@
         public static MinDeltaTime = 1.0;
         public static MaxDeltaTime = 1000.0;
 
+        /** The fog is deactivated */
         public static get FOGMODE_NONE(): number {
             return Scene._FOGMODE_NONE;
         }
 
+        /** The fog density is following an exponential function */
         public static get FOGMODE_EXP(): number {
             return Scene._FOGMODE_EXP;
         }
 
+        /** The fog density is following an exponential function faster than FOGMODE_EXP */
         public static get FOGMODE_EXP2(): number {
             return Scene._FOGMODE_EXP2;
         }
 
+        /** The fog density is following a linear function. */
         public static get FOGMODE_LINEAR(): number {
             return Scene._FOGMODE_LINEAR;
         }
@@ -226,7 +230,7 @@
 
         public forceWireframe = false;
         private _forcePointsCloud = false;
-        public set forcePointsCloud(value : boolean) {
+        public set forcePointsCloud(value: boolean) {
             if (this._forcePointsCloud === value) {
                 return;
             }
@@ -235,7 +239,7 @@
         }
         public get forcePointsCloud(): boolean {
             return this._forcePointsCloud;
-        }   
+        }
 
         public forceShowBoundingBoxes = false;
         public clipPlane: Plane;
@@ -257,6 +261,7 @@
         public onDisposeObservable = new Observable<Scene>();
 
         private _onDisposeObserver: Observer<Scene>;
+        /** A function to be executed when this scene is disposed. */
         public set onDispose(callback: () => void) {
             if (this._onDisposeObserver) {
                 this.onDisposeObservable.remove(this._onDisposeObserver);
@@ -271,6 +276,7 @@
         public onBeforeRenderObservable = new Observable<Scene>();
 
         private _onBeforeRenderObserver: Observer<Scene>;
+        /** A function to be executed before rendering this scene */
         public set beforeRender(callback: () => void) {
             if (this._onBeforeRenderObserver) {
                 this.onBeforeRenderObservable.remove(this._onBeforeRenderObserver);
@@ -285,6 +291,7 @@
         public onAfterRenderObservable = new Observable<Scene>();
 
         private _onAfterRenderObserver: Observer<Scene>;
+        /** A function to be executed after rendering this scene */
         public set afterRender(callback: () => void) {
             if (this._onAfterRenderObserver) {
                 this.onAfterRenderObservable.remove(this._onAfterRenderObserver);
@@ -393,9 +400,13 @@
         private _onPointerDown: (evt: PointerEvent) => void;
         private _onPointerUp: (evt: PointerEvent) => void;
 
+        /** Deprecated. Use onPointerObservable instead */
         public onPointerMove: (evt: PointerEvent, pickInfo: PickingInfo) => void;
+        /** Deprecated. Use onPointerObservable instead */
         public onPointerDown: (evt: PointerEvent, pickInfo: PickingInfo) => void;
+        /** Deprecated. Use onPointerObservable instead */
         public onPointerUp: (evt: PointerEvent, pickInfo: PickingInfo) => void;
+        /** Deprecated. Use onPointerObservable instead */
         public onPointerPick: (evt: PointerEvent, pickInfo: PickingInfo) => void;
 
         /**
@@ -413,10 +424,14 @@
             return new Vector2(this._unTranslatedPointerX, this._unTranslatedPointerY);
         }
 
+        /** The distance in pixel that you have to move to prevent some events */
         public static DragMovementThreshold = 10; // in pixels
+        /** Time in milliseconds to wait to raise long press events if button is still pressed */
         public static LongPressDelay = 500; // in milliseconds
+        /** Time in milliseconds with two consecutive clicks will be considered as a double click */
         public static DoubleClickDelay = 300; // in milliseconds
-        public static ExclusiveDoubleClickMode = false; // If you need to check double click without raising a single click at first click, enable this flag
+        /** If you need to check double click without raising a single click at first click, enable this flag */
+        public static ExclusiveDoubleClickMode = false;
 
         private _initClickEvent: (obs1: Observable<PointerInfoPre>, obs2: Observable<PointerInfo>, evt: PointerEvent, cb: (clickInfo: ClickInfo, pickResult: PointerInfo) => void) => void;
         private _initActionManager: (act: ActionManager, clickInfo: ClickInfo) => ActionManager;
@@ -432,7 +447,8 @@
         private _isButtonPressed = false;
         private _doubleClickOccured = false;
 
-        public cameraToUseForPointers: Camera = null; // Define this parameter if you are using multiple cameras and you want to specify which one should be used for pointer position
+        /** Define this parameter if you are using multiple cameras and you want to specify which one should be used for pointer position */
+        public cameraToUseForPointers: Camera = null;
         private _pointerX: number;
         private _pointerY: number;
         private _unTranslatedPointerX: number;
@@ -441,7 +457,7 @@
         private _previousStartingPointerPosition = new Vector2(0, 0);
         private _startingPointerTime = 0;
         private _previousStartingPointerTime = 0;
-        
+
         // Mirror
         public _mirroredCameraPosition: Vector3;
 
@@ -467,12 +483,12 @@
         }
 
         // Fog
+
+        private _fogEnabled = true;
         /**
         * is fog enabled on this scene.
-        * @type {boolean}
         */
-        private _fogEnabled = true;
-        public set fogEnabled(value : boolean) {
+        public set fogEnabled(value: boolean) {
             if (this._fogEnabled === value) {
                 return;
             }
@@ -481,10 +497,10 @@
         }
         public get fogEnabled(): boolean {
             return this._fogEnabled;
-        }   
+        }
 
         private _fogMode = Scene.FOGMODE_NONE;
-        public set fogMode(value : number) {
+        public set fogMode(value: number) {
             if (this._fogMode === value) {
                 return;
             }
@@ -493,7 +509,7 @@
         }
         public get fogMode(): number {
             return this._fogMode;
-        }  
+        }
 
         public fogColor = new Color3(0.2, 0.2, 0.3);
         public fogDensity = 0.1;
@@ -506,7 +522,7 @@
         * @type {boolean}
         */
         private _shadowsEnabled = true;
-        public set shadowsEnabled(value : boolean) {
+        public set shadowsEnabled(value: boolean) {
             if (this._shadowsEnabled === value) {
                 return;
             }
@@ -515,14 +531,14 @@
         }
         public get shadowsEnabled(): boolean {
             return this._shadowsEnabled;
-        }       
+        }
 
         /**
         * is light enabled on this scene.
         * @type {boolean}
         */
         private _lightsEnabled = true;
-        public set lightsEnabled(value : boolean) {
+        public set lightsEnabled(value: boolean) {
             if (this._lightsEnabled === value) {
                 return;
             }
@@ -542,13 +558,11 @@
         public lights = new Array<Light>();
 
         // Cameras
-        /**
-        * All of the cameras added to this scene.
-        * @see BABYLON.Camera
-        * @type {BABYLON.Camera[]}
-        */
+        /** All of the cameras added to this scene. */
         public cameras = new Array<Camera>();
+        /** All of the active cameras added to this scene. */
         public activeCameras = new Array<Camera>();
+        /** The current active camera */
         public activeCamera: Camera;
 
         // Meshes
@@ -566,6 +580,7 @@
         public multiMaterials = new Array<MultiMaterial>();
         private _defaultMaterial: Material;
 
+        /** The default material used on meshes when no material is affected */
         public get defaultMaterial(): Material {
             if (!this._defaultMaterial) {
                 this._defaultMaterial = new StandardMaterial("default material", this);
@@ -574,13 +589,14 @@
             return this._defaultMaterial;
         }
 
+        /** The default material used on meshes when no material is affected */
         public set defaultMaterial(value: Material) {
             this._defaultMaterial = value;
         }
 
         // Textures
         private _texturesEnabled = true;
-        public set texturesEnabled(value : boolean) {
+        public set texturesEnabled(value: boolean) {
             if (this._texturesEnabled === value) {
                 return;
             }
@@ -590,7 +606,7 @@
 
         public get texturesEnabled(): boolean {
             return this._texturesEnabled;
-        }     
+        }
 
         public textures = new Array<BaseTexture>();
 
@@ -608,7 +624,7 @@
 
         // Skeletons
         private _skeletonsEnabled = true;
-        public set skeletonsEnabled(value : boolean) {
+        public set skeletonsEnabled(value: boolean) {
             if (this._skeletonsEnabled === value) {
                 return;
             }
@@ -618,7 +634,7 @@
 
         public get skeletonsEnabled(): boolean {
             return this._skeletonsEnabled;
-        }       
+        }
 
         public skeletons = new Array<Skeleton>();
 
@@ -633,6 +649,7 @@
         public collisionsEnabled = true;
         private _workerCollisions;
         public collisionCoordinator: ICollisionCoordinator;
+        /** Defines the gravity applied to this scene */
         public gravity = new Vector3(0, -9.807, 0);
 
         // Postprocesses
@@ -742,13 +759,13 @@
         private _sceneUbo: UniformBuffer;
 
         private _pickWithRayInverseMatrix: Matrix;
-        
+
         private _boundingBoxRenderer: BoundingBoxRenderer;
         private _outlineRenderer: OutlineRenderer;
 
         private _viewMatrix: Matrix;
         private _projectionMatrix: Matrix;
-        
+
         private _frustumPlanes: Plane[];
         public get frustumPlanes(): Plane[] {
             return this._frustumPlanes;
@@ -1040,7 +1057,7 @@
             this._delayedSimpleClick = (btn: number, clickInfo: ClickInfo, cb: (clickInfo: ClickInfo, pickResult: PointerInfo) => void) => {
                 // double click delay is over and that no double click has been raised since, or the 2 consecutive keys pressed are different
                 if ((new Date().getTime() - this._previousStartingPointerTime > Scene.DoubleClickDelay && !this._doubleClickOccured) ||
-                btn !== this._previousButtonPressed ) {
+                    btn !== this._previousButtonPressed) {
                     this._doubleClickOccured = false;
                     clickInfo.singleClick = true;
                     clickInfo.ignore = false;
@@ -1049,99 +1066,79 @@
             }
 
             this._initClickEvent = (obs1: Observable<PointerInfoPre>, obs2: Observable<PointerInfo>, evt: PointerEvent, cb: (clickInfo: ClickInfo, pickResult: PointerInfo) => void): void => {
-                    let clickInfo = new ClickInfo();
-                    this._currentPickResult = null;
-                    let act;
-
-                    let checkPicking = obs1.hasSpecificMask(PointerEventTypes.POINTERPICK) || obs2.hasSpecificMask(PointerEventTypes.POINTERPICK)
-                                    || obs1.hasSpecificMask(PointerEventTypes.POINTERTAP) || obs2.hasSpecificMask(PointerEventTypes.POINTERTAP)
-                                    || obs1.hasSpecificMask(PointerEventTypes.POINTERDOUBLETAP) || obs2.hasSpecificMask(PointerEventTypes.POINTERDOUBLETAP);
-                    if (!checkPicking && BABYLON.ActionManager && ActionManager.HasPickTriggers) {
-                        act = this._initActionManager(act, clickInfo);
-                        if (act)
-                            checkPicking = act.hasPickTriggers;
-                    }
-                    if (checkPicking) {
-                        let btn = evt.button;
-                        clickInfo.hasSwiped = Math.abs(this._startingPointerPosition.x - this._pointerX) > Scene.DragMovementThreshold ||
-                                              Math.abs(this._startingPointerPosition.y - this._pointerY) > Scene.DragMovementThreshold;
-
-                        if (!clickInfo.hasSwiped) {
-                            let checkSingleClickImmediately = !Scene.ExclusiveDoubleClickMode;
-
-                            if (!checkSingleClickImmediately) {
-                                checkSingleClickImmediately = !obs1.hasSpecificMask(PointerEventTypes.POINTERDOUBLETAP) &&
-                                                              !obs2.hasSpecificMask(PointerEventTypes.POINTERDOUBLETAP);
-
-                                if (checkSingleClickImmediately && !ActionManager.HasSpecificTrigger(ActionManager.OnDoublePickTrigger)) {
-                                    act = this._initActionManager(act, clickInfo);
-                                    if (act)
-                                        checkSingleClickImmediately = !act.hasSpecificTrigger(ActionManager.OnDoublePickTrigger);
-                                }
+                let clickInfo = new ClickInfo();
+                this._currentPickResult = null;
+                let act;
+
+                let checkPicking = obs1.hasSpecificMask(PointerEventTypes.POINTERPICK) || obs2.hasSpecificMask(PointerEventTypes.POINTERPICK)
+                    || obs1.hasSpecificMask(PointerEventTypes.POINTERTAP) || obs2.hasSpecificMask(PointerEventTypes.POINTERTAP)
+                    || obs1.hasSpecificMask(PointerEventTypes.POINTERDOUBLETAP) || obs2.hasSpecificMask(PointerEventTypes.POINTERDOUBLETAP);
+                if (!checkPicking && BABYLON.ActionManager && ActionManager.HasPickTriggers) {
+                    act = this._initActionManager(act, clickInfo);
+                    if (act)
+                        checkPicking = act.hasPickTriggers;
+                }
+                if (checkPicking) {
+                    let btn = evt.button;
+                    clickInfo.hasSwiped = Math.abs(this._startingPointerPosition.x - this._pointerX) > Scene.DragMovementThreshold ||
+                        Math.abs(this._startingPointerPosition.y - this._pointerY) > Scene.DragMovementThreshold;
+
+                    if (!clickInfo.hasSwiped) {
+                        let checkSingleClickImmediately = !Scene.ExclusiveDoubleClickMode;
+
+                        if (!checkSingleClickImmediately) {
+                            checkSingleClickImmediately = !obs1.hasSpecificMask(PointerEventTypes.POINTERDOUBLETAP) &&
+                                !obs2.hasSpecificMask(PointerEventTypes.POINTERDOUBLETAP);
+
+                            if (checkSingleClickImmediately && !ActionManager.HasSpecificTrigger(ActionManager.OnDoublePickTrigger)) {
+                                act = this._initActionManager(act, clickInfo);
+                                if (act)
+                                    checkSingleClickImmediately = !act.hasSpecificTrigger(ActionManager.OnDoublePickTrigger);
                             }
+                        }
 
-                            if (checkSingleClickImmediately) {
-                                // single click detected if double click delay is over or two different successive keys pressed without exclusive double click or no double click required
-                                if (new Date().getTime() - this._previousStartingPointerTime > Scene.DoubleClickDelay ||
-                                    btn !== this._previousButtonPressed ) {
-                                        clickInfo.singleClick = true;
-                                        cb(clickInfo, this._currentPickResult);
-                                }
-                            }
-                            // at least one double click is required to be check and exclusive double click is enabled
-                            else {
-                                // wait that no double click has been raised during the double click delay
-                                this._previousDelayedSimpleClickTimeout = this._delayedSimpleClickTimeout;
-                                this._delayedSimpleClickTimeout = window.setTimeout(this._delayedSimpleClick.bind(this, btn, clickInfo, cb), Scene.DoubleClickDelay);
+                        if (checkSingleClickImmediately) {
+                            // single click detected if double click delay is over or two different successive keys pressed without exclusive double click or no double click required
+                            if (new Date().getTime() - this._previousStartingPointerTime > Scene.DoubleClickDelay ||
+                                btn !== this._previousButtonPressed) {
+                                clickInfo.singleClick = true;
+                                cb(clickInfo, this._currentPickResult);
                             }
+                        }
+                        // at least one double click is required to be check and exclusive double click is enabled
+                        else {
+                            // wait that no double click has been raised during the double click delay
+                            this._previousDelayedSimpleClickTimeout = this._delayedSimpleClickTimeout;
+                            this._delayedSimpleClickTimeout = window.setTimeout(this._delayedSimpleClick.bind(this, btn, clickInfo, cb), Scene.DoubleClickDelay);
+                        }
 
-                            let checkDoubleClick = obs1.hasSpecificMask(PointerEventTypes.POINTERDOUBLETAP) ||
-                                                   obs2.hasSpecificMask(PointerEventTypes.POINTERDOUBLETAP);
-                            if (!checkDoubleClick && ActionManager.HasSpecificTrigger(ActionManager.OnDoublePickTrigger)){
-                                act = this._initActionManager(act, clickInfo);
-                                if (act)
-                                    checkDoubleClick = act.hasSpecificTrigger(ActionManager.OnDoublePickTrigger);
-                            }
-                            if (checkDoubleClick) {
-                                // two successive keys pressed are equal, double click delay is not over and double click has not just occurred
-                                if (btn === this._previousButtonPressed &&
-                                    new Date().getTime() - this._previousStartingPointerTime < Scene.DoubleClickDelay &&
-                                    !this._doubleClickOccured
-                                ) {
-                                    // pointer has not moved for 2 clicks, it's a double click
-                                    if (!clickInfo.hasSwiped &&
-                                        Math.abs(this._previousStartingPointerPosition.x - this._startingPointerPosition.x) < Scene.DragMovementThreshold &&
-                                        Math.abs(this._previousStartingPointerPosition.y - this._startingPointerPosition.y) < Scene.DragMovementThreshold) {
-                                        this._previousStartingPointerTime = 0;
-                                        this._doubleClickOccured = true;
-                                        clickInfo.doubleClick = true;
-                                        clickInfo.ignore = false;
-                                        if (Scene.ExclusiveDoubleClickMode && this._previousDelayedSimpleClickTimeout && this._previousDelayedSimpleClickTimeout.clearTimeout)
-                                            this._previousDelayedSimpleClickTimeout.clearTimeout();
-                                        this._previousDelayedSimpleClickTimeout = this._delayedSimpleClickTimeout;
-                                        cb(clickInfo, this._currentPickResult);
-                                    }
-                                    // if the two successive clicks are too far, it's just two simple clicks
-                                    else {
-                                        this._doubleClickOccured = false;
-                                        this._previousStartingPointerTime = this._startingPointerTime;
-                                        this._previousStartingPointerPosition.x = this._startingPointerPosition.x;
-                                        this._previousStartingPointerPosition.y = this._startingPointerPosition.y;
-                                        this._previousButtonPressed = btn;
-                                        this._previousHasSwiped = clickInfo.hasSwiped;
-                                        if (Scene.ExclusiveDoubleClickMode){
-                                            if (this._previousDelayedSimpleClickTimeout && this._previousDelayedSimpleClickTimeout.clearTimeout) {
-                                                this._previousDelayedSimpleClickTimeout.clearTimeout();
-                                            }
-                                            this._previousDelayedSimpleClickTimeout = this._delayedSimpleClickTimeout;
-                                            cb(clickInfo, this._previousPickResult);
-                                        }
-                                        else {
-                                            cb(clickInfo, this._currentPickResult);
-                                        }
-                                    }
+                        let checkDoubleClick = obs1.hasSpecificMask(PointerEventTypes.POINTERDOUBLETAP) ||
+                            obs2.hasSpecificMask(PointerEventTypes.POINTERDOUBLETAP);
+                        if (!checkDoubleClick && ActionManager.HasSpecificTrigger(ActionManager.OnDoublePickTrigger)) {
+                            act = this._initActionManager(act, clickInfo);
+                            if (act)
+                                checkDoubleClick = act.hasSpecificTrigger(ActionManager.OnDoublePickTrigger);
+                        }
+                        if (checkDoubleClick) {
+                            // two successive keys pressed are equal, double click delay is not over and double click has not just occurred
+                            if (btn === this._previousButtonPressed &&
+                                new Date().getTime() - this._previousStartingPointerTime < Scene.DoubleClickDelay &&
+                                !this._doubleClickOccured
+                            ) {
+                                // pointer has not moved for 2 clicks, it's a double click
+                                if (!clickInfo.hasSwiped &&
+                                    Math.abs(this._previousStartingPointerPosition.x - this._startingPointerPosition.x) < Scene.DragMovementThreshold &&
+                                    Math.abs(this._previousStartingPointerPosition.y - this._startingPointerPosition.y) < Scene.DragMovementThreshold) {
+                                    this._previousStartingPointerTime = 0;
+                                    this._doubleClickOccured = true;
+                                    clickInfo.doubleClick = true;
+                                    clickInfo.ignore = false;
+                                    if (Scene.ExclusiveDoubleClickMode && this._previousDelayedSimpleClickTimeout && this._previousDelayedSimpleClickTimeout.clearTimeout)
+                                        this._previousDelayedSimpleClickTimeout.clearTimeout();
+                                    this._previousDelayedSimpleClickTimeout = this._delayedSimpleClickTimeout;
+                                    cb(clickInfo, this._currentPickResult);
                                 }
-                                // just the first click of the double has been raised
+                                // if the two successive clicks are too far, it's just two simple clicks
                                 else {
                                     this._doubleClickOccured = false;
                                     this._previousStartingPointerTime = this._startingPointerTime;
@@ -1149,12 +1146,32 @@
                                     this._previousStartingPointerPosition.y = this._startingPointerPosition.y;
                                     this._previousButtonPressed = btn;
                                     this._previousHasSwiped = clickInfo.hasSwiped;
+                                    if (Scene.ExclusiveDoubleClickMode) {
+                                        if (this._previousDelayedSimpleClickTimeout && this._previousDelayedSimpleClickTimeout.clearTimeout) {
+                                            this._previousDelayedSimpleClickTimeout.clearTimeout();
+                                        }
+                                        this._previousDelayedSimpleClickTimeout = this._delayedSimpleClickTimeout;
+                                        cb(clickInfo, this._previousPickResult);
+                                    }
+                                    else {
+                                        cb(clickInfo, this._currentPickResult);
+                                    }
                                 }
                             }
+                            // just the first click of the double has been raised
+                            else {
+                                this._doubleClickOccured = false;
+                                this._previousStartingPointerTime = this._startingPointerTime;
+                                this._previousStartingPointerPosition.x = this._startingPointerPosition.x;
+                                this._previousStartingPointerPosition.y = this._startingPointerPosition.y;
+                                this._previousButtonPressed = btn;
+                                this._previousHasSwiped = clickInfo.hasSwiped;
+                            }
                         }
                     }
-                    clickInfo.ignore = true;
-                    cb(clickInfo, this._currentPickResult);
+                }
+                clickInfo.ignore = true;
+                cb(clickInfo, this._currentPickResult);
             };
 
             var spritePredicate = (sprite: Sprite): boolean => {
@@ -1296,9 +1313,9 @@
                                     if (this._isButtonPressed &&
                                         ((new Date().getTime() - this._startingPointerTime) > Scene.LongPressDelay) &&
                                         (Math.abs(this._startingPointerPosition.x - this._pointerX) < Scene.DragMovementThreshold &&
-                                         Math.abs(this._startingPointerPosition.y - this._pointerY) < Scene.DragMovementThreshold)) {
-                                            this._startingPointerTime = 0;
-                                            actionManager.processTrigger(ActionManager.OnLongPressTrigger, ActionEvent.CreateNew(pickResult.pickedMesh, evt));
+                                            Math.abs(this._startingPointerPosition.y - this._pointerY) < Scene.DragMovementThreshold)) {
+                                        this._startingPointerTime = 0;
+                                        actionManager.processTrigger(ActionManager.OnLongPressTrigger, ActionEvent.CreateNew(pickResult.pickedMesh, evt));
                                     }
                                 }
                             }).bind(this), Scene.LongPressDelay);
@@ -1350,7 +1367,7 @@
 
                 this._updatePointerPosition(evt);
 
-                this._initClickEvent(this.onPrePointerObservable, this.onPointerObservable,  evt, (function(clickInfo, pickResult){
+                this._initClickEvent(this.onPrePointerObservable, this.onPointerObservable, evt, (function (clickInfo, pickResult) {
                     // PreObservable support
                     if (this.onPrePointerObservable.hasObservers()) {
                         if (!clickInfo.ignore) {
@@ -1426,7 +1443,7 @@
                         }
                     }
                     if (this._pickedDownMesh &&
-                        this._pickedDownMesh.actionManager && 
+                        this._pickedDownMesh.actionManager &&
                         this._pickedDownMesh.actionManager.hasSpecificTrigger(ActionManager.OnPickOutTrigger) &&
                         this._pickedDownMesh !== this._pickedUpMesh) {
                         this._pickedDownMesh.actionManager.processTrigger(ActionManager.OnPickOutTrigger, ActionEvent.CreateNew(this._pickedDownMesh, evt));
@@ -1653,13 +1670,12 @@
          * @param {number} [speedRatio] - the speed in which to run the animation
          * @param {Function} [onAnimationEnd] function to be executed when the animation ended.
          * @param {BABYLON.Animatable} [animatable] an animatable object. If not provided a new one will be created from the given params.
-         * @return {BABYLON.Animatable} the animatable object created for this animation
-         * @see BABYLON.Animatable
-         * @see http://doc.babylonjs.com/page.php?p=22081
+         * Returns {BABYLON.Animatable} the animatable object created for this animation
+         * See BABYLON.Animatable
          */
         public beginAnimation(target: any, from: number, to: number, loop?: boolean, speedRatio: number = 1.0, onAnimationEnd?: () => void, animatable?: Animatable): Animatable {
 
-            if(from > to && speedRatio > 0){
+            if (from > to && speedRatio > 0) {
                 speedRatio *= -1;
             }
 
@@ -1889,7 +1905,7 @@
         }
 
         public sortLightsByPriority(): void {
-            if(this.requireLightSorting) {
+            if (this.requireLightSorting) {
                 this.lights.sort(Light.compareLightsPriority);
             }
         }
@@ -2914,9 +2930,9 @@
 
             // Physics
             if (this._physicsEngine) {
-               Tools.StartPerformanceCounter("Physics");
-               this._physicsEngine._step(deltaTime / 1000.0);
-               Tools.EndPerformanceCounter("Physics");
+                Tools.StartPerformanceCounter("Physics");
+                this._physicsEngine._step(deltaTime / 1000.0);
+                Tools.EndPerformanceCounter("Physics");
             }
 
             // Before render
@@ -3489,7 +3505,7 @@
         private _internalMultiPick(rayFunction: (world: Matrix) => Ray, predicate: (mesh: AbstractMesh) => boolean): PickingInfo[] {
             if (!BABYLON.PickingInfo) {
                 return null;
-            }            
+            }
             var pickingInfos = new Array<PickingInfo>();
 
             for (var meshIndex = 0; meshIndex < this.meshes.length; meshIndex++) {
@@ -3552,26 +3568,33 @@
             return pickingInfo || new PickingInfo();
         }
 
-        /// <summary>Launch a ray to try to pick a mesh in the scene</summary>
-        /// <param name="x">X position on screen</param>
-        /// <param name="y">Y position on screen</param>
-        /// <param name="predicate">Predicate function used to determine eligible meshes. Can be set to null. In this case, a mesh must be enabled, visible and with isPickable set to true</param>
-        /// <param name="fastCheck">Launch a fast check only using the bounding boxes. Can be set to null.</param>
-        /// <param name="camera">camera to use for computing the picking ray. Can be set to null. In this case, the scene.activeCamera will be used</param>
+        /** Launch a ray to try to pick a mesh in the scene
+         * @param x position on screen
+         * @param y position on screen
+         * @param predicate Predicate function used to determine eligible meshes. Can be set to null. In this case, a mesh must be enabled, visible and with isPickable set to true
+         * @param fastCheck Launch a fast check only using the bounding boxes. Can be set to null.
+         * @param camera to use for computing the picking ray. Can be set to null. In this case, the scene.activeCamera will be used
+         */
         public pick(x: number, y: number, predicate?: (mesh: AbstractMesh) => boolean, fastCheck?: boolean, camera?: Camera): PickingInfo {
             return this._internalPick(world => this.createPickingRay(x, y, world, camera), predicate, fastCheck);
         }
 
-        /// <summary>Launch a ray to try to pick a mesh in the scene</summary>
-        /// <param name="x">X position on screen</param>
-        /// <param name="y">Y position on screen</param>
-        /// <param name="predicate">Predicate function used to determine eligible sprites. Can be set to null. In this case, a sprite must have isPickable set to true</param>
-        /// <param name="fastCheck">Launch a fast check only using the bounding boxes. Can be set to null.</param>
-        /// <param name="camera">camera to use for computing the picking ray. Can be set to null. In this case, the scene.activeCamera will be used</param>
+        /** Launch a ray to try to pick a sprite in the scene
+         * @param x position on screen
+         * @param y position on screen
+         * @param predicate Predicate function used to determine eligible sprites. Can be set to null. In this case, a sprite must have isPickable set to true
+         * @param fastCheck Launch a fast check only using the bounding boxes. Can be set to null.
+         * @param camera camera to use for computing the picking ray. Can be set to null. In this case, the scene.activeCamera will be used
+         */
         public pickSprite(x: number, y: number, predicate?: (sprite: Sprite) => boolean, fastCheck?: boolean, camera?: Camera): PickingInfo {
             return this._internalPickSprites(this.createPickingRayInCameraSpace(x, y, camera), predicate, fastCheck, camera);
         }
 
+        /** Use the given ray to pick a mesh in the scene
+         * @param ray The ray to use to pick meshes
+         * @param predicate Predicate function used to determine eligible sprites. Can be set to null. In this case, a sprite must have isPickable set to true
+         * @param fastCheck Launch a fast check only using the bounding boxes. Can be set to null.
+         */
         public pickWithRay(ray: Ray, predicate: (mesh: Mesh) => boolean, fastCheck?: boolean): PickingInfo {
             return this._internalPick(world => {
                 if (!this._pickWithRayInverseMatrix) {
@@ -3582,18 +3605,22 @@
             }, predicate, fastCheck);
         }
 
-        /// <summary>Launch a ray to try to pick a mesh in the scene</summary>
-        /// <param name="x">X position on screen</param>
-        /// <param name="y">Y position on screen</param>
-        /// <param name="predicate">Predicate function used to determine eligible meshes. Can be set to null. In this case, a mesh must be enabled, visible and with isPickable set to true</param>
-        /// <param name="camera">camera to use for computing the picking ray. Can be set to null. In this case, the scene.activeCamera will be used</param>
+        /**
+         * Launch a ray to try to pick a mesh in the scene
+         * @param x X position on screen
+         * @param y Y position on screen
+         * @param predicate Predicate function used to determine eligible meshes. Can be set to null. In this case, a mesh must be enabled, visible and with isPickable set to true
+         * @param camera camera to use for computing the picking ray. Can be set to null. In this case, the scene.activeCamera will be used
+         */
         public multiPick(x: number, y: number, predicate?: (mesh: AbstractMesh) => boolean, camera?: Camera): PickingInfo[] {
             return this._internalMultiPick(world => this.createPickingRay(x, y, world, camera), predicate);
         }
 
-        /// <summary>Launch a ray to try to pick a mesh in the scene</summary>
-        /// <param name="ray">Ray to use</param>
-        /// <param name="predicate">Predicate function used to determine eligible meshes. Can be set to null. In this case, a mesh must be enabled, visible and with isPickable set to true</param>
+        /**
+         * Launch a ray to try to pick a mesh in the scene
+         * @param ray Ray to use
+         * @param predicate Predicate function used to determine eligible meshes. Can be set to null. In this case, a mesh must be enabled, visible and with isPickable set to true
+         */
         public multiPickWithRay(ray: Ray, predicate: (mesh: Mesh) => boolean): PickingInfo[] {
             return this._internalMultiPick(world => {
                 if (!this._pickWithRayInverseMatrix) {