瀏覽代碼

Moving to beta
Fixing last steps of RH system

David Catuhe 9 年之前
父節點
當前提交
4eba4a2678

File diff suppressed because it is too large
+ 23 - 23
dist/preview release/babylon.core.js


File diff suppressed because it is too large
+ 6052 - 6052
dist/preview release/babylon.d.ts


File diff suppressed because it is too large
+ 34 - 34
dist/preview release/babylon.js


+ 27 - 84
dist/preview release/babylon.max.js

@@ -6773,7 +6773,7 @@ var BABYLON;
         });
         Object.defineProperty(Engine, "Version", {
             get: function () {
-                return "2.5.-alpha";
+                return "2.5.-beta";
             },
             enumerable: true,
             configurable: true
@@ -11294,20 +11294,10 @@ var BABYLON;
         PointLight.prototype.transferToEffect = function (effect, positionUniformName) {
             if (this.parent && this.parent.getWorldMatrix) {
                 this.computeTransformedPosition();
-                if (this.getScene().useRightHandedSystem) {
-                    effect.setFloat4(positionUniformName, -this.transformedPosition.x, -this.transformedPosition.y, -this.transformedPosition.z, 0);
-                }
-                else {
-                    effect.setFloat4(positionUniformName, this.transformedPosition.x, this.transformedPosition.y, this.transformedPosition.z, 0);
-                }
+                effect.setFloat4(positionUniformName, this.transformedPosition.x, this.transformedPosition.y, this.transformedPosition.z, 0);
                 return;
             }
-            if (this.getScene().useRightHandedSystem) {
-                effect.setFloat4(positionUniformName, -this.position.x, -this.position.y, -this.position.z, 0);
-            }
-            else {
-                effect.setFloat4(positionUniformName, this.position.x, this.position.y, this.position.z, 0);
-            }
+            effect.setFloat4(positionUniformName, this.position.x, this.position.y, this.position.z, 0);
         };
         PointLight.prototype.needCube = function () {
             return true;
@@ -11415,29 +11405,14 @@ var BABYLON;
                 }
                 this.computeTransformedPosition();
                 BABYLON.Vector3.TransformNormalToRef(this.direction, this.parent.getWorldMatrix(), this._transformedDirection);
-                if (this.getScene().useRightHandedSystem) {
-                    effect.setFloat4(positionUniformName, -this.transformedPosition.x, -this.transformedPosition.y, -this.transformedPosition.z, this.exponent);
-                }
-                else {
-                    effect.setFloat4(positionUniformName, this.transformedPosition.x, this.transformedPosition.y, this.transformedPosition.z, this.exponent);
-                }
+                effect.setFloat4(positionUniformName, this.transformedPosition.x, this.transformedPosition.y, this.transformedPosition.z, this.exponent);
                 normalizeDirection = BABYLON.Vector3.Normalize(this._transformedDirection);
             }
             else {
-                if (this.getScene().useRightHandedSystem) {
-                    effect.setFloat4(positionUniformName, -this.position.x, -this.position.y, -this.position.z, this.exponent);
-                }
-                else {
-                    effect.setFloat4(positionUniformName, this.position.x, this.position.y, this.position.z, this.exponent);
-                }
+                effect.setFloat4(positionUniformName, this.position.x, this.position.y, this.position.z, this.exponent);
                 normalizeDirection = BABYLON.Vector3.Normalize(this.direction);
             }
-            if (this.getScene().useRightHandedSystem) {
-                effect.setFloat4(directionUniformName, -normalizeDirection.x, -normalizeDirection.y, -normalizeDirection.z, Math.cos(this.angle * 0.5));
-            }
-            else {
-                effect.setFloat4(directionUniformName, normalizeDirection.x, normalizeDirection.y, normalizeDirection.z, Math.cos(this.angle * 0.5));
-            }
+            effect.setFloat4(directionUniformName, normalizeDirection.x, normalizeDirection.y, normalizeDirection.z, Math.cos(this.angle * 0.5));
         };
         SpotLight.prototype._getWorldMatrix = function () {
             if (!this._worldMatrix) {
@@ -11490,12 +11465,7 @@ var BABYLON;
         };
         HemisphericLight.prototype.transferToEffect = function (effect, directionUniformName, groundColorUniformName) {
             var normalizeDirection = BABYLON.Vector3.Normalize(this.direction);
-            if (this.getScene().useRightHandedSystem) {
-                effect.setFloat4(directionUniformName, -normalizeDirection.x, -normalizeDirection.y, -normalizeDirection.z, 0);
-            }
-            else {
-                effect.setFloat4(directionUniformName, normalizeDirection.x, normalizeDirection.y, normalizeDirection.z, 0);
-            }
+            effect.setFloat4(directionUniformName, normalizeDirection.x, normalizeDirection.y, normalizeDirection.z, 0);
             effect.setColor3(groundColorUniformName, this.groundColor.scale(this.intensity));
         };
         HemisphericLight.prototype._getWorldMatrix = function () {
@@ -11614,12 +11584,7 @@ var BABYLON;
                 effect.setFloat4(directionUniformName, this._transformedDirection.x, this._transformedDirection.y, this._transformedDirection.z, 1);
                 return;
             }
-            if (this.getScene().useRightHandedSystem) {
-                effect.setFloat4(directionUniformName, this.direction.x, this.direction.y, this.direction.z, -1);
-            }
-            else {
-                effect.setFloat4(directionUniformName, this.direction.x, this.direction.y, this.direction.z, 1);
-            }
+            effect.setFloat4(directionUniformName, this.direction.x, this.direction.y, this.direction.z, 1);
         };
         DirectionalLight.prototype._getWorldMatrix = function () {
             if (!this._worldMatrix) {
@@ -21633,32 +21598,14 @@ var BABYLON;
     var MeshBuilder = (function () {
         function MeshBuilder() {
         }
-        MeshBuilder.updateSideOrientationForRightHandedSystem = function (orientation, scene) {
+        MeshBuilder.updateSideOrientation = function (orientation, scene) {
             if (orientation == BABYLON.Mesh.DOUBLESIDE) {
                 return BABYLON.Mesh.DOUBLESIDE;
             }
-            if (!scene.useRightHandedSystem) {
-                if (orientation === undefined || orientation === null) {
-                    return BABYLON.Mesh.FRONTSIDE;
-                }
-                switch (orientation) {
-                    case BABYLON.Mesh.FRONTSIDE:
-                    case BABYLON.Mesh.DEFAULTSIDE:
-                        return BABYLON.Mesh.FRONTSIDE;
-                    default:
-                        return BABYLON.Mesh.BACKSIDE;
-                }
-            }
             if (orientation === undefined || orientation === null) {
-                return BABYLON.Mesh.BACKSIDE;
-            }
-            switch (orientation) {
-                case BABYLON.Mesh.FRONTSIDE:
-                case BABYLON.Mesh.DEFAULTSIDE:
-                    return BABYLON.Mesh.BACKSIDE;
-                default:
-                    return BABYLON.Mesh.FRONTSIDE;
+                return BABYLON.Mesh.FRONTSIDE;
             }
+            return orientation;
         };
         /**
          * Creates a box mesh.
@@ -21673,7 +21620,7 @@ var BABYLON;
          */
         MeshBuilder.CreateBox = function (name, options, scene) {
             var box = new BABYLON.Mesh(name, scene);
-            options.sideOrientation = this.updateSideOrientationForRightHandedSystem(options.sideOrientation, scene);
+            options.sideOrientation = this.updateSideOrientation(options.sideOrientation, scene);
             var vertexData = BABYLON.VertexData.CreateBox(options);
             vertexData.applyToMesh(box, options.updatable);
             return box;
@@ -21692,7 +21639,7 @@ var BABYLON;
          */
         MeshBuilder.CreateSphere = function (name, options, scene) {
             var sphere = new BABYLON.Mesh(name, scene);
-            options.sideOrientation = this.updateSideOrientationForRightHandedSystem(options.sideOrientation, scene);
+            options.sideOrientation = this.updateSideOrientation(options.sideOrientation, scene);
             var vertexData = BABYLON.VertexData.CreateSphere(options);
             vertexData.applyToMesh(sphere, options.updatable);
             return sphere;
@@ -21709,7 +21656,7 @@ var BABYLON;
          */
         MeshBuilder.CreateDisc = function (name, options, scene) {
             var disc = new BABYLON.Mesh(name, scene);
-            options.sideOrientation = this.updateSideOrientationForRightHandedSystem(options.sideOrientation, scene);
+            options.sideOrientation = this.updateSideOrientation(options.sideOrientation, scene);
             var vertexData = BABYLON.VertexData.CreateDisc(options);
             vertexData.applyToMesh(disc, options.updatable);
             return disc;
@@ -21727,7 +21674,7 @@ var BABYLON;
          */
         MeshBuilder.CreateIcoSphere = function (name, options, scene) {
             var sphere = new BABYLON.Mesh(name, scene);
-            options.sideOrientation = this.updateSideOrientationForRightHandedSystem(options.sideOrientation, scene);
+            options.sideOrientation = this.updateSideOrientation(options.sideOrientation, scene);
             var vertexData = BABYLON.VertexData.CreateIcoSphere(options);
             vertexData.applyToMesh(sphere, options.updatable);
             return sphere;
@@ -21754,7 +21701,7 @@ var BABYLON;
             var closeArray = options.closeArray;
             var closePath = options.closePath;
             var offset = options.offset;
-            var sideOrientation = this.updateSideOrientationForRightHandedSystem(options.sideOrientation, scene);
+            var sideOrientation = this.updateSideOrientation(options.sideOrientation, scene);
             var instance = options.instance;
             var updatable = options.updatable;
             if (instance) {
@@ -21876,7 +21823,7 @@ var BABYLON;
          */
         MeshBuilder.CreateCylinder = function (name, options, scene) {
             var cylinder = new BABYLON.Mesh(name, scene);
-            options.sideOrientation = this.updateSideOrientationForRightHandedSystem(options.sideOrientation, scene);
+            options.sideOrientation = this.updateSideOrientation(options.sideOrientation, scene);
             var vertexData = BABYLON.VertexData.CreateCylinder(options);
             vertexData.applyToMesh(cylinder, options.updatable);
             return cylinder;
@@ -21893,7 +21840,7 @@ var BABYLON;
          */
         MeshBuilder.CreateTorus = function (name, options, scene) {
             var torus = new BABYLON.Mesh(name, scene);
-            options.sideOrientation = this.updateSideOrientationForRightHandedSystem(options.sideOrientation, scene);
+            options.sideOrientation = this.updateSideOrientation(options.sideOrientation, scene);
             var vertexData = BABYLON.VertexData.CreateTorus(options);
             vertexData.applyToMesh(torus, options.updatable);
             return torus;
@@ -21911,7 +21858,7 @@ var BABYLON;
          */
         MeshBuilder.CreateTorusKnot = function (name, options, scene) {
             var torusKnot = new BABYLON.Mesh(name, scene);
-            options.sideOrientation = this.updateSideOrientationForRightHandedSystem(options.sideOrientation, scene);
+            options.sideOrientation = this.updateSideOrientation(options.sideOrientation, scene);
             var vertexData = BABYLON.VertexData.CreateTorusKnot(options);
             vertexData.applyToMesh(torusKnot, options.updatable);
             return torusKnot;
@@ -22065,7 +22012,7 @@ var BABYLON;
             var rotation = options.rotation || 0;
             var cap = (options.cap === 0) ? 0 : options.cap || BABYLON.Mesh.NO_CAP;
             var updatable = options.updatable;
-            var sideOrientation = this.updateSideOrientationForRightHandedSystem(options.sideOrientation, scene);
+            var sideOrientation = this.updateSideOrientation(options.sideOrientation, scene);
             var instance = options.instance;
             var invertUV = options.invertUV || false;
             return MeshBuilder._ExtrudeShapeGeneric(name, shape, path, scale, rotation, null, null, false, false, cap, false, scene, updatable, sideOrientation, instance, invertUV);
@@ -22114,7 +22061,7 @@ var BABYLON;
             var ribbonClosePath = options.ribbonClosePath || false;
             var cap = (options.cap === 0) ? 0 : options.cap || BABYLON.Mesh.NO_CAP;
             var updatable = options.updatable;
-            var sideOrientation = this.updateSideOrientationForRightHandedSystem(options.sideOrientation, scene);
+            var sideOrientation = this.updateSideOrientation(options.sideOrientation, scene);
             var instance = options.instance;
             var invertUV = options.invertUV || false;
             return MeshBuilder._ExtrudeShapeGeneric(name, shape, path, null, null, scaleFunction, rotationFunction, ribbonCloseArray, ribbonClosePath, cap, true, scene, updatable, sideOrientation, instance, invertUV);
@@ -22143,7 +22090,7 @@ var BABYLON;
             var radius = options.radius || 1;
             var tessellation = options.tessellation || 64;
             var updatable = options.updatable;
-            var sideOrientation = this.updateSideOrientationForRightHandedSystem(options.sideOrientation, scene);
+            var sideOrientation = this.updateSideOrientation(options.sideOrientation, scene);
             var cap = options.cap || BABYLON.Mesh.NO_CAP;
             var pi2 = Math.PI * 2;
             var paths = new Array();
@@ -22186,7 +22133,7 @@ var BABYLON;
          */
         MeshBuilder.CreatePlane = function (name, options, scene) {
             var plane = new BABYLON.Mesh(name, scene);
-            options.sideOrientation = this.updateSideOrientationForRightHandedSystem(options.sideOrientation, scene);
+            options.sideOrientation = this.updateSideOrientation(options.sideOrientation, scene);
             var vertexData = BABYLON.VertexData.CreatePlane(options);
             vertexData.applyToMesh(plane, options.updatable);
             if (options.sourcePlane) {
@@ -22332,7 +22279,7 @@ var BABYLON;
             var cap = options.cap || BABYLON.Mesh.NO_CAP;
             var invertUV = options.invertUV || false;
             var updatable = options.updatable;
-            var sideOrientation = this.updateSideOrientationForRightHandedSystem(options.sideOrientation, scene);
+            var sideOrientation = this.updateSideOrientation(options.sideOrientation, scene);
             var instance = options.instance;
             options.arc = (options.arc <= 0.0 || options.arc > 1.0) ? 1.0 : options.arc || 1.0;
             // tube geometry
@@ -22438,7 +22385,7 @@ var BABYLON;
          */
         MeshBuilder.CreatePolyhedron = function (name, options, scene) {
             var polyhedron = new BABYLON.Mesh(name, scene);
-            options.sideOrientation = this.updateSideOrientationForRightHandedSystem(options.sideOrientation, scene);
+            options.sideOrientation = this.updateSideOrientation(options.sideOrientation, scene);
             var vertexData = BABYLON.VertexData.CreatePolyhedron(options);
             vertexData.applyToMesh(polyhedron, options.updatable);
             return polyhedron;
@@ -25308,12 +25255,7 @@ var BABYLON;
             this._fillMode = Material.TriangleFillMode;
             this.id = name;
             this._scene = scene;
-            if (scene.useRightHandedSystem) {
-                this.sideOrientation = Material.ClockWiseSideOrientation;
-            }
-            else {
-                this.sideOrientation = Material.CounterClockWiseSideOrientation;
-            }
+            this.sideOrientation = Material.CounterClockWiseSideOrientation;
             if (!doNotAdd) {
                 scene.materials.push(this);
             }
@@ -36463,6 +36405,7 @@ var BABYLON;
                     }
                     else {
                         if (!codecSupportedFound) {
+                            this._isReadyToPlay = true;
                             // Simulating a ready to play event to avoid breaking code path
                             if (this._readyToPlayCallback) {
                                 window.setTimeout(function () {

File diff suppressed because it is too large
+ 38 - 38
dist/preview release/babylon.noworker.js


+ 1 - 0
src/Audio/babylon.sound.js

@@ -145,6 +145,7 @@ var BABYLON;
                     }
                     else {
                         if (!codecSupportedFound) {
+                            this._isReadyToPlay = true;
                             // Simulating a ready to play event to avoid breaking code path
                             if (this._readyToPlayCallback) {
                                 window.setTimeout(function () {

+ 1 - 6
src/Lights/babylon.directionalLight.js

@@ -99,12 +99,7 @@ var BABYLON;
                 effect.setFloat4(directionUniformName, this._transformedDirection.x, this._transformedDirection.y, this._transformedDirection.z, 1);
                 return;
             }
-            if (this.getScene().useRightHandedSystem) {
-                effect.setFloat4(directionUniformName, this.direction.x, this.direction.y, this.direction.z, -1);
-            }
-            else {
-                effect.setFloat4(directionUniformName, this.direction.x, this.direction.y, this.direction.z, 1);
-            }
+            effect.setFloat4(directionUniformName, this.direction.x, this.direction.y, this.direction.z, 1);
         };
         DirectionalLight.prototype._getWorldMatrix = function () {
             if (!this._worldMatrix) {

+ 1 - 5
src/Lights/babylon.directionalLight.ts

@@ -130,11 +130,7 @@
                 return;
             }
 
-            if (this.getScene().useRightHandedSystem) {
-                effect.setFloat4(directionUniformName, this.direction.x, this.direction.y, this.direction.z, -1);
-            } else {
-                effect.setFloat4(directionUniformName, this.direction.x, this.direction.y, this.direction.z, 1);
-            }
+            effect.setFloat4(directionUniformName, this.direction.x, this.direction.y, this.direction.z, 1);
         }
 
         public _getWorldMatrix(): Matrix {

+ 1 - 6
src/Lights/babylon.hemisphericLight.js

@@ -27,12 +27,7 @@ var BABYLON;
         };
         HemisphericLight.prototype.transferToEffect = function (effect, directionUniformName, groundColorUniformName) {
             var normalizeDirection = BABYLON.Vector3.Normalize(this.direction);
-            if (this.getScene().useRightHandedSystem) {
-                effect.setFloat4(directionUniformName, -normalizeDirection.x, -normalizeDirection.y, -normalizeDirection.z, 0);
-            }
-            else {
-                effect.setFloat4(directionUniformName, normalizeDirection.x, normalizeDirection.y, normalizeDirection.z, 0);
-            }
+            effect.setFloat4(directionUniformName, normalizeDirection.x, normalizeDirection.y, normalizeDirection.z, 0);
             effect.setColor3(groundColorUniformName, this.groundColor.scale(this.intensity));
         };
         HemisphericLight.prototype._getWorldMatrix = function () {

+ 7 - 13
src/Lights/babylon.hemisphericLight.ts

@@ -25,19 +25,13 @@
 
         public transferToEffect(effect: Effect, directionUniformName: string, groundColorUniformName: string): void {
             var normalizeDirection = Vector3.Normalize(this.direction);
-            if (this.getScene().useRightHandedSystem) {
-                effect.setFloat4(directionUniformName,
-                    -normalizeDirection.x,
-                    -normalizeDirection.y,
-                    -normalizeDirection.z,
-                    0);
-            } else {
-                effect.setFloat4(directionUniformName,
-                    normalizeDirection.x,
-                    normalizeDirection.y,
-                    normalizeDirection.z,
-                    0);
-            }
+
+            effect.setFloat4(directionUniformName,
+                normalizeDirection.x,
+                normalizeDirection.y,
+                normalizeDirection.z,
+                0);
+
             effect.setColor3(groundColorUniformName, this.groundColor.scale(this.intensity));
         }
 

+ 2 - 12
src/Lights/babylon.pointLight.js

@@ -33,20 +33,10 @@ var BABYLON;
         PointLight.prototype.transferToEffect = function (effect, positionUniformName) {
             if (this.parent && this.parent.getWorldMatrix) {
                 this.computeTransformedPosition();
-                if (this.getScene().useRightHandedSystem) {
-                    effect.setFloat4(positionUniformName, -this.transformedPosition.x, -this.transformedPosition.y, -this.transformedPosition.z, 0);
-                }
-                else {
-                    effect.setFloat4(positionUniformName, this.transformedPosition.x, this.transformedPosition.y, this.transformedPosition.z, 0);
-                }
+                effect.setFloat4(positionUniformName, this.transformedPosition.x, this.transformedPosition.y, this.transformedPosition.z, 0);
                 return;
             }
-            if (this.getScene().useRightHandedSystem) {
-                effect.setFloat4(positionUniformName, -this.position.x, -this.position.y, -this.position.z, 0);
-            }
-            else {
-                effect.setFloat4(positionUniformName, this.position.x, this.position.y, this.position.z, 0);
-            }
+            effect.setFloat4(positionUniformName, this.position.x, this.position.y, this.position.z, 0);
         };
         PointLight.prototype.needCube = function () {
             return true;

+ 6 - 18
src/Lights/babylon.pointLight.ts

@@ -34,28 +34,16 @@
             if (this.parent && this.parent.getWorldMatrix) {
                 this.computeTransformedPosition();
 
-                if (this.getScene().useRightHandedSystem) {
-                    effect.setFloat4(positionUniformName,
-                        -this.transformedPosition.x,
-                        -this.transformedPosition.y,
-                        -this.transformedPosition.z,
-                        0);
-                } else {
-                    effect.setFloat4(positionUniformName,
-                        this.transformedPosition.x,
-                        this.transformedPosition.y,
-                        this.transformedPosition.z,
-                        0); 
-                }
+                effect.setFloat4(positionUniformName,
+                    this.transformedPosition.x,
+                    this.transformedPosition.y,
+                    this.transformedPosition.z,
+                    0); 
 
                 return;
             }
 
-            if (this.getScene().useRightHandedSystem) {
-                effect.setFloat4(positionUniformName, -this.position.x, -this.position.y, -this.position.z, 0);
-            } else {
-                effect.setFloat4(positionUniformName, this.position.x, this.position.y, this.position.z, 0);
-            }
+            effect.setFloat4(positionUniformName, this.position.x, this.position.y, this.position.z, 0);
         }
 
         public needCube(): boolean {

+ 3 - 18
src/Lights/babylon.spotLight.js

@@ -61,29 +61,14 @@ var BABYLON;
                 }
                 this.computeTransformedPosition();
                 BABYLON.Vector3.TransformNormalToRef(this.direction, this.parent.getWorldMatrix(), this._transformedDirection);
-                if (this.getScene().useRightHandedSystem) {
-                    effect.setFloat4(positionUniformName, -this.transformedPosition.x, -this.transformedPosition.y, -this.transformedPosition.z, this.exponent);
-                }
-                else {
-                    effect.setFloat4(positionUniformName, this.transformedPosition.x, this.transformedPosition.y, this.transformedPosition.z, this.exponent);
-                }
+                effect.setFloat4(positionUniformName, this.transformedPosition.x, this.transformedPosition.y, this.transformedPosition.z, this.exponent);
                 normalizeDirection = BABYLON.Vector3.Normalize(this._transformedDirection);
             }
             else {
-                if (this.getScene().useRightHandedSystem) {
-                    effect.setFloat4(positionUniformName, -this.position.x, -this.position.y, -this.position.z, this.exponent);
-                }
-                else {
-                    effect.setFloat4(positionUniformName, this.position.x, this.position.y, this.position.z, this.exponent);
-                }
+                effect.setFloat4(positionUniformName, this.position.x, this.position.y, this.position.z, this.exponent);
                 normalizeDirection = BABYLON.Vector3.Normalize(this.direction);
             }
-            if (this.getScene().useRightHandedSystem) {
-                effect.setFloat4(directionUniformName, -normalizeDirection.x, -normalizeDirection.y, -normalizeDirection.z, Math.cos(this.angle * 0.5));
-            }
-            else {
-                effect.setFloat4(directionUniformName, normalizeDirection.x, normalizeDirection.y, normalizeDirection.z, Math.cos(this.angle * 0.5));
-            }
+            effect.setFloat4(directionUniformName, normalizeDirection.x, normalizeDirection.y, normalizeDirection.z, Math.cos(this.angle * 0.5));
         };
         SpotLight.prototype._getWorldMatrix = function () {
             if (!this._worldMatrix) {

+ 17 - 40
src/Lights/babylon.spotLight.ts

@@ -81,51 +81,28 @@
                 
                 Vector3.TransformNormalToRef(this.direction, this.parent.getWorldMatrix(), this._transformedDirection);
 
-                if (this.getScene().useRightHandedSystem) {
-                    effect.setFloat4(positionUniformName,
-                        -this.transformedPosition.x,
-                        -this.transformedPosition.y,
-                        -this.transformedPosition.z,
-                        this.exponent);
-                } else {
-                    effect.setFloat4(positionUniformName,
-                        this.transformedPosition.x,
-                        this.transformedPosition.y,
-                        this.transformedPosition.z,
-                        this.exponent);
-                }
+                effect.setFloat4(positionUniformName,
+                    this.transformedPosition.x,
+                    this.transformedPosition.y,
+                    this.transformedPosition.z,
+                    this.exponent);
+
                 normalizeDirection = Vector3.Normalize(this._transformedDirection);
             } else {
-                if (this.getScene().useRightHandedSystem) {
-                    effect.setFloat4(positionUniformName,
-                        -this.position.x,
-                        -this.position.y,
-                        -this.position.z,
-                        this.exponent);
-                } else {
-                    effect.setFloat4(positionUniformName,
-                        this.position.x,
-                        this.position.y,
-                        this.position.z,
-                        this.exponent);                    
-                }
+                effect.setFloat4(positionUniformName,
+                    this.position.x,
+                    this.position.y,
+                    this.position.z,
+                    this.exponent);                    
+
                 normalizeDirection = Vector3.Normalize(this.direction);
             }
 
-            if (this.getScene().useRightHandedSystem) {
-                effect.setFloat4(directionUniformName,
-                    -normalizeDirection.x,
-                    -normalizeDirection.y,
-                    -normalizeDirection.z,
-                    Math.cos(this.angle * 0.5));
-            } else {
-                effect.setFloat4(directionUniformName,
-                    normalizeDirection.x,
-                    normalizeDirection.y,
-                    normalizeDirection.z,
-                    Math.cos(this.angle * 0.5));
-                
-            }
+            effect.setFloat4(directionUniformName,
+                normalizeDirection.x,
+                normalizeDirection.y,
+                normalizeDirection.z,
+                Math.cos(this.angle * 0.5));
         }
 
         public _getWorldMatrix(): Matrix {

+ 1 - 6
src/Materials/babylon.material.js

@@ -95,12 +95,7 @@ var BABYLON;
             this._fillMode = Material.TriangleFillMode;
             this.id = name;
             this._scene = scene;
-            if (scene.useRightHandedSystem) {
-                this.sideOrientation = Material.ClockWiseSideOrientation;
-            }
-            else {
-                this.sideOrientation = Material.CounterClockWiseSideOrientation;
-            }
+            this.sideOrientation = Material.CounterClockWiseSideOrientation;
             if (!doNotAdd) {
                 scene.materials.push(this);
             }

+ 1 - 6
src/Materials/babylon.material.ts

@@ -208,12 +208,7 @@
             this.id = name;
 
             this._scene = scene;
-
-            if (scene.useRightHandedSystem) {
-                this.sideOrientation = Material.ClockWiseSideOrientation;
-            } else {
-                this.sideOrientation = Material.CounterClockWiseSideOrientation;
-            }
+            this.sideOrientation = Material.CounterClockWiseSideOrientation;
 
             if (!doNotAdd) {
                 scene.materials.push(this);

+ 17 - 35
src/Mesh/babylon.meshBuilder.js

@@ -3,32 +3,14 @@ var BABYLON;
     var MeshBuilder = (function () {
         function MeshBuilder() {
         }
-        MeshBuilder.updateSideOrientationForRightHandedSystem = function (orientation, scene) {
+        MeshBuilder.updateSideOrientation = function (orientation, scene) {
             if (orientation == BABYLON.Mesh.DOUBLESIDE) {
                 return BABYLON.Mesh.DOUBLESIDE;
             }
-            if (!scene.useRightHandedSystem) {
-                if (orientation === undefined || orientation === null) {
-                    return BABYLON.Mesh.FRONTSIDE;
-                }
-                switch (orientation) {
-                    case BABYLON.Mesh.FRONTSIDE:
-                    case BABYLON.Mesh.DEFAULTSIDE:
-                        return BABYLON.Mesh.FRONTSIDE;
-                    default:
-                        return BABYLON.Mesh.BACKSIDE;
-                }
-            }
             if (orientation === undefined || orientation === null) {
-                return BABYLON.Mesh.BACKSIDE;
-            }
-            switch (orientation) {
-                case BABYLON.Mesh.FRONTSIDE:
-                case BABYLON.Mesh.DEFAULTSIDE:
-                    return BABYLON.Mesh.BACKSIDE;
-                default:
-                    return BABYLON.Mesh.FRONTSIDE;
+                return BABYLON.Mesh.FRONTSIDE;
             }
+            return orientation;
         };
         /**
          * Creates a box mesh.
@@ -43,7 +25,7 @@ var BABYLON;
          */
         MeshBuilder.CreateBox = function (name, options, scene) {
             var box = new BABYLON.Mesh(name, scene);
-            options.sideOrientation = this.updateSideOrientationForRightHandedSystem(options.sideOrientation, scene);
+            options.sideOrientation = this.updateSideOrientation(options.sideOrientation, scene);
             var vertexData = BABYLON.VertexData.CreateBox(options);
             vertexData.applyToMesh(box, options.updatable);
             return box;
@@ -62,7 +44,7 @@ var BABYLON;
          */
         MeshBuilder.CreateSphere = function (name, options, scene) {
             var sphere = new BABYLON.Mesh(name, scene);
-            options.sideOrientation = this.updateSideOrientationForRightHandedSystem(options.sideOrientation, scene);
+            options.sideOrientation = this.updateSideOrientation(options.sideOrientation, scene);
             var vertexData = BABYLON.VertexData.CreateSphere(options);
             vertexData.applyToMesh(sphere, options.updatable);
             return sphere;
@@ -79,7 +61,7 @@ var BABYLON;
          */
         MeshBuilder.CreateDisc = function (name, options, scene) {
             var disc = new BABYLON.Mesh(name, scene);
-            options.sideOrientation = this.updateSideOrientationForRightHandedSystem(options.sideOrientation, scene);
+            options.sideOrientation = this.updateSideOrientation(options.sideOrientation, scene);
             var vertexData = BABYLON.VertexData.CreateDisc(options);
             vertexData.applyToMesh(disc, options.updatable);
             return disc;
@@ -97,7 +79,7 @@ var BABYLON;
          */
         MeshBuilder.CreateIcoSphere = function (name, options, scene) {
             var sphere = new BABYLON.Mesh(name, scene);
-            options.sideOrientation = this.updateSideOrientationForRightHandedSystem(options.sideOrientation, scene);
+            options.sideOrientation = this.updateSideOrientation(options.sideOrientation, scene);
             var vertexData = BABYLON.VertexData.CreateIcoSphere(options);
             vertexData.applyToMesh(sphere, options.updatable);
             return sphere;
@@ -124,7 +106,7 @@ var BABYLON;
             var closeArray = options.closeArray;
             var closePath = options.closePath;
             var offset = options.offset;
-            var sideOrientation = this.updateSideOrientationForRightHandedSystem(options.sideOrientation, scene);
+            var sideOrientation = this.updateSideOrientation(options.sideOrientation, scene);
             var instance = options.instance;
             var updatable = options.updatable;
             if (instance) {
@@ -246,7 +228,7 @@ var BABYLON;
          */
         MeshBuilder.CreateCylinder = function (name, options, scene) {
             var cylinder = new BABYLON.Mesh(name, scene);
-            options.sideOrientation = this.updateSideOrientationForRightHandedSystem(options.sideOrientation, scene);
+            options.sideOrientation = this.updateSideOrientation(options.sideOrientation, scene);
             var vertexData = BABYLON.VertexData.CreateCylinder(options);
             vertexData.applyToMesh(cylinder, options.updatable);
             return cylinder;
@@ -263,7 +245,7 @@ var BABYLON;
          */
         MeshBuilder.CreateTorus = function (name, options, scene) {
             var torus = new BABYLON.Mesh(name, scene);
-            options.sideOrientation = this.updateSideOrientationForRightHandedSystem(options.sideOrientation, scene);
+            options.sideOrientation = this.updateSideOrientation(options.sideOrientation, scene);
             var vertexData = BABYLON.VertexData.CreateTorus(options);
             vertexData.applyToMesh(torus, options.updatable);
             return torus;
@@ -281,7 +263,7 @@ var BABYLON;
          */
         MeshBuilder.CreateTorusKnot = function (name, options, scene) {
             var torusKnot = new BABYLON.Mesh(name, scene);
-            options.sideOrientation = this.updateSideOrientationForRightHandedSystem(options.sideOrientation, scene);
+            options.sideOrientation = this.updateSideOrientation(options.sideOrientation, scene);
             var vertexData = BABYLON.VertexData.CreateTorusKnot(options);
             vertexData.applyToMesh(torusKnot, options.updatable);
             return torusKnot;
@@ -435,7 +417,7 @@ var BABYLON;
             var rotation = options.rotation || 0;
             var cap = (options.cap === 0) ? 0 : options.cap || BABYLON.Mesh.NO_CAP;
             var updatable = options.updatable;
-            var sideOrientation = this.updateSideOrientationForRightHandedSystem(options.sideOrientation, scene);
+            var sideOrientation = this.updateSideOrientation(options.sideOrientation, scene);
             var instance = options.instance;
             var invertUV = options.invertUV || false;
             return MeshBuilder._ExtrudeShapeGeneric(name, shape, path, scale, rotation, null, null, false, false, cap, false, scene, updatable, sideOrientation, instance, invertUV);
@@ -484,7 +466,7 @@ var BABYLON;
             var ribbonClosePath = options.ribbonClosePath || false;
             var cap = (options.cap === 0) ? 0 : options.cap || BABYLON.Mesh.NO_CAP;
             var updatable = options.updatable;
-            var sideOrientation = this.updateSideOrientationForRightHandedSystem(options.sideOrientation, scene);
+            var sideOrientation = this.updateSideOrientation(options.sideOrientation, scene);
             var instance = options.instance;
             var invertUV = options.invertUV || false;
             return MeshBuilder._ExtrudeShapeGeneric(name, shape, path, null, null, scaleFunction, rotationFunction, ribbonCloseArray, ribbonClosePath, cap, true, scene, updatable, sideOrientation, instance, invertUV);
@@ -513,7 +495,7 @@ var BABYLON;
             var radius = options.radius || 1;
             var tessellation = options.tessellation || 64;
             var updatable = options.updatable;
-            var sideOrientation = this.updateSideOrientationForRightHandedSystem(options.sideOrientation, scene);
+            var sideOrientation = this.updateSideOrientation(options.sideOrientation, scene);
             var cap = options.cap || BABYLON.Mesh.NO_CAP;
             var pi2 = Math.PI * 2;
             var paths = new Array();
@@ -556,7 +538,7 @@ var BABYLON;
          */
         MeshBuilder.CreatePlane = function (name, options, scene) {
             var plane = new BABYLON.Mesh(name, scene);
-            options.sideOrientation = this.updateSideOrientationForRightHandedSystem(options.sideOrientation, scene);
+            options.sideOrientation = this.updateSideOrientation(options.sideOrientation, scene);
             var vertexData = BABYLON.VertexData.CreatePlane(options);
             vertexData.applyToMesh(plane, options.updatable);
             if (options.sourcePlane) {
@@ -702,7 +684,7 @@ var BABYLON;
             var cap = options.cap || BABYLON.Mesh.NO_CAP;
             var invertUV = options.invertUV || false;
             var updatable = options.updatable;
-            var sideOrientation = this.updateSideOrientationForRightHandedSystem(options.sideOrientation, scene);
+            var sideOrientation = this.updateSideOrientation(options.sideOrientation, scene);
             var instance = options.instance;
             options.arc = (options.arc <= 0.0 || options.arc > 1.0) ? 1.0 : options.arc || 1.0;
             // tube geometry
@@ -808,7 +790,7 @@ var BABYLON;
          */
         MeshBuilder.CreatePolyhedron = function (name, options, scene) {
             var polyhedron = new BABYLON.Mesh(name, scene);
-            options.sideOrientation = this.updateSideOrientationForRightHandedSystem(options.sideOrientation, scene);
+            options.sideOrientation = this.updateSideOrientation(options.sideOrientation, scene);
             var vertexData = BABYLON.VertexData.CreatePolyhedron(options);
             vertexData.applyToMesh(polyhedron, options.updatable);
             return polyhedron;

+ 17 - 37
src/Mesh/babylon.meshBuilder.ts

@@ -1,35 +1,15 @@
 module BABYLON {
     export class MeshBuilder {
-        private static updateSideOrientationForRightHandedSystem(orientation: number, scene: Scene): number {
+        private static updateSideOrientation(orientation: number, scene: Scene): number {
             if (orientation == Mesh.DOUBLESIDE) {
                 return Mesh.DOUBLESIDE;
             }
 
-            if (!scene.useRightHandedSystem) {
-                if (orientation === undefined || orientation === null) {
-                    return Mesh.FRONTSIDE;
-                }
-
-                switch (orientation) {
-                    case Mesh.FRONTSIDE:
-                    case Mesh.DEFAULTSIDE:
-                        return Mesh.FRONTSIDE;
-                    default:
-                        return Mesh.BACKSIDE;
-                }
-            }
-
             if (orientation === undefined || orientation === null) {
-                return Mesh.BACKSIDE;
+                return Mesh.FRONTSIDE;
             }
 
-            switch (orientation) {
-                case Mesh.FRONTSIDE:
-                case Mesh.DEFAULTSIDE:
-                    return Mesh.BACKSIDE;
-                default:
-                    return Mesh.FRONTSIDE;
-            }
+            return orientation;
         }
 
         /**
@@ -46,7 +26,7 @@
         public static CreateBox(name: string, options: { size?: number, width?: number, height?: number, depth?: number, faceUV?: Vector4[], faceColors?: Color4[], sideOrientation?: number, updatable?: boolean }, scene: Scene): Mesh {
             var box = new Mesh(name, scene);
 
-            options.sideOrientation = this.updateSideOrientationForRightHandedSystem(options.sideOrientation, scene);
+            options.sideOrientation = this.updateSideOrientation(options.sideOrientation, scene);
 
             var vertexData = VertexData.CreateBox(options);
 
@@ -70,7 +50,7 @@
         public static CreateSphere(name: string, options: { segments?: number, diameter?: number, diameterX?: number, diameterY?: number, diameterZ?: number, arc?: number, slice?: number, sideOrientation?: number, updatable?: boolean }, scene: any): Mesh {
             var sphere = new Mesh(name, scene);
 
-            options.sideOrientation = this.updateSideOrientationForRightHandedSystem(options.sideOrientation, scene);
+            options.sideOrientation = this.updateSideOrientation(options.sideOrientation, scene);
 
             var vertexData = VertexData.CreateSphere(options);
 
@@ -92,7 +72,7 @@
         public static CreateDisc(name: string, options: { radius?: number, tessellation?: number, arc?: number, updatable?: boolean, sideOrientation?: number }, scene: Scene): Mesh {
             var disc = new Mesh(name, scene);
 
-            options.sideOrientation = this.updateSideOrientationForRightHandedSystem(options.sideOrientation, scene);
+            options.sideOrientation = this.updateSideOrientation(options.sideOrientation, scene);
 
             var vertexData = VertexData.CreateDisc(options);
 
@@ -115,7 +95,7 @@
         public static CreateIcoSphere(name: string, options: { radius?: number, radiusX?: number, radiusY?: number, radiusZ?: number, flat?: boolean, subdivisions?: number, sideOrientation?: number, updatable?: boolean }, scene: Scene): Mesh {
             var sphere = new Mesh(name, scene);
 
-            options.sideOrientation = this.updateSideOrientationForRightHandedSystem(options.sideOrientation, scene);
+            options.sideOrientation = this.updateSideOrientation(options.sideOrientation, scene);
 
             var vertexData = VertexData.CreateIcoSphere(options);
 
@@ -145,7 +125,7 @@
             var closeArray = options.closeArray;
             var closePath = options.closePath;
             var offset = options.offset;
-            var sideOrientation = this.updateSideOrientationForRightHandedSystem(options.sideOrientation, scene);
+            var sideOrientation = this.updateSideOrientation(options.sideOrientation, scene);
             var instance = options.instance;
             var updatable = options.updatable;
 
@@ -277,7 +257,7 @@
         public static CreateCylinder(name: string, options: { height?: number, diameterTop?: number, diameterBottom?: number, diameter?: number, tessellation?: number, subdivisions?: number, arc?: number, faceColors?: Color4[], faceUV?: Vector4[], updatable?: boolean, hasRings?: boolean, enclose?: boolean, sideOrientation?: number }, scene: any): Mesh {
             var cylinder = new Mesh(name, scene);
 
-            options.sideOrientation = this.updateSideOrientationForRightHandedSystem(options.sideOrientation, scene);
+            options.sideOrientation = this.updateSideOrientation(options.sideOrientation, scene);
 
             var vertexData = VertexData.CreateCylinder(options);
 
@@ -299,7 +279,7 @@
         public static CreateTorus(name: string, options: { diameter?: number, thickness?: number, tessellation?: number, updatable?: boolean, sideOrientation?: number }, scene: any): Mesh {
             var torus = new Mesh(name, scene);
 
-            options.sideOrientation = this.updateSideOrientationForRightHandedSystem(options.sideOrientation, scene);
+            options.sideOrientation = this.updateSideOrientation(options.sideOrientation, scene);
 
             var vertexData = VertexData.CreateTorus(options);
 
@@ -322,7 +302,7 @@
         public static CreateTorusKnot(name: string, options: { radius?: number, tube?: number, radialSegments?: number, tubularSegments?: number, p?: number, q?: number, updatable?: boolean, sideOrientation?: number }, scene: any): Mesh {
             var torusKnot = new Mesh(name, scene);
 
-            options.sideOrientation = this.updateSideOrientationForRightHandedSystem(options.sideOrientation, scene);
+            options.sideOrientation = this.updateSideOrientation(options.sideOrientation, scene);
 
             var vertexData = VertexData.CreateTorusKnot(options);
 
@@ -486,7 +466,7 @@
             var rotation = options.rotation || 0;
             var cap = (options.cap === 0) ? 0 : options.cap || Mesh.NO_CAP;
             var updatable = options.updatable;
-            var sideOrientation = this.updateSideOrientationForRightHandedSystem(options.sideOrientation, scene);
+            var sideOrientation = this.updateSideOrientation(options.sideOrientation, scene);
             var instance = options.instance;
             var invertUV = options.invertUV || false;
 
@@ -537,7 +517,7 @@
             var ribbonClosePath = options.ribbonClosePath || false;
             var cap = (options.cap === 0) ? 0 : options.cap || Mesh.NO_CAP;
             var updatable = options.updatable;
-            var sideOrientation = this.updateSideOrientationForRightHandedSystem(options.sideOrientation, scene);
+            var sideOrientation = this.updateSideOrientation(options.sideOrientation, scene);
             var instance = options.instance;
             var invertUV = options.invertUV || false;
             return MeshBuilder._ExtrudeShapeGeneric(name, shape, path, null, null, scaleFunction, rotationFunction, ribbonCloseArray, ribbonClosePath, cap, true, scene, updatable, sideOrientation, instance, invertUV);
@@ -567,7 +547,7 @@
             var radius = options.radius || 1;
             var tessellation = options.tessellation || 64;
             var updatable = options.updatable;
-            var sideOrientation = this.updateSideOrientationForRightHandedSystem(options.sideOrientation, scene);
+            var sideOrientation = this.updateSideOrientation(options.sideOrientation, scene);
             var cap = options.cap || Mesh.NO_CAP;
             var pi2 = Math.PI * 2;
             var paths = new Array();
@@ -613,7 +593,7 @@
         public static CreatePlane(name: string, options: { size?: number, width?: number, height?: number, sideOrientation?: number, updatable?: boolean, sourcePlane?: Plane }, scene: Scene): Mesh {
             var plane = new Mesh(name, scene);
 
-            options.sideOrientation = this.updateSideOrientationForRightHandedSystem(options.sideOrientation, scene);
+            options.sideOrientation = this.updateSideOrientation(options.sideOrientation, scene);
 
             var vertexData = VertexData.CreatePlane(options);
 
@@ -786,7 +766,7 @@
             var cap = options.cap || Mesh.NO_CAP;
             var invertUV = options.invertUV || false;
             var updatable = options.updatable;
-            var sideOrientation = this.updateSideOrientationForRightHandedSystem(options.sideOrientation, scene);
+            var sideOrientation = this.updateSideOrientation(options.sideOrientation, scene);
             var instance = options.instance;
             options.arc = (options.arc <= 0.0 || options.arc > 1.0) ? 1.0 : options.arc || 1.0;
 
@@ -899,7 +879,7 @@
         public static CreatePolyhedron(name: string, options: { type?: number, size?: number, sizeX?: number, sizeY?: number, sizeZ?: number, custom?: any, faceUV?: Vector4[], faceColors?: Color4[], flat?: boolean, updatable?: boolean, sideOrientation?: number }, scene: Scene): Mesh {
             var polyhedron = new Mesh(name, scene);
 
-            options.sideOrientation = this.updateSideOrientationForRightHandedSystem(options.sideOrientation, scene);
+            options.sideOrientation = this.updateSideOrientation(options.sideOrientation, scene);
 
             var vertexData = VertexData.CreatePolyhedron(options);
 

+ 1 - 1
src/babylon.engine.js

@@ -567,7 +567,7 @@ var BABYLON;
         });
         Object.defineProperty(Engine, "Version", {
             get: function () {
-                return "2.5.-alpha";
+                return "2.5.-beta";
             },
             enumerable: true,
             configurable: true

+ 1 - 1
src/babylon.engine.ts

@@ -375,7 +375,7 @@
         }
 
         public static get Version(): string {
-            return "2.5.-alpha";
+            return "2.5.-beta";
         }
 
         // Updatable statics so stick with vars here