瀏覽代碼

Cleaning last PRs

David Catuhe 10 年之前
父節點
當前提交
9e8208cc84

+ 1 - 1
Babylon/Cameras/babylon.camera.js

@@ -63,7 +63,7 @@ var BABYLON;
             result.hScreenSize = 0.149759993;
             result.vScreenSize = 0.0935999975;
             result.vScreenCenter = 0.0467999987,
-            result.eyeToScreenDistance = 0.0410000011;
+                result.eyeToScreenDistance = 0.0410000011;
             result.lensSeparationDistance = 0.0635000020;
             result.interpupillaryDistance = 0.0640000030;
             result.distortionK = [1.0, 0.219999999, 0.239999995, 0.0];

+ 3 - 7
Babylon/Cameras/babylon.gamepadCamera.js

@@ -29,21 +29,17 @@ var BABYLON;
                 var normalizedLY = LSValues.y / this.moveSensibility;
                 LSValues.x = Math.abs(normalizedLX) > 0.005 ? 0 + normalizedLX : 0;
                 LSValues.y = Math.abs(normalizedLY) > 0.005 ? 0 + normalizedLY : 0;
-                
-				var RSValues = this._gamepad.rightStick;
+                var RSValues = this._gamepad.rightStick;
                 var normalizedRX = RSValues.x / this.angularSensibility;
                 var normalizedRY = RSValues.y / this.angularSensibility;
                 RSValues.x = Math.abs(normalizedRX) > 0.001 ? 0 + normalizedRX : 0;
-                RSValues.y = Math.abs(normalizedRY) > 0.001 ? 0 + normalizedRY : 0;                
-               
-			   var cameraTransform = BABYLON.Matrix.RotationYawPitchRoll(this.rotation.y, this.rotation.x, 0);
-			   
+                RSValues.y = Math.abs(normalizedRY) > 0.001 ? 0 + normalizedRY : 0;
+                var cameraTransform = BABYLON.Matrix.RotationYawPitchRoll(this.rotation.y, this.rotation.x, 0);
                 var speed = this._computeLocalCameraSpeed() * 50.0;
                 var deltaTransform = BABYLON.Vector3.TransformCoordinates(new BABYLON.Vector3(LSValues.x * speed, 0, -LSValues.y * speed), cameraTransform);
                 this.cameraDirection = this.cameraDirection.add(deltaTransform);
                 this.cameraRotation = this.cameraRotation.add(new BABYLON.Vector2(RSValues.y, RSValues.x));
             }
-			
             _super.prototype._checkInputs.call(this);
         };
         GamepadCamera.prototype.dispose = function () {

+ 12 - 8
Babylon/Loading/Plugins/babylon.babylonFileLoader.js

@@ -677,6 +677,7 @@ var BABYLON;
                 }
                 var effectiveTarget = propertyPath.split(".");
                 var values = value.split(",");
+                // Get effective Target
                 for (var i = 0; i < effectiveTarget.length; i++) {
                     target = target[effectiveTarget[i]];
                 }
@@ -779,6 +780,7 @@ var BABYLON;
                 for (var i = 0; i < parsedAction.children.length; i++)
                     traverse(parsedAction.children[i], trigger, condition, newAction, null);
             };
+            // triggers
             for (var i = 0; i < parsedActions.children.length; i++) {
                 var triggerParams;
                 var trigger = parsedActions.children[i];
@@ -799,19 +801,14 @@ var BABYLON;
             var soundName = parsedSound.name;
             var soundUrl = rootUrl + soundName;
             var options = {
-                autoplay: parsedSound.autoplay,
-                loop: parsedSound.loop,
-                volume: parsedSound.volume,
-                spatialSound: parsedSound.spatialSound,
-                maxDistance: parsedSound.maxDistance,
+                autoplay: parsedSound.autoplay, loop: parsedSound.loop, volume: parsedSound.volume,
+                spatialSound: parsedSound.spatialSound, maxDistance: parsedSound.maxDistance,
                 rolloffFactor: parsedSound.rolloffFactor,
                 refDistance: parsedSound.refDistance,
                 distanceModel: parsedSound.distanceModel,
                 playbackRate: parsedSound.playbackRate
             };
-            var newSound = new BABYLON.Sound(soundName, soundUrl, scene, function () {
-                scene._removePendingData(newSound);
-            }, options);
+            var newSound = new BABYLON.Sound(soundName, soundUrl, scene, function () { scene._removePendingData(newSound); }, options);
             scene._addPendingData(newSound);
             if (parsedSound.position) {
                 var soundPosition = BABYLON.Vector3.FromArray(parsedSound.position);
@@ -1101,6 +1098,7 @@ var BABYLON;
                         meshes.push(mesh);
                     }
                 }
+                // Connecting parents
                 for (index = 0; index < scene.meshes.length; index++) {
                     var currentMesh = scene.meshes[index];
                     if (currentMesh._waitingParentId) {
@@ -1135,6 +1133,7 @@ var BABYLON;
                     scene.fogEnd = parsedData.fogEnd;
                     scene.fogDensity = parsedData.fogDensity;
                 }
+                // Lights
                 for (var index = 0; index < parsedData.lights.length; index++) {
                     var parsedLight = parsedData.lights[index];
                     parseLight(parsedLight, scene);
@@ -1227,10 +1226,12 @@ var BABYLON;
                         }
                     }
                 }
+                // Meshes
                 for (index = 0; index < parsedData.meshes.length; index++) {
                     var parsedMesh = parsedData.meshes[index];
                     parseMesh(parsedMesh, scene, rootUrl);
                 }
+                // Cameras
                 for (index = 0; index < parsedData.cameras.length; index++) {
                     var parsedCamera = parsedData.cameras[index];
                     parseCamera(parsedCamera, scene);
@@ -1238,6 +1239,7 @@ var BABYLON;
                 if (parsedData.activeCameraID) {
                     scene.setActiveCameraByID(parsedData.activeCameraID);
                 }
+                // Browsing all the graph to connect the dots
                 for (index = 0; index < scene.cameras.length; index++) {
                     var camera = scene.cameras[index];
                     if (camera._waitingParentId) {
@@ -1264,6 +1266,7 @@ var BABYLON;
                         }
                     }
                 }
+                // Connect parents & children and parse actions
                 for (index = 0; index < scene.meshes.length; index++) {
                     var mesh = scene.meshes[index];
                     if (mesh._waitingParentId) {
@@ -1306,3 +1309,4 @@ var BABYLON;
         });
     })(Internals = BABYLON.Internals || (BABYLON.Internals = {}));
 })(BABYLON || (BABYLON = {}));
+//# sourceMappingURL=babylon.babylonFileLoader.js.map

+ 73 - 22
Babylon/Mesh/babylon.mesh.js

@@ -1024,31 +1024,26 @@ var BABYLON;
             if (ribbonInstance) {
                 // positionFunction : ribbon case
                 // only pathArray and sideOrientation parameters are taken into account for positions update
-                var positionsOfRibbon = function (pathArray, sideOrientation) {
-                    var positionFunction = function (positions) {
-                        var minlg = pathArray[0].length;
-                        var i = 0;
-                        var ns = (sideOrientation == BABYLON.Mesh.DOUBLESIDE) ? 2 : 1;
-                        for (var si = 1; si <= ns; si++) {
-                            for (var p = 0; p < pathArray.length; p++) {
-                                var path = pathArray[p];
-                                var l = path.length;
-                                minlg = (minlg < l) ? minlg : l;
-                                var j = 0;
-                                while (j < minlg) {
-                                    positions[i] = path[j].x;
-                                    positions[i + 1] = path[j].y;
-                                    positions[i + 2] = path[j].z;
-                                    j++;
-                                    i += 3;
-                                }
+                var positionFunction = function (positions) {
+                    var minlg = pathArray[0].length;
+                    var i = 0;
+                    var ns = (ribbonInstance.sideOrientation === BABYLON.Mesh.DOUBLESIDE) ? 2 : 1;
+                    for (var si = 1; si <= ns; si++) {
+                        for (var p = 0; p < pathArray.length; p++) {
+                            var path = pathArray[p];
+                            var l = path.length;
+                            minlg = (minlg < l) ? minlg : l;
+                            var j = 0;
+                            while (j < minlg) {
+                                positions[i] = path[j].x;
+                                positions[i + 1] = path[j].y;
+                                positions[i + 2] = path[j].z;
+                                j++;
+                                i += 3;
                             }
                         }
-                    };
-                    return positionFunction;
+                    }
                 };
-                var sideOrientation = ribbonInstance.sideOrientation;
-                var positionFunction = positionsOfRibbon(pathArray, sideOrientation);
                 var computeNormals = !(ribbonInstance.areNormalsFrozen);
                 ribbonInstance.updateMeshPositions(positionFunction, computeNormals);
                 return ribbonInstance;
@@ -1139,6 +1134,62 @@ var BABYLON;
             vertexData.applyToMesh(lines, updatable);
             return lines;
         };
+        // Dashed Lines
+        Mesh.CreateDashedLines = function (name, points, dashSize, gapSize, dashNb, scene, updatable, linesInstance) {
+            if (linesInstance === void 0) { linesInstance = null; }
+            if (linesInstance) {
+                var positionFunction = function (positions) {
+                    var curvect = BABYLON.Vector3.Zero();
+                    var nbSeg = positions.length / 6;
+                    var lg = 0;
+                    var nb = 0;
+                    var shft = 0;
+                    var dashshft = 0;
+                    var curshft = 0;
+                    var p = 0;
+                    var i = 0;
+                    var j = 0;
+                    for (i = 0; i < points.length - 1; i++) {
+                        points[i + 1].subtractToRef(points[i], curvect);
+                        lg += curvect.length();
+                    }
+                    shft = lg / nbSeg;
+                    dashshft = linesInstance.dashSize * shft / (linesInstance.dashSize + linesInstance.gapSize);
+                    for (i = 0; i < points.length - 1; i++) {
+                        points[i + 1].subtractToRef(points[i], curvect);
+                        curvect.normalize();
+                        nb = Math.floor(curvect.length() / shft);
+                        j = 0;
+                        while (j < nb && p < positions.length) {
+                            curshft = shft * j;
+                            positions[p] = points[i].x + curshft * curvect.x;
+                            positions[p + 1] = points[i].y + curshft * curvect.y;
+                            positions[p + 2] = points[i].z + curshft * curvect.z;
+                            positions[p + 3] = points[i].x + (curshft + dashshft) * curvect.x;
+                            positions[p + 4] = points[i].y + (curshft + dashshft) * curvect.y;
+                            positions[p + 5] = points[i].z + (curshft + dashshft) * curvect.z;
+                            p += 6;
+                            j++;
+                        }
+                    }
+                    while (p < positions.length) {
+                        positions[p] = points[i].x;
+                        positions[p + 1] = points[i].y;
+                        positions[p + 2] = points[i].z;
+                        p += 3;
+                    }
+                };
+                linesInstance.updateMeshPositions(positionFunction, false);
+                return linesInstance;
+            }
+            // dashed lines creation
+            var dashedLines = new BABYLON.LinesMesh(name, scene, updatable);
+            var vertexData = BABYLON.VertexData.CreateDashedLines(points, dashSize, gapSize, dashNb);
+            vertexData.applyToMesh(dashedLines, updatable);
+            dashedLines.dashSize = dashSize;
+            dashedLines.gapSize = gapSize;
+            return dashedLines;
+        };
         // Extrusion
         Mesh.ExtrudeShape = function (name, shape, path, scale, rotation, cap, scene, updatable, sideOrientation, extrudedInstance) {
             if (sideOrientation === void 0) { sideOrientation = Mesh.DEFAULTSIDE; }

+ 69 - 80
Babylon/Mesh/babylon.mesh.ts

@@ -832,7 +832,7 @@
 
                     this.delayLoadState = Engine.DELAYLOADSTATE_LOADED;
                     scene._removePendingData(this);
-                },() => { }, scene.database, getBinaryData);
+                }, () => { }, scene.database, getBinaryData);
             }
         }
 
@@ -990,7 +990,7 @@
                 }
             };
 
-            Tools.LoadImage(url, onload,() => { }, scene.database);
+            Tools.LoadImage(url, onload, () => { }, scene.database);
         }
 
         public applyDisplacementMapFromBuffer(buffer: Uint8Array, heightMapWidth: number, heightMapHeight: number, minHeight: number, maxHeight: number): void {
@@ -1011,7 +1011,7 @@
             for (var index = 0; index < positions.length; index += 3) {
                 Vector3.FromArrayToRef(positions, index, position);
                 Vector3.FromArrayToRef(normals, index, normal);
-                Vector2.FromArrayToRef(uvs,(index / 3) * 2, uv);
+                Vector2.FromArrayToRef(uvs, (index / 3) * 2, uv);
 
                 // Compute height
                 var u = ((Math.abs(uv.x) * heightMapWidth) % heightMapWidth) | 0;
@@ -1092,8 +1092,8 @@
                 indices[index + 2] = index + 2;
 
                 var p1 = Vector3.FromArray(positions, index * 3);
-                var p2 = Vector3.FromArray(positions,(index + 1) * 3);
-                var p3 = Vector3.FromArray(positions,(index + 2) * 3);
+                var p2 = Vector3.FromArray(positions, (index + 1) * 3);
+                var p3 = Vector3.FromArray(positions, (index + 2) * 3);
 
                 var p1p2 = p1.subtract(p2);
                 var p3p2 = p3.subtract(p2);
@@ -1172,7 +1172,7 @@
             }
             var dupes = [];
 
-            AsyncLoop.SyncAsyncForLoop(vectorPositions.length, 40,(iteration) => {
+            AsyncLoop.SyncAsyncForLoop(vectorPositions.length, 40, (iteration) => {
                 var realPos = vectorPositions.length - 1 - iteration;
                 var testedPosition = vectorPositions[realPos];
                 for (var j = 0; j < realPos; ++j) {
@@ -1182,7 +1182,7 @@
                         break;
                     }
                 }
-            },() => {
+            }, () => {
                     for (var i = 0; i < indices.length; ++i) {
                         indices[i] = dupes[indices[i]] || indices[i];
                     }
@@ -1199,41 +1199,33 @@
 
         // Statics
         public static CreateRibbon(name: string, pathArray: Vector3[][], closeArray: boolean, closePath: boolean, offset: number, scene: Scene, updatable?: boolean, sideOrientation: number = Mesh.DEFAULTSIDE, ribbonInstance: Mesh = null): Mesh {
-
             if (ribbonInstance) {   // existing ribbon instance update
-
                 // positionFunction : ribbon case
                 // only pathArray and sideOrientation parameters are taken into account for positions update
-                var positionsOfRibbon = function (pathArray, sideOrientation) {
-                    var positionFunction = function (positions) {
-                        var minlg = pathArray[0].length;
-                        var i = 0;
-                        var ns = (sideOrientation == BABYLON.Mesh.DOUBLESIDE) ? 2 : 1;
-                        for (var si = 1; si <= ns; si++) {
-                            for (var p = 0; p < pathArray.length; p++) {
-                                var path = pathArray[p];
-                                var l = path.length;
-                                minlg = (minlg < l) ? minlg : l;
-                                var j = 0;
-                                while (j < minlg) {
-                                    positions[i] = path[j].x;
-                                    positions[i + 1] = path[j].y;
-                                    positions[i + 2] = path[j].z;
-                                    j++;
-                                    i += 3;
-                                }
+                var positionFunction = function (positions) {
+                    var minlg = pathArray[0].length;
+                    var i = 0;
+                    var ns = (ribbonInstance.sideOrientation === BABYLON.Mesh.DOUBLESIDE) ? 2 : 1;
+                    for (var si = 1; si <= ns; si++) {
+                        for (var p = 0; p < pathArray.length; p++) {
+                            var path = pathArray[p];
+                            var l = path.length;
+                            minlg = (minlg < l) ? minlg : l;
+                            var j = 0;
+                            while (j < minlg) {
+                                positions[i] = path[j].x;
+                                positions[i + 1] = path[j].y;
+                                positions[i + 2] = path[j].z;
+                                j++;
+                                i += 3;
                             }
                         }
-                    };
-                    return positionFunction;
+                    }
                 };
-                var sideOrientation = ribbonInstance.sideOrientation;
-                var positionFunction = positionsOfRibbon(pathArray, sideOrientation);
                 var computeNormals = !(ribbonInstance.areNormalsFrozen);
                 ribbonInstance.updateMeshPositions(positionFunction, computeNormals);
 
                 return ribbonInstance;
-
             }
             else {  // new ribbon creation
 
@@ -1346,53 +1338,50 @@
         }
 
         // Dashed Lines
-        public static CreateDashedLines(name: string, points: Vector3[], dashSize:number, gapSize: number, dashNb: number, scene: Scene, updatable?: boolean, linesInstance: LinesMesh = null): LinesMesh {
+        public static CreateDashedLines(name: string, points: Vector3[], dashSize: number, gapSize: number, dashNb: number, scene: Scene, updatable?: boolean, linesInstance: LinesMesh = null): LinesMesh {
             if (linesInstance) {  //  dashed lines update
-                var positionsOfLines = function(points) {
-                    var positionFunction = function(positions) {
-                        var curvect = Vector3.Zero();
-                        var nbSeg = positions.length / 6;
-                        var lg = 0;
-                        var nb = 0;
-                        var shft = 0;
-                        var dashshft = 0;
-                        var curshft = 0;
-                        var p = 0;
-                        var i = 0;
-                        var j = 0;
-                        for (i = 0; i < points.length - 1; i++) {
-                            points[i + 1].subtractToRef(points[i], curvect);
-                            lg += curvect.length();
-                        }
-                        shft = lg / nbSeg;
-                        dashshft = (<any>linesInstance).dashSize * shft / ((<any>linesInstance).dashSize + (<any>linesInstance).gapSize);
-                        for (i = 0; i < points.length - 1; i++) {
-                            points[i + 1].subtractToRef(points[i], curvect);
-                            curvect.normalize();
-                            nb = Math.floor(curvect.length() / shft);
-                            j = 0;
-                            while (j < nb && p < positions.length) {
-                                curshft = shft * j;
-                                positions[p] = points[i].x + curshft * curvect.x;
-                                positions[p + 1] = points[i].y + curshft * curvect.y;
-                                positions[p + 2] = points[i].z + curshft * curvect.z;
-                                positions[p + 3] = points[i].x + (curshft + dashshft)* curvect.x;
-                                positions[p + 4] = points[i].y + (curshft + dashshft) * curvect.y;
-                                positions[p + 5] = points[i].z + (curshft + dashshft) * curvect.z;
-                                p += 6;
-                                j++;
-                            }
-                        }
-                        while (p < positions.length) {
-                            positions[p] = points[i].x;
-                            positions[p + 1] = points[i].y;
-                            positions[p + 2] = points[i].z;
-                            p += 3;
+                var positionFunction = function (positions: number[]): void {
+                    var curvect = Vector3.Zero();
+                    var nbSeg = positions.length / 6;
+                    var lg = 0;
+                    var nb = 0;
+                    var shft = 0;
+                    var dashshft = 0;
+                    var curshft = 0;
+                    var p = 0;
+                    var i = 0;
+                    var j = 0;
+                    for (i = 0; i < points.length - 1; i++) {
+                        points[i + 1].subtractToRef(points[i], curvect);
+                        lg += curvect.length();
+                    }
+                    shft = lg / nbSeg;
+                    dashshft = (<any>linesInstance).dashSize * shft / ((<any>linesInstance).dashSize + (<any>linesInstance).gapSize);
+                    for (i = 0; i < points.length - 1; i++) {
+                        points[i + 1].subtractToRef(points[i], curvect);
+                        curvect.normalize();
+                        nb = Math.floor(curvect.length() / shft);
+                        j = 0;
+                        while (j < nb && p < positions.length) {
+                            curshft = shft * j;
+                            positions[p] = points[i].x + curshft * curvect.x;
+                            positions[p + 1] = points[i].y + curshft * curvect.y;
+                            positions[p + 2] = points[i].z + curshft * curvect.z;
+                            positions[p + 3] = points[i].x + (curshft + dashshft) * curvect.x;
+                            positions[p + 4] = points[i].y + (curshft + dashshft) * curvect.y;
+                            positions[p + 5] = points[i].z + (curshft + dashshft) * curvect.z;
+                            p += 6;
+                            j++;
                         }
-                    };
-                    return positionFunction;   
-                };
-                var positionFunction = positionsOfLines(points);
+                    }
+                    while (p < positions.length) {
+                        positions[p] = points[i].x;
+                        positions[p + 1] = points[i].y;
+                        positions[p + 2] = points[i].z;
+                        p += 3;
+                    }
+                }
+
                 linesInstance.updateMeshPositions(positionFunction, false);
                 return linesInstance;
             }
@@ -1484,7 +1473,7 @@
             if (instance) { // instance update
                 
                 var path3D = ((<any>instance).path3D).update(curve);
-                var pathArray = extrusionPathArray(shape, curve,(<any>instance).path3D,(<any>instance).pathArray, scale, rotation, scaleFunction, rotateFunction,(<any>instance).cap, custom);
+                var pathArray = extrusionPathArray(shape, curve, (<any>instance).path3D, (<any>instance).pathArray, scale, rotation, scaleFunction, rotateFunction, (<any>instance).cap, custom);
                 instance = Mesh.CreateRibbon(null, pathArray, null, null, null, null, null, null, instance);
 
                 return instance;
@@ -1570,7 +1559,7 @@
                 }
             };
 
-            Tools.LoadImage(url, onload,() => { }, scene.database);
+            Tools.LoadImage(url, onload, () => { }, scene.database);
 
             return ground;
         }
@@ -1635,7 +1624,7 @@
 
             if (tubeInstance) { // tube update
                 var path3D = ((<any>tubeInstance).path3D).update(path);
-                var pathArray = tubePathArray(path, path3D,(<any>tubeInstance).pathArray, radius,(<any>tubeInstance).tessellation, radiusFunction,(<any>tubeInstance).cap);
+                var pathArray = tubePathArray(path, path3D, (<any>tubeInstance).pathArray, radius, (<any>tubeInstance).tessellation, radiusFunction, (<any>tubeInstance).cap);
                 tubeInstance = Mesh.CreateRibbon(null, pathArray, null, null, null, null, null, null, tubeInstance);
 
                 return tubeInstance;

+ 38 - 0
Babylon/Mesh/babylon.mesh.vertexData.js

@@ -634,6 +634,44 @@ var BABYLON;
             vertexData.positions = positions;
             return vertexData;
         };
+        VertexData.CreateDashedLines = function (points, dashSize, gapSize, dashNb) {
+            dashSize = dashSize || 3;
+            gapSize = gapSize || 1;
+            dashNb = dashNb || 200;
+            var positions = new Array();
+            var indices = new Array();
+            var curvect = BABYLON.Vector3.Zero();
+            var lg = 0;
+            var nb = 0;
+            var shft = 0;
+            var dashshft = 0;
+            var curshft = 0;
+            var idx = 0;
+            var i = 0;
+            for (i = 0; i < points.length - 1; i++) {
+                points[i + 1].subtractToRef(points[i], curvect);
+                lg += curvect.length();
+            }
+            shft = lg / dashNb;
+            dashshft = dashSize * shft / (dashSize + gapSize);
+            for (i = 0; i < points.length - 1; i++) {
+                points[i + 1].subtractToRef(points[i], curvect);
+                curvect.normalize();
+                nb = Math.floor(curvect.length() / shft);
+                for (var j = 0; j < nb; j++) {
+                    curshft = shft * j;
+                    positions.push(points[i].x + curshft * curvect.x, points[i].y + curshft * curvect.y, points[i].z + curshft * curvect.z);
+                    positions.push(points[i].x + (curshft + dashshft) * curvect.x, points[i].y + (curshft + dashshft) * curvect.y, points[i].z + (curshft + dashshft) * curvect.z);
+                    indices.push(idx, idx + 1);
+                    idx += 2;
+                }
+            }
+            // Result
+            var vertexData = new VertexData();
+            vertexData.positions = positions;
+            vertexData.indices = indices;
+            return vertexData;
+        };
         VertexData.CreateGround = function (width, height, subdivisions) {
             var indices = [];
             var positions = [];

+ 6 - 6
Babylon/Mesh/babylon.mesh.vertexData.ts

@@ -798,8 +798,8 @@
             gapSize = gapSize || 1;
             dashNb = dashNb || 200;
 
-            var positions = [];
-            var indices = [];
+            var positions = new Array<number>();
+            var indices = new Array<number>();
 
             var curvect = Vector3.Zero();
             var lg = 0;
@@ -821,8 +821,8 @@
                 nb = Math.floor(curvect.length() / shft);
                 for (var j = 0; j < nb; j++) {
                     curshft = shft * j;
-                    positions.push(points[i].x + curshft * curvect.x , points[i].y + curshft * curvect.y, points[i].z + curshft * curvect.z);
-                    positions.push(points[i].x + (curshft + dashshft)* curvect.x, points[i].y + (curshft + dashshft) * curvect.y, points[i].z + (curshft + dashshft) * curvect.z);
+                    positions.push(points[i].x + curshft * curvect.x, points[i].y + curshft * curvect.y, points[i].z + curshft * curvect.z);
+                    positions.push(points[i].x + (curshft + dashshft) * curvect.x, points[i].y + (curshft + dashshft) * curvect.y, points[i].z + (curshft + dashshft) * curvect.z);
                     indices.push(idx, idx + 1);
                     idx += 2;
                 }
@@ -849,7 +849,7 @@
 
             for (row = 0; row <= subdivisions; row++) {
                 for (col = 0; col <= subdivisions; col++) {
-                    var position = new Vector3((col * width) / subdivisions - (width / 2.0), 0,((subdivisions - row) * height) / subdivisions - (height / 2.0));
+                    var position = new Vector3((col * width) / subdivisions - (width / 2.0), 0, ((subdivisions - row) * height) / subdivisions - (height / 2.0));
                     var normal = new Vector3(0, 1.0, 0);
 
                     positions.push(position.x, position.y, position.z);
@@ -968,7 +968,7 @@
             // Vertices
             for (row = 0; row <= subdivisions; row++) {
                 for (col = 0; col <= subdivisions; col++) {
-                    var position = new Vector3((col * width) / subdivisions - (width / 2.0), 0,((subdivisions - row) * height) / subdivisions - (height / 2.0));
+                    var position = new Vector3((col * width) / subdivisions - (width / 2.0), 0, ((subdivisions - row) * height) / subdivisions - (height / 2.0));
 
                     // Compute height
                     var heightMapX = (((position.x + width / 2) / width) * (bufferWidth - 1)) | 0;

文件差異過大導致無法顯示
+ 128 - 40
babylon.2.1-beta.debug.js


文件差異過大導致無法顯示
+ 14 - 14
babylon.2.1-beta.js


文件差異過大導致無法顯示
+ 14 - 14
babylon.2.1-beta.noworker.js