Browse Source

Added CreateDashedLines static method

jbousquie 10 years ago
parent
commit
511bcfd0d7
1 changed files with 21 additions and 0 deletions
  1. 21 0
      Babylon/Mesh/babylon.mesh.ts

+ 21 - 0
Babylon/Mesh/babylon.mesh.ts

@@ -1345,6 +1345,27 @@
             return lines;
         }
 
+        // Dashed Lines
+        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) {
+
+                    
+                    };
+                    return positionFunction;   
+                };
+                var positionFunction = positionsOfLines(points);
+                linesInstance.updateMeshPositions(positionFunction, false);
+                return linesInstance;
+            }
+            // dashed lines creation
+            var dashedLines = new LinesMesh(name, scene, updatable);
+            var vertexData = VertexData.CreateDashedLines(points, dashSize, gapSize, dashNb);
+            vertexData.applyToMesh(dashedLines, updatable);
+            return dashedLines;
+        }
+
         // Extrusion
         public static ExtrudeShape(name: string, shape: Vector3[], path: Vector3[], scale: number, rotation: number, cap: number, scene: Scene, updatable?: boolean, sideOrientation: number = Mesh.DEFAULTSIDE, extrudedInstance: Mesh = null): Mesh {
             scale = scale || 1;