Просмотр исходного кода

Lines mesh update/create method cleanup

jbousquie 10 лет назад
Родитель
Сommit
63a39ff112
1 измененных файлов с 9 добавлено и 18 удалено
  1. 9 18
      Babylon/Mesh/babylon.mesh.ts

+ 9 - 18
Babylon/Mesh/babylon.mesh.ts

@@ -1308,32 +1308,23 @@
         // Lines
         // Lines
         public static CreateLines(name: string, points: Vector3[], scene: Scene, updatable?: boolean, linesInstance: LinesMesh = null): LinesMesh {
         public static CreateLines(name: string, points: Vector3[], scene: Scene, updatable?: boolean, linesInstance: LinesMesh = null): LinesMesh {
             if (linesInstance) { // lines update
             if (linesInstance) { // lines update
-                var positionsOfLines = function (points) {
-                    var positionFunction = function (positions) {
-                        var i = 0;
-                        for (var p = 0; p < points.length; p++) {
-                            positions[i] = points[p].x;
-                            positions[i + 1] = points[p].y;
-                            positions[i + 2] = points[p].z;
-                            i += 3;
-                        }
-                    };
-                    return positionFunction;
+                var positionFunction = function (positions) {
+                    var i = 0;
+                    for (var p = 0; p < points.length; p++) {
+                        positions[i] = points[p].x;
+                        positions[i + 1] = points[p].y;
+                        positions[i + 2] = points[p].z;
+                        i += 3;
+                    }
                 };
                 };
-                var positionFunction = positionsOfLines(points);
                 linesInstance.updateMeshPositions(positionFunction, false);
                 linesInstance.updateMeshPositions(positionFunction, false);
-
                 return linesInstance;
                 return linesInstance;
-
             }
             }
-            // lines creation
 
 
+            // lines creation
             var lines = new LinesMesh(name, scene, updatable);
             var lines = new LinesMesh(name, scene, updatable);
-
             var vertexData = VertexData.CreateLines(points);
             var vertexData = VertexData.CreateLines(points);
-
             vertexData.applyToMesh(lines, updatable);
             vertexData.applyToMesh(lines, updatable);
-
             return lines;
             return lines;
         }
         }