Bläddra i källkod

Fixed issues with clone and VLS

David Catuhe 9 år sedan
förälder
incheckning
b5ddc0e715

Filskillnaden har hållts tillbaka eftersom den är för stor
+ 22 - 22
dist/preview release/babylon.core.js


Filskillnaden har hållts tillbaka eftersom den är för stor
+ 2880 - 2484
dist/preview release/babylon.d.ts


Filskillnaden har hållts tillbaka eftersom den är för stor
+ 30 - 30
dist/preview release/babylon.js


Filskillnaden har hållts tillbaka eftersom den är för stor
+ 533 - 81
dist/preview release/babylon.max.js


Filskillnaden har hållts tillbaka eftersom den är för stor
+ 30 - 30
dist/preview release/babylon.noworker.js


+ 48 - 0
src/Cameras/Inputs/babylon.arcrotatecamera.input.vrdeviceorientation.js

@@ -0,0 +1,48 @@
+var BABYLON;
+(function (BABYLON) {
+    var ArcRotateCameraVRDeviceOrientationInput = (function () {
+        function ArcRotateCameraVRDeviceOrientationInput() {
+            this.alphaCorrection = 1;
+            this.betaCorrection = 1;
+            this.gammaCorrection = 1;
+            this._alpha = 0;
+            this._beta = 0;
+            this._gamma = 0;
+            this._dirty = false;
+            this._deviceOrientationHandler = this._onOrientationEvent.bind(this);
+        }
+        ArcRotateCameraVRDeviceOrientationInput.prototype.attachControl = function (element, noPreventDefault) {
+            this.camera.attachControl(element, noPreventDefault);
+            window.addEventListener("deviceorientation", this._deviceOrientationHandler);
+        };
+        ArcRotateCameraVRDeviceOrientationInput.prototype._onOrientationEvent = function (evt) {
+            var camera = this.camera;
+            this._alpha = +evt.alpha | 0;
+            this._beta = +evt.beta | 0;
+            this._gamma = +evt.gamma | 0;
+            this._dirty = true;
+        };
+        ArcRotateCameraVRDeviceOrientationInput.prototype.checkInputs = function () {
+            if (this._dirty) {
+                this._dirty = false;
+                if (this._gamma < 0) {
+                    this._gamma = 180 + this._gamma;
+                }
+                this.camera.alpha = (-this._alpha / 180.0 * Math.PI) % Math.PI * 2;
+                this.camera.beta = (this._gamma / 180.0 * Math.PI);
+            }
+        };
+        ArcRotateCameraVRDeviceOrientationInput.prototype.detachControl = function (element) {
+            window.removeEventListener("deviceorientation", this._deviceOrientationHandler);
+        };
+        ArcRotateCameraVRDeviceOrientationInput.prototype.getTypeName = function () {
+            return "ArcRotateCameraVRDeviceOrientationInput";
+        };
+        ArcRotateCameraVRDeviceOrientationInput.prototype.getSimpleName = function () {
+            return "VRDeviceOrientation";
+        };
+        return ArcRotateCameraVRDeviceOrientationInput;
+    })();
+    BABYLON.ArcRotateCameraVRDeviceOrientationInput = ArcRotateCameraVRDeviceOrientationInput;
+    BABYLON.CameraInputTypes["ArcRotateCameraVRDeviceOrientationInput"] = ArcRotateCameraVRDeviceOrientationInput;
+})(BABYLON || (BABYLON = {}));

+ 14 - 14
src/Cameras/Inputs/babylon.arcrotatecamera.input.vrdeviceorientation.ts

@@ -10,15 +10,15 @@ module BABYLON {
         private _beta = 0;
         private _gamma = 0;
         private _dirty = false;
-    
+
         private _offsetOrientation: { yaw: number; pitch: number; roll: number };
         private _deviceOrientationHandler;
-        
+
         constructor() {
             this._deviceOrientationHandler = this._onOrientationEvent.bind(this);
         }
 
-        attachControl(element : HTMLElement, noPreventDefault?: boolean) {
+        attachControl(element: HTMLElement, noPreventDefault?: boolean) {
             this.camera.attachControl(element, noPreventDefault);
             window.addEventListener("deviceorientation", this._deviceOrientationHandler);
         }
@@ -32,30 +32,30 @@ module BABYLON {
         }
 
         public checkInputs() {
-            if (this._dirty){
+            if (this._dirty) {
                 this._dirty = false;
-                
-                 if (this._gamma < 0) {
+
+                if (this._gamma < 0) {
                     this._gamma = 180 + this._gamma;
                 }
-                
-                this.camera.alpha = (-this._alpha / 180.0 * Math.PI) % Math.PI*2;
+
+                this.camera.alpha = (-this._alpha / 180.0 * Math.PI) % Math.PI * 2;
                 this.camera.beta = (this._gamma / 180.0 * Math.PI);
             }
-        }              
+        }
 
-        detachControl(element : HTMLElement) {
+        detachControl(element: HTMLElement) {
             window.removeEventListener("deviceorientation", this._deviceOrientationHandler);
         }
 
         getTypeName(): string {
             return "ArcRotateCameraVRDeviceOrientationInput";
         }
-        
-        getSimpleName(){
+
+        getSimpleName() {
             return "VRDeviceOrientation";
         }
     }
-    
+
     CameraInputTypes["ArcRotateCameraVRDeviceOrientationInput"] = ArcRotateCameraVRDeviceOrientationInput;
-}
+}

+ 16 - 0
src/Cameras/VR/babylon.vrDeviceOrientationCamera.js

@@ -21,4 +21,20 @@ var BABYLON;
         return VRDeviceOrientationFreeCamera;
     })(BABYLON.FreeCamera);
     BABYLON.VRDeviceOrientationFreeCamera = VRDeviceOrientationFreeCamera;
+    var VRDeviceOrientationArcRotateCamera = (function (_super) {
+        __extends(VRDeviceOrientationArcRotateCamera, _super);
+        function VRDeviceOrientationArcRotateCamera(name, alpha, beta, radius, target, scene, compensateDistortion) {
+            if (compensateDistortion === void 0) { compensateDistortion = true; }
+            _super.call(this, name, alpha, beta, radius, target, scene);
+            var metrics = BABYLON.VRCameraMetrics.GetDefault();
+            metrics.compensateDistortion = compensateDistortion;
+            this.setCameraRigMode(BABYLON.Camera.RIG_MODE_VR, { vrCameraMetrics: metrics });
+            this.inputs.addVRDeviceOrientation();
+        }
+        VRDeviceOrientationArcRotateCamera.prototype.getTypeName = function () {
+            return "VRDeviceOrientationArcRotateCamera";
+        };
+        return VRDeviceOrientationArcRotateCamera;
+    })(BABYLON.ArcRotateCamera);
+    BABYLON.VRDeviceOrientationArcRotateCamera = VRDeviceOrientationArcRotateCamera;
 })(BABYLON || (BABYLON = {}));

+ 4 - 4
src/Cameras/VR/babylon.vrDeviceOrientationCamera.ts

@@ -1,5 +1,5 @@
 module BABYLON {
-    export class VRDeviceOrientationFreeCamera extends FreeCamera {        
+    export class VRDeviceOrientationFreeCamera extends FreeCamera {
 
         constructor(name: string, position: Vector3, scene: Scene, compensateDistortion = true) {
             super(name, position, scene);
@@ -16,8 +16,8 @@ module BABYLON {
             return "VRDeviceOrientationFreeCamera";
         }
     }
-    
-    export class VRDeviceOrientationArcRotateCamera extends ArcRotateCamera {        
+
+    export class VRDeviceOrientationArcRotateCamera extends ArcRotateCamera {
 
         constructor(name: string, alpha: number, beta: number, radius: number, target: Vector3, scene: Scene, compensateDistortion = true) {
             super(name, alpha, beta, radius, target, scene);
@@ -33,4 +33,4 @@ module BABYLON {
             return "VRDeviceOrientationArcRotateCamera";
         }
     }
-}
+}

+ 3 - 1
src/Cameras/babylon.arcRotateCamera.js

@@ -447,7 +447,9 @@ var BABYLON;
                 case BABYLON.Camera.RIG_MODE_STEREOSCOPIC_OVERUNDER:
                 case BABYLON.Camera.RIG_MODE_VR:
                     var alphaShift = this._cameraRigParams.stereoHalfAngle * (cameraIndex === 0 ? 1 : -1);
-                    return new ArcRotateCamera(name, this.alpha + alphaShift, this.beta, this.radius, this.target, this.getScene());
+                    var rigCam = new ArcRotateCamera(name, this.alpha + alphaShift, this.beta, this.radius, this.target, this.getScene());
+                    rigCam._cameraRigParams = {};
+                    return rigCam;
             }
             return null;
         };

+ 1 - 0
src/Cameras/babylon.arcRotateCamera.ts

@@ -560,3 +560,4 @@
         }
     }
 } 
+

+ 4 - 0
src/Cameras/babylon.arcRotateCameraInputsManager.js

@@ -26,6 +26,10 @@ var BABYLON;
             this.add(new BABYLON.ArcRotateCameraGamepadInput());
             return this;
         };
+        ArcRotateCameraInputsManager.prototype.addVRDeviceOrientation = function () {
+            this.add(new BABYLON.ArcRotateCameraVRDeviceOrientationInput());
+            return this;
+        };
         return ArcRotateCameraInputsManager;
     })(BABYLON.CameraInputsManager);
     BABYLON.ArcRotateCameraInputsManager = ArcRotateCameraInputsManager;

+ 2 - 2
src/Cameras/babylon.arcRotateCameraInputsManager.ts

@@ -22,11 +22,11 @@ module BABYLON {
         public addGamepad(): ArcRotateCameraInputsManager {
             this.add(new ArcRotateCameraGamepadInput());
             return this;
-        }        
+        }
 
         public addVRDeviceOrientation(): ArcRotateCameraInputsManager {
             this.add(new ArcRotateCameraVRDeviceOrientationInput());
             return this;
         }
     }
-}
+}

+ 2 - 0
src/Cameras/babylon.camera.js

@@ -411,6 +411,8 @@ var BABYLON;
                     postProcesses.push(new BABYLON.StereoscopicInterlacePostProcess(this.name + "_stereoInterlace", this._rigCameras[secondCamIndex], postProcesses[0], isStereoscopicHoriz));
                     break;
                 case Camera.RIG_MODE_VR:
+                    this._cameraRigParams.interaxialDistance = rigParams.interaxialDistance || 0.0637;
+                    this._cameraRigParams.stereoHalfAngle = BABYLON.Tools.ToRadians(this._cameraRigParams.interaxialDistance / 0.0637);
                     this._rigCameras.push(this.createRigCamera(this.name + "_L", 0));
                     this._rigCameras.push(this.createRigCamera(this.name + "_R", 1));
                     var metrics = rigParams.vrCameraMetrics || BABYLON.VRCameraMetrics.GetDefault();

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

@@ -511,7 +511,7 @@
                 case Camera.RIG_MODE_VR:
                     this._cameraRigParams.interaxialDistance = rigParams.interaxialDistance || 0.0637;
                     this._cameraRigParams.stereoHalfAngle = BABYLON.Tools.ToRadians(this._cameraRigParams.interaxialDistance / 0.0637);
-                    
+
                     this._rigCameras.push(this.createRigCamera(this.name + "_L", 0));
                     this._rigCameras.push(this.createRigCamera(this.name + "_R", 1));
 
@@ -704,3 +704,4 @@
 
 
 
+

+ 358 - 14
src/Mesh/babylon.mesh.js

@@ -93,6 +93,9 @@ var BABYLON;
             }
         }
         Object.defineProperty(Mesh, "FRONTSIDE", {
+            /**
+             * Mesh side orientation : usually the external or front surface
+             */
             get: function () {
                 return Mesh._FRONTSIDE;
             },
@@ -100,6 +103,9 @@ var BABYLON;
             configurable: true
         });
         Object.defineProperty(Mesh, "BACKSIDE", {
+            /**
+             * Mesh side orientation : usually the internal or back surface
+             */
             get: function () {
                 return Mesh._BACKSIDE;
             },
@@ -107,6 +113,9 @@ var BABYLON;
             configurable: true
         });
         Object.defineProperty(Mesh, "DOUBLESIDE", {
+            /**
+             * Mesh side orientation : both internal and external or front and back surfaces
+             */
             get: function () {
                 return Mesh._DOUBLESIDE;
             },
@@ -114,6 +123,9 @@ var BABYLON;
             configurable: true
         });
         Object.defineProperty(Mesh, "DEFAULTSIDE", {
+            /**
+             * Mesh side orientation : by default, `FRONTSIDE`
+             */
             get: function () {
                 return Mesh._DEFAULTSIDE;
             },
@@ -121,6 +133,9 @@ var BABYLON;
             configurable: true
         });
         Object.defineProperty(Mesh, "NO_CAP", {
+            /**
+             * Mesh cap setting : no cap
+             */
             get: function () {
                 return Mesh._NO_CAP;
             },
@@ -128,6 +143,9 @@ var BABYLON;
             configurable: true
         });
         Object.defineProperty(Mesh, "CAP_START", {
+            /**
+             * Mesh cap setting : one cap at the beginning of the mesh
+             */
             get: function () {
                 return Mesh._CAP_START;
             },
@@ -135,6 +153,9 @@ var BABYLON;
             configurable: true
         });
         Object.defineProperty(Mesh, "CAP_END", {
+            /**
+             * Mesh cap setting : one cap at the end of the mesh
+             */
             get: function () {
                 return Mesh._CAP_END;
             },
@@ -142,6 +163,9 @@ var BABYLON;
             configurable: true
         });
         Object.defineProperty(Mesh, "CAP_ALL", {
+            /**
+             * Mesh cap setting : two caps, one at the beginning  and one at the end of the mesh
+             */
             get: function () {
                 return Mesh._CAP_ALL;
             },
@@ -213,6 +237,10 @@ var BABYLON;
             this._sortLODLevels();
             return this;
         };
+        /**
+         * Returns the LOD level mesh at the passed distance or null is not found.
+         * It is related to the method `addLODLevel(distance, mesh)`.
+         */
         Mesh.prototype.getLODLevelAtDistance = function (distance) {
             for (var index = 0; index < this._LODLevels.length; index++) {
                 var level = this._LODLevels[index];
@@ -269,30 +297,48 @@ var BABYLON;
             return this;
         };
         Object.defineProperty(Mesh.prototype, "geometry", {
+            /**
+             * Returns the mesh internal `Geometry` object.
+             */
             get: function () {
                 return this._geometry;
             },
             enumerable: true,
             configurable: true
         });
+        /**
+         * Returns a positive integer : the total number of vertices within the mesh geometry or zero if the mesh has no geometry.
+         */
         Mesh.prototype.getTotalVertices = function () {
             if (!this._geometry) {
                 return 0;
             }
             return this._geometry.getTotalVertices();
         };
+        /**
+         * Returns an array of integers or floats, or a Float32Array, depending on the requested `kind` (positions, indices, normals, etc).
+         * If `copywhenShared` is true (default false) and if the mesh has submeshes, the submesh data are duplicated in the returned array.
+         * Returns null if the mesh has no geometry or no vertex buffer.
+         */
         Mesh.prototype.getVerticesData = function (kind, copyWhenShared) {
             if (!this._geometry) {
                 return null;
             }
             return this._geometry.getVerticesData(kind, copyWhenShared);
         };
+        /**
+         * Returns the mesh `VertexBuffer` object from the requested `kind` : positions, indices, normals, etc.
+         * Returns `undefined` if the mesh has no geometry.
+         */
         Mesh.prototype.getVertexBuffer = function (kind) {
             if (!this._geometry) {
                 return undefined;
             }
             return this._geometry.getVertexBuffer(kind);
         };
+        /**
+         * Returns a boolean depending on the existence of the Vertex Data for the requested `kind`.
+         */
         Mesh.prototype.isVerticesDataPresent = function (kind) {
             if (!this._geometry) {
                 if (this._delayInfo) {
@@ -302,6 +348,9 @@ var BABYLON;
             }
             return this._geometry.isVerticesDataPresent(kind);
         };
+        /**
+         * Returns a string : the list of existing `kinds` of Vertex Data for this mesh.
+         */
         Mesh.prototype.getVerticesDataKinds = function () {
             if (!this._geometry) {
                 var result = [];
@@ -314,12 +363,21 @@ var BABYLON;
             }
             return this._geometry.getVerticesDataKinds();
         };
+        /**
+         * Returns a positive integer : the total number of indices in this mesh geometry.
+         * Returns zero if the mesh has no geometry.
+         */
         Mesh.prototype.getTotalIndices = function () {
             if (!this._geometry) {
                 return 0;
             }
             return this._geometry.getTotalIndices();
         };
+        /**
+         * Returns an array of integers or a Int32Array populated with the mesh indices.
+         * If the parameter `copyWhenShared` is true (default false) and if the mesh has submeshes, the submesh indices are duplicated in the returned array.
+         * Returns an empty array if the mesh has no geometry.
+         */
         Mesh.prototype.getIndices = function (copyWhenShared) {
             if (!this._geometry) {
                 return [];
@@ -346,6 +404,10 @@ var BABYLON;
             get: function () {
                 return this._sideOrientation;
             },
+            /**
+             * Sets the mesh side orientation : FRONTSIDE, BACKSIDE, DOUBLESIDE or DEFAULTSIDE
+             * tuto : http://doc.babylonjs.com/tutorials/Discover_Basic_Elements#side-orientation
+             */
             set: function (sideO) {
                 this._sideOrientation = sideO;
             },
@@ -353,17 +415,29 @@ var BABYLON;
             configurable: true
         });
         Object.defineProperty(Mesh.prototype, "areNormalsFrozen", {
+            /**
+             * Boolean : true if the normals aren't to be recomputed on next update.
+             * This property is pertinent only for updatable parametric shapes.
+             */
             get: function () {
                 return this._areNormalsFrozen;
             },
             enumerable: true,
             configurable: true
         });
-        /**  This function affects parametric shapes on update only : ribbons, tubes, etc. It has no effect at all on other shapes */
+        /**
+         * This function affects parametric shapes on update only : ribbons, tubes, etc.
+         * It has no effect at all on other shapes.
+         * It prevents the mesh normals from being recomputed on next position update.
+         */
         Mesh.prototype.freezeNormals = function () {
             this._areNormalsFrozen = true;
         };
-        /**  This function affects parametric shapes on update only : ribbons, tubes, etc. It has no effect at all on other shapes */
+        /**
+         * This function affects parametric shapes on update only : ribbons, tubes, etc.
+         * It has no effect at all on other shapes.
+         * It reactivates the mesh normals computation if it was frozen.
+         */
         Mesh.prototype.unfreezeNormals = function () {
             this._areNormalsFrozen = false;
         };
@@ -392,6 +466,10 @@ var BABYLON;
             }
             this._visibleInstances[renderId].push(instance);
         };
+        /**
+         * This method recomputes and sets a new `BoundingInfo` to the mesh unless it is locked.
+         * This means the mesh underlying bounding box and shpere are recomputed.
+         */
         Mesh.prototype.refreshBoundingInfo = function () {
             if (this._boundingInfo.isLocked) {
                 return;
@@ -473,10 +551,12 @@ var BABYLON;
                 this.updateVerticesDataDirectly(kind, data, offset, false);
             }
         };
-        // Mesh positions update function :
-        // updates the mesh positions according to the positionFunction returned values.
-        // The positionFunction argument must be a javascript function accepting the mesh "positions" array as parameter.
-        // This dedicated positionFunction computes new mesh positions according to the given mesh type.
+        /**
+         * This method updates the postions of a updatable mesh according to the `positionFunction` returned values.
+         * tuto : http://doc.babylonjs.com/tutorials/How_to_dynamically_morph_a_mesh#other-shapes-updatemeshpositions
+         * The parameter `positionFunction` is a simple JS function what is passed the mesh `positions` array. It doesn't need to return anything.
+         * The parameter `computeNormals` is a boolean (default true) to enable/disable the mesh normal recomputation after the mesh position update.
+         */
         Mesh.prototype.updateMeshPositions = function (positionFunction, computeNormals) {
             if (computeNormals === void 0) { computeNormals = true; }
             var positions = this.getVerticesData(BABYLON.VertexBuffer.PositionKind);
@@ -946,6 +1026,11 @@ var BABYLON;
             this.updateVerticesData(BABYLON.VertexBuffer.PositionKind, positions);
             this.updateVerticesData(BABYLON.VertexBuffer.NormalKind, normals);
         };
+        /**
+         * Modify the mesh to get a flat shading rendering.
+         * This means each mesh facet will then have its own normals. Usually new vertices are added in the mesh geometry to get this result.
+         * Warning : the mesh is really modified.
+         */
         Mesh.prototype.convertToFlatShadedMesh = function () {
             /// <summary>Update normals and vertices to get a flat shading rendering.</summary>
             /// <summary>Warning: This may imply adding vertices to the mesh in order to get exactly 3 vertices per face</summary>
@@ -1020,6 +1105,10 @@ var BABYLON;
             }
             this.synchronizeInstances();
         };
+        /**
+         * This method removes all the mesh indices and add new vertices (duplication) in order to unfold facets into buffers.
+         * In other words, more vertices, no more indices and a single bigger VBO.
+         */
         Mesh.prototype.convertToUnIndexedMesh = function () {
             /// <summary>Remove indices by unfolding faces into buffers</summary>
             /// <summary>Warning: This implies adding vertices to the mesh in order to get exactly 3 vertices per face</summary>
@@ -1074,7 +1163,10 @@ var BABYLON;
             this._unIndexed = true;
             this.synchronizeInstances();
         };
-        // will inverse faces orientations, and invert normals too if specified
+        /**
+         * Inverses facet orientations and inverts also the normals with `flipNormals` (default false) if true.
+         * Warning : the mesh is really modified.
+         */
         Mesh.prototype.flipFaces = function (flipNormals) {
             if (flipNormals === void 0) { flipNormals = false; }
             var vertex_data = BABYLON.VertexData.ExtractFromMesh(this);
@@ -1094,6 +1186,9 @@ var BABYLON;
             vertex_data.applyToMesh(this);
         };
         // Instances
+        /**
+         * Creates a new `InstancedMesh` object from the mesh model.
+         */
         Mesh.prototype.createInstance = function (name) {
             return new BABYLON.InstancedMesh(name, this);
         };
@@ -1315,6 +1410,22 @@ var BABYLON;
             }
             return mesh;
         };
+        /**
+         * Creates a ribbon mesh.
+         * Please consider using the same method from the `MeshBuilder` class instead.
+         * The ribbon is a parametric shape :  http://doc.babylonjs.com/tutorials/Parametric_Shapes.  It has no predefined shape. Its final shape will depend on the input parameters.
+         *
+         * Please read this full tutorial to understand how to design a ribbon : http://doc.babylonjs.com/tutorials/Ribbon_Tutorial
+         * The parameter `pathArray` is a required array of paths, what are each an array of successive Vector3. The pathArray parameter depicts the ribbon geometry.
+         * The parameter `closeArray` (boolean, default false) creates a seam between the first and the last paths of the path array.
+         * The parameter `closePath` (boolean, default false) creates a seam between the first and the last points of each path of the path array.
+         * The parameter `offset` (positive integer, default : rounded half size of the pathArray length), is taken in account only if the `pathArray` is containing a single path.
+         * It's the offset to join together the points from the same path. Ex : offset = 10 means the point 1 is joined to the point 11.
+         * The optional parameter `instance` is an instance of an existing Ribbon object to be updated with the passed `pathArray` parameter : http://doc.babylonjs.com/tutorials/How_to_dynamically_morph_a_mesh#ribbon
+         * You can also set the mesh side orientation with the values : BABYLON.Mesh.FRONTSIDE (default), BABYLON.Mesh.BACKSIDE or BABYLON.Mesh.DOUBLESIDE
+         * Detail here : http://doc.babylonjs.com/tutorials/02._Discover_Basic_Elements#side-orientation
+         * The mesh can be set to updatable with the boolean parameter `updatable` (default false) if its internal geometry is supposed to change once created.
+         */
         Mesh.CreateRibbon = function (name, pathArray, closeArray, closePath, offset, scene, updatable, sideOrientation, instance) {
             return BABYLON.MeshBuilder.CreateRibbon(name, {
                 pathArray: pathArray,
@@ -1326,6 +1437,15 @@ var BABYLON;
                 instance: instance
             }, scene);
         };
+        /**
+         * Creates a plane polygonal mesh.  By default, this is a disc.
+         * Please consider using the same method from the `MeshBuilder` class instead.
+         * The parameter `radius` sets the radius size (float) of the polygon (default 0.5).
+         * The parameter `tessellation` sets the number of polygon sides (positive integer, default 64). So a tessellation valued to 3 will build a triangle, to 4 a square, etc.
+         * You can also set the mesh side orientation with the values : BABYLON.Mesh.FRONTSIDE (default), BABYLON.Mesh.BACKSIDE or BABYLON.Mesh.DOUBLESIDE
+         * Detail here : http://doc.babylonjs.com/tutorials/02._Discover_Basic_Elements#side-orientation
+         * The mesh can be set to updatable with the boolean parameter `updatable` (default false) if its internal geometry is supposed to change once created.
+         */
         Mesh.CreateDisc = function (name, radius, tessellation, scene, updatable, sideOrientation) {
             var options = {
                 radius: radius,
@@ -1335,6 +1455,14 @@ var BABYLON;
             };
             return BABYLON.MeshBuilder.CreateDisc(name, options, scene);
         };
+        /**
+         * Creates a box mesh.
+         * Please consider using the same method from the `MeshBuilder` class instead.
+         * The parameter `size` sets the size (float) of each box side (default 1).
+         * You can also set the mesh side orientation with the values : BABYLON.Mesh.FRONTSIDE (default), BABYLON.Mesh.BACKSIDE or BABYLON.Mesh.DOUBLESIDE
+         * Detail here : http://doc.babylonjs.com/tutorials/02._Discover_Basic_Elements#side-orientation
+         * The mesh can be set to updatable with the boolean parameter `updatable` (default false) if its internal geometry is supposed to change once created.
+         */
         Mesh.CreateBox = function (name, size, scene, updatable, sideOrientation) {
             var options = {
                 size: size,
@@ -1343,6 +1471,15 @@ var BABYLON;
             };
             return BABYLON.MeshBuilder.CreateBox(name, options, scene);
         };
+        /**
+         * Creates a sphere mesh.
+         * Please consider using the same method from the `MeshBuilder` class instead.
+         * The parameter `diameter` sets the diameter size (float) of the sphere (default 1).
+         * The parameter `segments` sets the sphere number of horizontal stripes (positive integer, default 32).
+         * You can also set the mesh side orientation with the values : BABYLON.Mesh.FRONTSIDE (default), BABYLON.Mesh.BACKSIDE or BABYLON.Mesh.DOUBLESIDE
+         * Detail here : http://doc.babylonjs.com/tutorials/02._Discover_Basic_Elements#side-orientation
+         * The mesh can be set to updatable with the boolean parameter `updatable` (default false) if its internal geometry is supposed to change once created.
+         */
         Mesh.CreateSphere = function (name, segments, diameter, scene, updatable, sideOrientation) {
             var options = {
                 segments: segments,
@@ -1354,7 +1491,18 @@ var BABYLON;
             };
             return BABYLON.MeshBuilder.CreateSphere(name, options, scene);
         };
-        // Cylinder and cone
+        /**
+         * Creates a cylinder or a cone mesh.
+         * Please consider using the same method from the `MeshBuilder` class instead.
+         * The parameter `height` sets the height size (float) of the cylinder/cone (float, default 2).
+         * The parameter `diameter` sets the diameter of the top and bottom cap at once (float, default 1).
+         * The parameters `diameterTop` and `diameterBottom` overwrite the parameter `diameter` and set respectively the top cap and bottom cap diameter (floats, default 1). The parameter "diameterBottom" can't be zero.
+         * The parameter `tessellation` sets the number of cylinder sides (positive integer, default 24). Set it to 3 to get a prism for instance.
+         * The parameter `subdivisions` sets the number of rings along the cylinder height (positive integer, default 1).
+         * You can also set the mesh side orientation with the values : BABYLON.Mesh.FRONTSIDE (default), BABYLON.Mesh.BACKSIDE or BABYLON.Mesh.DOUBLESIDE
+         * Detail here : http://doc.babylonjs.com/tutorials/02._Discover_Basic_Elements#side-orientation
+         * The mesh can be set to updatable with the boolean parameter `updatable` (default false) if its internal geometry is supposed to change once created.
+         */
         Mesh.CreateCylinder = function (name, height, diameterTop, diameterBottom, tessellation, subdivisions, scene, updatable, sideOrientation) {
             if (scene === undefined || !(scene instanceof BABYLON.Scene)) {
                 if (scene !== undefined) {
@@ -1376,6 +1524,16 @@ var BABYLON;
             return BABYLON.MeshBuilder.CreateCylinder(name, options, scene);
         };
         // Torus  (Code from SharpDX.org)
+        /**
+         * Creates a torus mesh.
+         * Please consider using the same method from the `MeshBuilder` class instead.
+         * The parameter `diameter` sets the diameter size (float) of the torus (default 1).
+         * The parameter `thickness` sets the diameter size of the tube of the torus (float, default 0.5).
+         * The parameter `tessellation` sets the number of torus sides (postive integer, default 16).
+         * You can also set the mesh side orientation with the values : BABYLON.Mesh.FRONTSIDE (default), BABYLON.Mesh.BACKSIDE or BABYLON.Mesh.DOUBLESIDE
+         * Detail here : http://doc.babylonjs.com/tutorials/02._Discover_Basic_Elements#side-orientation
+         * The mesh can be set to updatable with the boolean parameter `updatable` (default false) if its internal geometry is supposed to change once created.
+         */
         Mesh.CreateTorus = function (name, diameter, thickness, tessellation, scene, updatable, sideOrientation) {
             var options = {
                 diameter: diameter,
@@ -1386,6 +1544,17 @@ var BABYLON;
             };
             return BABYLON.MeshBuilder.CreateTorus(name, options, scene);
         };
+        /**
+         * Creates a torus knot mesh.
+         * Please consider using the same method from the `MeshBuilder` class instead.
+         * The parameter `radius` sets the global radius size (float) of the torus knot (default 2).
+         * The parameter `radialSegments` sets the number of sides on each tube segments (positive integer, default 32).
+         * The parameter `tubularSegments` sets the number of tubes to decompose the knot into (positive integer, default 32).
+         * The parameters `p` and `q` are the number of windings on each axis (positive integers, default 2 and 3).
+         * You can also set the mesh side orientation with the values : BABYLON.Mesh.FRONTSIDE (default), BABYLON.Mesh.BACKSIDE or BABYLON.Mesh.DOUBLESIDE
+         * Detail here : http://doc.babylonjs.com/tutorials/02._Discover_Basic_Elements#side-orientation
+         * The mesh can be set to updatable with the boolean parameter `updatable` (default false) if its internal geometry is supposed to change once created.
+         */
         Mesh.CreateTorusKnot = function (name, radius, tube, radialSegments, tubularSegments, p, q, scene, updatable, sideOrientation) {
             var options = {
                 radius: radius,
@@ -1399,7 +1568,16 @@ var BABYLON;
             };
             return BABYLON.MeshBuilder.CreateTorusKnot(name, options, scene);
         };
-        // Lines
+        /**
+         * Creates a line mesh.
+         * Please consider using the same method from the `MeshBuilder` class instead.
+         * A line mesh is considered as a parametric shape since it has no predefined original shape. Its shape is determined by the passed array of points as an input parameter.
+         * Like every other parametric shape, it is dynamically updatable by passing an existing instance of LineMesh to this static function.
+         * The parameter `points` is an array successive Vector3.
+         * The optional parameter `instance` is an instance of an existing LineMesh object to be updated with the passed `points` parameter : http://doc.babylonjs.com/tutorials/How_to_dynamically_morph_a_mesh#lines-and-dashedlines
+         * When updating an instance, remember that only point positions can change, not the number of points.
+         * The mesh can be set to updatable with the boolean parameter `updatable` (default false) if its internal geometry is supposed to change once created.
+         */
         Mesh.CreateLines = function (name, points, scene, updatable, instance) {
             var options = {
                 points: points,
@@ -1408,7 +1586,19 @@ var BABYLON;
             };
             return BABYLON.MeshBuilder.CreateLines(name, options, scene);
         };
-        // Dashed Lines
+        /**
+         * Creates a dashed line mesh.
+         * Please consider using the same method from the `MeshBuilder` class instead.
+         * A dashed line mesh is considered as a parametric shape since it has no predefined original shape. Its shape is determined by the passed array of points as an input parameter.
+         * Like every other parametric shape, it is dynamically updatable by passing an existing instance of LineMesh to this static function.
+         * The parameter `points` is an array successive Vector3.
+         * The parameter `dashNb` is the intended total number of dashes (positive integer, default 200).
+         * The parameter `dashSize` is the size of the dashes relatively the dash number (positive float, default 3).
+         * The parameter `gapSize` is the size of the gap between two successive dashes relatively the dash number (positive float, default 1).
+         * The optional parameter `instance` is an instance of an existing LineMesh object to be updated with the passed `points` parameter : http://doc.babylonjs.com/tutorials/How_to_dynamically_morph_a_mesh#lines-and-dashedlines
+         * When updating an instance, remember that only point positions can change, not the number of points.
+         * The mesh can be set to updatable with the boolean parameter `updatable` (default false) if its internal geometry is supposed to change once created.
+         */
         Mesh.CreateDashedLines = function (name, points, dashSize, gapSize, dashNb, scene, updatable, instance) {
             var options = {
                 points: points,
@@ -1419,7 +1609,24 @@ var BABYLON;
             };
             return BABYLON.MeshBuilder.CreateDashedLines(name, options, scene);
         };
-        // Extrusion
+        /**
+         * Creates an extruded shape mesh.
+         * The extrusion is a parametric shape :  http://doc.babylonjs.com/tutorials/Parametric_Shapes.  It has no predefined shape. Its final shape will depend on the input parameters.
+         * Please consider using the same method from the `MeshBuilder` class instead.
+         *
+         * Please read this full tutorial to understand how to design an extruded shape : http://doc.babylonjs.com/tutorials/Parametric_Shapes#extrusion
+         * The parameter `shape` is a required array of successive Vector3. This array depicts the shape to be extruded in its local space : the shape must be designed in the xOy plane and will be
+         * extruded along the Z axis.
+         * The parameter `path` is a required array of successive Vector3. This is the axis curve the shape is extruded along.
+         * The parameter `rotation` (float, default 0 radians) is the angle value to rotate the shape each step (each path point), from the former step (so rotation added each step) along the curve.
+         * The parameter `scale` (float, default 1) is the value to scale the shape.
+         * The parameter `cap` sets the way the extruded shape is capped. Possible values : BABYLON.Mesh.NO_CAP (default), BABYLON.Mesh.CAP_START, BABYLON.Mesh.CAP_END, BABYLON.Mesh.CAP_ALL
+         * The optional parameter `instance` is an instance of an existing ExtrudedShape object to be updated with the passed `shape`, `path`, `scale` or `rotation` parameters : http://doc.babylonjs.com/tutorials/How_to_dynamically_morph_a_mesh#extruded-shape
+         * Remember you can only change the shape or path point positions, not their number when updating an extruded shape.
+         * You can also set the mesh side orientation with the values : BABYLON.Mesh.FRONTSIDE (default), BABYLON.Mesh.BACKSIDE or BABYLON.Mesh.DOUBLESIDE
+         * Detail here : http://doc.babylonjs.com/tutorials/02._Discover_Basic_Elements#side-orientation
+         * The mesh can be set to updatable with the boolean parameter `updatable` (default false) if its internal geometry is supposed to change once created.
+         */
         Mesh.ExtrudeShape = function (name, shape, path, scale, rotation, cap, scene, updatable, sideOrientation, instance) {
             var options = {
                 shape: shape,
@@ -1433,6 +1640,36 @@ var BABYLON;
             };
             return BABYLON.MeshBuilder.ExtrudeShape(name, options, scene);
         };
+        /**
+         * Creates an custom extruded shape mesh.
+         * The custom extrusion is a parametric shape :  http://doc.babylonjs.com/tutorials/Parametric_Shapes.  It has no predefined shape. Its final shape will depend on the input parameters.
+         * Please consider using the same method from the `MeshBuilder` class instead.
+         *
+         * Please read this full tutorial to understand how to design a custom extruded shape : http://doc.babylonjs.com/tutorials/Parametric_Shapes#extrusion
+         * The parameter `shape` is a required array of successive Vector3. This array depicts the shape to be extruded in its local space : the shape must be designed in the xOy plane and will be
+         * extruded along the Z axis.
+         * The parameter `path` is a required array of successive Vector3. This is the axis curve the shape is extruded along.
+         * The parameter `rotationFunction` (JS function) is a custom Javascript function called on each path point. This function is passed the position i of the point in the path
+         * and the distance of this point from the begining of the path :
+         * ```rotationFunction = function(i, distance) {
+         *  // do things
+         *  return rotationValue; }```
+         * It must returns a float value that will be the rotation in radians applied to the shape on each path point.
+         * The parameter `scaleFunction` (JS function) is a custom Javascript function called on each path point. This function is passed the position i of the point in the path
+         * and the distance of this point from the begining of the path :
+         * ````scaleFunction = function(i, distance) {
+         *   // do things
+         *  return scaleValue;}```
+         * It must returns a float value that will be the scale value applied to the shape on each path point.
+         * The parameter `ribbonClosePath` (boolean, default false) forces the extrusion underlying ribbon to close all the paths in its `pathArray`.
+         * The parameter `ribbonCloseArray` (boolean, default false) forces the extrusion underlying ribbon to close its `pathArray`.
+         * The parameter `cap` sets the way the extruded shape is capped. Possible values : BABYLON.Mesh.NO_CAP (default), BABYLON.Mesh.CAP_START, BABYLON.Mesh.CAP_END, BABYLON.Mesh.CAP_ALL
+         * The optional parameter `instance` is an instance of an existing ExtrudedShape object to be updated with the passed `shape`, `path`, `scale` or `rotation` parameters : http://doc.babylonjs.com/tutorials/How_to_dynamically_morph_a_mesh#extruded-shape
+         * Remember you can only change the shape or path point positions, not their number when updating an extruded shape.
+         * You can also set the mesh side orientation with the values : BABYLON.Mesh.FRONTSIDE (default), BABYLON.Mesh.BACKSIDE or BABYLON.Mesh.DOUBLESIDE
+         * Detail here : http://doc.babylonjs.com/tutorials/02._Discover_Basic_Elements#side-orientation
+         * The mesh can be set to updatable with the boolean parameter `updatable` (default false) if its internal geometry is supposed to change once created.
+         */
         Mesh.ExtrudeShapeCustom = function (name, shape, path, scaleFunction, rotationFunction, ribbonCloseArray, ribbonClosePath, cap, scene, updatable, sideOrientation, instance) {
             var options = {
                 shape: shape,
@@ -1448,7 +1685,19 @@ var BABYLON;
             };
             return BABYLON.MeshBuilder.ExtrudeShapeCustom(name, options, scene);
         };
-        // Lathe
+        /**
+         * Creates lathe mesh.
+         * The lathe is a shape with a symetry axis : a 2D model shape is rotated around this axis to design the lathe.
+         * Please consider using the same method from the `MeshBuilder` class instead.
+         *
+         * The parameter `shape` is a required array of successive Vector3. This array depicts the shape to be rotated in its local space : the shape must be designed in the xOy plane and will be
+         * rotated around the Y axis. It's usually a 2D shape, so the Vector3 z coordinates are often set to zero.
+         * The parameter `radius` (positive float, default 1) is the radius value of the lathe.
+         * The parameter `tessellation` (positive integer, default 64) is the side number of the lathe.
+         * You can also set the mesh side orientation with the values : BABYLON.Mesh.FRONTSIDE (default), BABYLON.Mesh.BACKSIDE or BABYLON.Mesh.DOUBLESIDE
+         * Detail here : http://doc.babylonjs.com/tutorials/02._Discover_Basic_Elements#side-orientation
+         * The mesh can be set to updatable with the boolean parameter `updatable` (default false) if its internal geometry is supposed to change once created.
+         */
         Mesh.CreateLathe = function (name, shape, radius, tessellation, scene, updatable, sideOrientation) {
             var options = {
                 shape: shape,
@@ -1459,7 +1708,14 @@ var BABYLON;
             };
             return BABYLON.MeshBuilder.CreateLathe(name, options, scene);
         };
-        // Plane & ground
+        /**
+         * Creates a plane mesh.
+         * Please consider using the same method from the `MeshBuilder` class instead.
+         * The parameter `size` sets the size (float) of both sides of the plane at once (default 1).
+         * You can also set the mesh side orientation with the values : BABYLON.Mesh.FRONTSIDE (default), BABYLON.Mesh.BACKSIDE or BABYLON.Mesh.DOUBLESIDE
+         * Detail here : http://doc.babylonjs.com/tutorials/02._Discover_Basic_Elements#side-orientation
+         * The mesh can be set to updatable with the boolean parameter `updatable` (default false) if its internal geometry is supposed to change once created.
+         */
         Mesh.CreatePlane = function (name, size, scene, updatable, sideOrientation) {
             var options = {
                 size: size,
@@ -1470,6 +1726,13 @@ var BABYLON;
             };
             return BABYLON.MeshBuilder.CreatePlane(name, options, scene);
         };
+        /**
+         * Creates a ground mesh.
+         * Please consider using the same method from the `MeshBuilder` class instead.
+         * The parameters `width` and `height` (floats, default 1) set the width and height sizes of the ground.
+         * The parameter `subdivisions` (positive integer) sets the number of subdivisions per side.
+         * The mesh can be set to updatable with the boolean parameter `updatable` (default false) if its internal geometry is supposed to change once created.
+         */
         Mesh.CreateGround = function (name, width, height, subdivisions, scene, updatable) {
             var options = {
                 width: width,
@@ -1479,6 +1742,17 @@ var BABYLON;
             };
             return BABYLON.MeshBuilder.CreateGround(name, options, scene);
         };
+        /**
+         * Creates a tiled ground mesh.
+         * Please consider using the same method from the `MeshBuilder` class instead.
+         * The parameters `xmin` and `xmax` (floats, default -1 and 1) set the ground minimum and maximum X coordinates.
+         * The parameters `zmin` and `zmax` (floats, default -1 and 1) set the ground minimum and maximum Z coordinates.
+         * The parameter `subdivisions` is a javascript object `{w: positive integer, h: positive integer}` (default `{w: 6, h: 6}`). `w` and `h` are the
+         * numbers of subdivisions on the ground width and height. Each subdivision is called a tile.
+         * The parameter `precision` is a javascript object `{w: positive integer, h: positive integer}` (default `{w: 2, h: 2}`). `w` and `h` are the
+         * numbers of subdivisions on the ground width and height of each tile.
+         * The mesh can be set to updatable with the boolean parameter `updatable` (default false) if its internal geometry is supposed to change once created.
+         */
         Mesh.CreateTiledGround = function (name, xmin, zmin, xmax, zmax, subdivisions, precision, scene, updatable) {
             var options = {
                 xmin: xmin,
@@ -1491,6 +1765,20 @@ var BABYLON;
             };
             return BABYLON.MeshBuilder.CreateTiledGround(name, options, scene);
         };
+        /**
+         * Creates a ground mesh from a height map.
+         * tuto : http://doc.babylonjs.com/tutorials/14._Height_Map
+         * Please consider using the same method from the `MeshBuilder` class instead.
+         * The parameter `url` sets the URL of the height map image resource.
+         * The parameters `width` and `height` (positive floats, default 10) set the ground width and height sizes.
+         * The parameter `subdivisions` (positive integer, default 1) sets the number of subdivision per side.
+         * The parameter `minHeight` (float, default 0) is the minimum altitude on the ground.
+         * The parameter `maxHeight` (float, default 1) is the maximum altitude on the ground.
+         * The parameter `onReady` is a javascript callback function that will be called  once the mesh is just built (the height map download can last some time).
+         * This function is passed the newly built mesh : ```function(mesh) { // do things
+         * return; }```
+         * The mesh can be set to updatable with the boolean parameter `updatable` (default false) if its internal geometry is supposed to change once created.
+         */
         Mesh.CreateGroundFromHeightMap = function (name, url, width, height, subdivisions, minHeight, maxHeight, scene, updatable, onReady) {
             var options = {
                 width: width,
@@ -1503,6 +1791,26 @@ var BABYLON;
             };
             return BABYLON.MeshBuilder.CreateGroundFromHeightMap(name, url, options, scene);
         };
+        /**
+         * Creates a tube mesh.
+         * The tube is a parametric shape :  http://doc.babylonjs.com/tutorials/Parametric_Shapes.  It has no predefined shape. Its final shape will depend on the input parameters.
+         *
+         * Please consider using the same method from the `MeshBuilder` class instead.
+         * The parameter `path` is a required array of successive `Vector3`. It is the curve used as the axis of the tube.
+         * The parameter `radius` (positive float, default 1) sets the tube radius size.
+         * The parameter `tessellation` (positive float, default 64) is the number of sides on the tubular surface.
+         * The parameter `radiusFunction` (javascript function, default null) is a vanilla javascript function. If it is not null, it overwrittes the parameter `radius`.
+         * This function is called on each point of the tube path and is passed the index `i` of the i-th point and the distance of this point from the first point of the path.
+         * It must return a radius value (positive float) :
+         * ```var radiusFunction = function(i, distance) {
+         *   // do things
+         *   return radius; }```
+         * The parameter `cap` sets the way the extruded shape is capped. Possible values : BABYLON.Mesh.NO_CAP (default), BABYLON.Mesh.CAP_START, BABYLON.Mesh.CAP_END, BABYLON.Mesh.CAP_ALL
+         * The optional parameter `instance` is an instance of an existing Tube object to be updated with the passed `pathArray` parameter : http://doc.babylonjs.com/tutorials/How_to_dynamically_morph_a_mesh#tube
+         * You can also set the mesh side orientation with the values : BABYLON.Mesh.FRONTSIDE (default), BABYLON.Mesh.BACKSIDE or BABYLON.Mesh.DOUBLESIDE
+         * Detail here : http://doc.babylonjs.com/tutorials/02._Discover_Basic_Elements#side-orientation
+         * The mesh can be set to updatable with the boolean parameter `updatable` (default false) if its internal geometry is supposed to change once created.
+         */
         Mesh.CreateTube = function (name, path, radius, tessellation, radiusFunction, cap, scene, updatable, sideOrientation, instance) {
             var options = {
                 path: path,
@@ -1517,13 +1825,49 @@ var BABYLON;
             };
             return BABYLON.MeshBuilder.CreateTube(name, options, scene);
         };
+        /**
+         * Creates a polyhedron mesh.
+         *
+         * Please consider using the same method from the `MeshBuilder` class instead.
+         * The parameter `type` (positive integer, max 14, default 0) sets the polyhedron type to build among the 15 embbeded types. Please refer to the type sheet in the tutorial
+         *  to choose the wanted type.
+         * The parameter `size` (positive float, default 1) sets the polygon size.
+         * You can overwrite the `size` on each dimension bu using the parameters `sizeX`, `sizeY` or `sizeZ` (positive floats, default to `size` value).
+         * You can build other polyhedron types than the 15 embbeded ones by setting the parameter `custom` (`polyhedronObject`, default null). If you set the parameter `custom`, this overwrittes the parameter `type`.
+         * A `polyhedronObject` is a formatted javascript object. You'll find a full file with pre-set polyhedra here : https://github.com/BabylonJS/Extensions/tree/master/Polyhedron
+         * You can set the color and the UV of each side of the polyhedron with the parameters `faceColors` (`Color4`, default `(1, 1, 1, 1)`) and faceUV (`Vector4`, default `(0, 0, 1, 1)`).
+         * To understand how to set `faceUV` or `faceColors`, please read this by considering the right number of faces of your polyhedron, instead of only 6 for the box : http://doc.babylonjs.com/tutorials/CreateBox_Per_Face_Textures_And_Colors
+         * The parameter `flat` (boolean, default true). If set to false, it gives the polyhedron a single global face, so less vertices and shared normals. In this case, `faceColors` and `faceUV` are ignored.
+         * You can also set the mesh side orientation with the values : BABYLON.Mesh.FRONTSIDE (default), BABYLON.Mesh.BACKSIDE or BABYLON.Mesh.DOUBLESIDE
+         * Detail here : http://doc.babylonjs.com/tutorials/02._Discover_Basic_Elements#side-orientation
+         * The mesh can be set to updatable with the boolean parameter `updatable` (default false) if its internal geometry is supposed to change once created.
+         */
         Mesh.CreatePolyhedron = function (name, options, scene) {
             return BABYLON.MeshBuilder.CreatePolyhedron(name, options, scene);
         };
+        /**
+         * Creates a sphere based upon an icosahedron with 20 triangular faces which can be subdivided.
+         * Please consider using the same method from the `MeshBuilder` class instead.
+         * The parameter `radius` sets the radius size (float) of the icosphere (default 1).
+         * You can set some different icosphere dimensions, for instance to build an ellipsoid, by using the parameters `radiusX`, `radiusY` and `radiusZ` (all by default have the same value than `radius`).
+         * The parameter `subdivisions` sets the number of subdivisions (postive integer, default 4). The more subdivisions, the more faces on the icosphere whatever its size.
+         * The parameter `flat` (boolean, default true) gives each side its own normals. Set it to false to get a smooth continuous light reflection on the surface.
+         * You can also set the mesh side orientation with the values : BABYLON.Mesh.FRONTSIDE (default), BABYLON.Mesh.BACKSIDE or BABYLON.Mesh.DOUBLESIDE
+         * Detail here : http://doc.babylonjs.com/tutorials/02._Discover_Basic_Elements#side-orientation
+         * The mesh can be set to updatable with the boolean parameter `updatable` (default false) if its internal geometry is supposed to change once created.
+         */
         Mesh.CreateIcoSphere = function (name, options, scene) {
             return BABYLON.MeshBuilder.CreateIcoSphere(name, options, scene);
         };
-        // Decals
+        /**
+         * Creates a decal mesh.
+         * Please consider using the same method from the `MeshBuilder` class instead.
+         * A decal is a mesh usually applied as a model onto the surface of another mesh. So don't forget the parameter `sourceMesh` depicting the decal.
+         * The parameter `position` (`Vector3`, default `(0, 0, 0)`) sets the position of the decal in World coordinates.
+         * The parameter `normal` (`Vector3`, default `Vector3.Up`) sets the normal of the mesh where the decal is applied onto in World coordinates.
+         * The parameter `size` (`Vector3`, default `(1, 1, 1)`) sets the decal scaling.
+         * The parameter `angle` (float in radian, default 0) sets the angle to rotate the decal.
+         */
         Mesh.CreateDecal = function (name, sourceMesh, position, normal, size, angle) {
             var options = {
                 position: position,

+ 9 - 8
src/Mesh/babylon.mesh.ts

@@ -182,23 +182,23 @@
         /**
          * @param {boolean} fullDetails - support for multiple levels of logging within scene loading
          */
-        public toString(fullDetails? : boolean) : string {
+        public toString(fullDetails?: boolean): string {
             var ret = super.toString(fullDetails);
             ret += ", n vertices: " + this.getTotalVertices();
             ret += ", parent: " + (this._waitingParentId ? this._waitingParentId : (this.parent ? this.parent.name : "NONE"));
 
-            if (this.animations){
-                for (var i = 0; i < this.animations.length; i++){
-                   ret += ", animation[0]: " + this.animations[i].toString(fullDetails);
+            if (this.animations) {
+                for (var i = 0; i < this.animations.length; i++) {
+                    ret += ", animation[0]: " + this.animations[i].toString(fullDetails);
                 }
             }
-            
-            if (fullDetails){
+
+            if (fullDetails) {
                 ret += ", flat shading: " + (this._geometry ? (this.getVerticesData(VertexBuffer.PositionKind).length / 3 === this.getIndices().length ? "YES" : "NO") : "UNKNOWN");
             }
             return ret;
-        } 
-        
+        }
+
         public get hasLODLevels(): boolean {
             return this._LODLevels.length > 0;
         }
@@ -2361,3 +2361,4 @@
     }
 }
 
+

+ 2 - 0
src/Mesh/babylon.meshBuilder.js

@@ -80,6 +80,8 @@ var BABYLON;
          * The parameter `pathArray` is a required array of paths, what are each an array of successive Vector3. The pathArray parameter depicts the ribbon geometry.
          * The parameter `closeArray` (boolean, default false) creates a seam between the first and the last paths of the path array.
          * The parameter `closePath` (boolean, default false) creates a seam between the first and the last points of each path of the path array.
+         * The parameter `offset` (positive integer, default : rounded half size of the pathArray length), is taken in account only if the `pathArray` is containing a single path.
+         * It's the offset to join the points from the same path. Ex : offset = 10 means the point 1 is joined to the point 11.
          * The optional parameter `instance` is an instance of an existing Ribbon object to be updated with the passed `pathArray` parameter : http://doc.babylonjs.com/tutorials/How_to_dynamically_morph_a_mesh#ribbon
          * You can also set the mesh side orientation with the values : BABYLON.Mesh.FRONTSIDE (default), BABYLON.Mesh.BACKSIDE or BABYLON.Mesh.DOUBLESIDE
          * Detail here : http://doc.babylonjs.com/tutorials/02._Discover_Basic_Elements#side-orientation

+ 1 - 0
src/Mesh/babylon.meshBuilder.ts

@@ -1115,3 +1115,4 @@
         }
     }
 }
+

+ 4 - 2
src/PostProcess/babylon.volumetricLightScatteringPostProcess.js

@@ -332,7 +332,9 @@ var BABYLON;
         VolumetricLightScatteringPostProcess.CreateDefaultMesh = function (name, scene) {
             var mesh = BABYLON.Mesh.CreatePlane(name, 1, scene);
             mesh.billboardMode = BABYLON.AbstractMesh.BILLBOARDMODE_ALL;
-            mesh.material = new BABYLON.StandardMaterial(name + "Material", scene);
+            var material = new BABYLON.StandardMaterial(name + "Material", scene);
+            material.emissiveColor = new BABYLON.Color3(1, 1, 1);
+            mesh.material = material;
             return mesh;
         };
         __decorate([
@@ -363,6 +365,6 @@ var BABYLON;
             BABYLON.serialize()
         ], VolumetricLightScatteringPostProcess.prototype, "density", void 0);
         return VolumetricLightScatteringPostProcess;
-    }(BABYLON.PostProcess));
+    })(BABYLON.PostProcess);
     BABYLON.VolumetricLightScatteringPostProcess = VolumetricLightScatteringPostProcess;
 })(BABYLON || (BABYLON = {}));

+ 6 - 1
src/PostProcess/babylon.volumetricLightScatteringPostProcess.ts

@@ -411,7 +411,12 @@
         public static CreateDefaultMesh(name: string, scene: Scene): Mesh {
             var mesh = Mesh.CreatePlane(name, 1, scene);
             mesh.billboardMode = AbstractMesh.BILLBOARDMODE_ALL;
-            mesh.material = new StandardMaterial(name + "Material", scene);
+
+            var material = new StandardMaterial(name + "Material", scene);
+            material.emissiveColor = new Color3(1, 1, 1);
+
+            mesh.material = material;
+
             return mesh;
         }
     }

+ 1 - 0
src/Shaders/volumetricLightScatteringPass.fragment.fx

@@ -17,3 +17,4 @@ void main(void)
 
 	gl_FragColor = vec4(0.0, 0.0, 0.0, 1.0);
 }
+

+ 11 - 0
src/Tools/babylon.observable.js

@@ -16,6 +16,9 @@ var BABYLON;
          * @param callback the callback that will be executed for that Observer
          */
         Observable.prototype.add = function (callback) {
+            if (!callback) {
+                return null;
+            }
             var observer = new Observer(callback);
             this._observers.push(observer);
             return observer;
@@ -60,6 +63,14 @@ var BABYLON;
         Observable.prototype.clear = function () {
             this._observers = new Array();
         };
+        /**
+        * Clone the current observable
+        */
+        Observable.prototype.clone = function () {
+            var result = new Observable();
+            result._observers = this._observers.slice(0);
+            return result;
+        };
         return Observable;
     })();
     BABYLON.Observable = Observable;

+ 17 - 2
src/Tools/babylon.observable.ts

@@ -12,6 +12,10 @@
          * @param callback the callback that will be executed for that Observer
          */
         public add(callback: (eventData: T) => void): Observer<T> {
+            if (!callback) {
+                return null;
+            }
+
             var observer = new Observer(callback);
 
             this._observers.push(observer);
@@ -56,7 +60,7 @@
          * Notify all Observers by calling their respective callback with the given data
          * @param eventData
          */
-        public notifyObservers(eventData: T) {
+        public notifyObservers(eventData: T): void {
             this._observers.forEach((observer: Observer<T>) => {
                 observer.callback(eventData);
             });
@@ -65,8 +69,19 @@
         /**
         * Clear the list of observers
         */
-        public clear() {
+        public clear(): void {
             this._observers = new Array<Observer<T>>();
         }
+
+        /**
+        * Clone the current observable
+        */
+        public clone(): Observable<T> {
+            var result = new Observable<T>();
+
+            result._observers = this._observers.slice(0);
+
+            return result;
+        }
     }
 }

+ 3 - 9
src/Tools/babylon.sceneSerializer.js

@@ -96,18 +96,12 @@ var BABYLON;
             serializationObject.skeletonId = mesh.skeleton.id;
         }
         // Physics
-        if (mesh.getPhysicsImpostor().type !== BABYLON.PhysicsEngine.NoImpostor) {
+        //TODO implement correct serialization for physics impostors.
+        if (mesh.getPhysicsImpostor()) {
             serializationObject.physicsMass = mesh.getPhysicsMass();
             serializationObject.physicsFriction = mesh.getPhysicsFriction();
             serializationObject.physicsRestitution = mesh.getPhysicsRestitution();
-            switch (mesh.getPhysicsImpostor().type) {
-                case BABYLON.PhysicsEngine.BoxImpostor:
-                    serializationObject.physicsImpostor = 1;
-                    break;
-                case BABYLON.PhysicsEngine.SphereImpostor:
-                    serializationObject.physicsImpostor = 2;
-                    break;
-            }
+            serializationObject.physicsImpostor = mesh.getPhysicsImpostor().type;
         }
         // Instances
         serializationObject.instances = [];

+ 1 - 0
src/Tools/babylon.sceneSerializer.ts

@@ -368,3 +368,4 @@
     }
 }
 
+