Sfoglia il codice sorgente

Still moving more code from mesh to meshbuilder

David catuhe 9 anni fa
parent
commit
262903b4cf

+ 40 - 146
src/Mesh/babylon.mesh.js

@@ -1111,155 +1111,49 @@ var BABYLON;
             };
             };
             return BABYLON.MeshBuilder.CreateCylinder(name, options, scene);
             return BABYLON.MeshBuilder.CreateCylinder(name, options, scene);
         };
         };
-        Mesh.CreateTorus = function (name, options, thicknessOrScene, tessellation, scene, updatable, sideOrientation) {
-            if (thicknessOrScene instanceof BABYLON.Scene) {
-                scene = thicknessOrScene;
-                updatable = options.updatable;
-            }
-            else {
-                var diameter = options;
-                options = {
-                    diameter: diameter,
-                    thickness: thicknessOrScene,
-                    tessellation: tessellation,
-                    sideOrientation: sideOrientation
-                };
-            }
-            var torus = new Mesh(name, scene);
-            var vertexData = BABYLON.VertexData.CreateTorus(options);
-            vertexData.applyToMesh(torus, updatable);
-            return torus;
+        // Torus  (Code from SharpDX.org)
+        Mesh.CreateTorus = function (name, diameter, thickness, tessellation, scene, updatable, sideOrientation) {
+            var options = {
+                diameter: diameter,
+                thickness: thickness,
+                tessellation: tessellation,
+                sideOrientation: sideOrientation,
+                updatable: updatable
+            };
+            return BABYLON.MeshBuilder.CreateTorus(name, options, scene);
         };
         };
-        Mesh.CreateTorusKnot = function (name, options, tubeOrScene, radialSegments, tubularSegments, p, q, scene, updatable, sideOrientation) {
-            if (tubeOrScene instanceof BABYLON.Scene) {
-                scene = tubeOrScene;
-                updatable = options.updatable;
-            }
-            else {
-                var radius = options;
-                options = {
-                    radius: radius,
-                    tube: tubeOrScene,
-                    radialSegments: radialSegments,
-                    tubularSegments: tubularSegments,
-                    p: p,
-                    q: q,
-                    sideOrientation: sideOrientation
-                };
-            }
-            var torusKnot = new Mesh(name, scene);
-            var vertexData = BABYLON.VertexData.CreateTorusKnot(options);
-            vertexData.applyToMesh(torusKnot, updatable);
-            return torusKnot;
+        Mesh.CreateTorusKnot = function (name, radius, tube, radialSegments, tubularSegments, p, q, scene, updatable, sideOrientation) {
+            var options = {
+                radius: radius,
+                tube: tube,
+                radialSegments: radialSegments,
+                tubularSegments: tubularSegments,
+                p: p,
+                q: q,
+                sideOrientation: sideOrientation,
+                updatable: updatable
+            };
+            return BABYLON.MeshBuilder.CreateTorusKnot(name, options, scene);
         };
         };
-        Mesh.CreateLines = function (name, options, scene, updatable, instance) {
-            var points;
-            if (Array.isArray(options)) {
-                points = options;
-                if (!instance) {
-                    options = {
-                        points: points
-                    };
-                }
-            }
-            else {
-                instance = options.instance;
-                points = options.points;
-            }
-            if (instance) {
-                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;
-                    }
-                };
-                instance.updateMeshPositions(positionFunction, false);
-                return instance;
-            }
-            // lines creation
-            var lines = new BABYLON.LinesMesh(name, scene);
-            var vertexData = BABYLON.VertexData.CreateLines(options);
-            vertexData.applyToMesh(lines, updatable || options.updatable);
-            return lines;
+        // Lines
+        Mesh.CreateLines = function (name, points, scene, updatable, instance) {
+            var options = {
+                points: points,
+                updatable: updatable,
+                instance: instance
+            };
+            return BABYLON.MeshBuilder.CreateLines(name, options, scene);
         };
         };
-        Mesh.CreateDashedLines = function (name, options, dashSizeOrScene, gapSize, dashNb, scene, updatable, instance) {
-            var points;
-            var dashSize;
-            if (Array.isArray(options)) {
-                points = options;
-                dashSize = dashSizeOrScene;
-                if (!instance) {
-                    options = {
-                        points: points,
-                        dashSize: dashSize,
-                        gapSize: gapSize,
-                        dashNb: dashNb
-                    };
-                }
-            }
-            else {
-                scene = dashSizeOrScene,
-                    points = options.points;
-                instance = options.instance;
-                gapSize = options.gapSize;
-                dashNb = options.dashNb;
-                dashSize = options.dashSize;
-            }
-            if (instance) {
-                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 = instance.dashSize * shft / (instance.dashSize + instance.gapSize);
-                    for (i = 0; i < points.length - 1; i++) {
-                        points[i + 1].subtractToRef(points[i], curvect);
-                        nb = Math.floor(curvect.length() / shft);
-                        curvect.normalize();
-                        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;
-                    }
-                };
-                instance.updateMeshPositions(positionFunction, false);
-                return instance;
-            }
-            // dashed lines creation
-            var dashedLines = new BABYLON.LinesMesh(name, scene);
-            var vertexData = BABYLON.VertexData.CreateDashedLines(options);
-            vertexData.applyToMesh(dashedLines, updatable || options.updatable);
-            dashedLines.dashSize = dashSize;
-            dashedLines.gapSize = gapSize;
-            return dashedLines;
+        // Dashed Lines
+        Mesh.CreateDashedLines = function (name, points, dashSize, gapSize, dashNb, scene, updatable, instance) {
+            var options = {
+                points: points,
+                dashSize: dashSize,
+                gapSize: gapSize,
+                dashNb: dashNb,
+                updatable: updatable
+            };
+            return BABYLON.MeshBuilder.CreateDashedLines(name, options, scene);
         };
         };
         Mesh.ExtrudeShape = function (name, options, pathOrScene, scale, rotation, cap, scene, updatable, sideOrientation, instance) {
         Mesh.ExtrudeShape = function (name, options, pathOrScene, scale, rotation, cap, scene, updatable, sideOrientation, instance) {
             if (sideOrientation === void 0) { sideOrientation = Mesh.DEFAULTSIDE; }
             if (sideOrientation === void 0) { sideOrientation = Mesh.DEFAULTSIDE; }

+ 33 - 150
src/Mesh/babylon.mesh.ts

@@ -1302,170 +1302,53 @@
         }
         }
 
 
         // Torus  (Code from SharpDX.org)
         // Torus  (Code from SharpDX.org)
-        public static CreateTorus(name: string, diameter: number, thickness: number, tessellation: number, scene: Scene, updatable?: boolean, sideOrientation?: number): Mesh;
-        public static CreateTorus(name: string, options: { diameter?: number, thickness?: number, tessellation?: number, updatable?: boolean, sideOrientation?: number }, scene: any): Mesh;
-        public static CreateTorus(name: string, options: any, thicknessOrScene: any, tessellation?: number, scene?: Scene, updatable?: boolean, sideOrientation?: number): Mesh {
-            if (thicknessOrScene instanceof Scene) {
-                scene = thicknessOrScene;
-                updatable = options.updatable;
-            } else {
-                var diameter = options;
-                options = {
-                    diameter: diameter,
-                    thickness: thicknessOrScene,
-                    tessellation: tessellation,
-                    sideOrientation: sideOrientation
-                }
+        public static CreateTorus(name: string, diameter: number, thickness: number, tessellation: number, scene: Scene, updatable?: boolean, sideOrientation?: number): Mesh {
+            var options = {
+                diameter: diameter,
+                thickness: thickness,
+                tessellation: tessellation,
+                sideOrientation: sideOrientation,
+                updatable: updatable
             }
             }
-            var torus = new Mesh(name, scene);
-            var vertexData = VertexData.CreateTorus(options);
 
 
-            vertexData.applyToMesh(torus, updatable);
-
-            return torus;
+            return MeshBuilder.CreateTorus(name, options, scene);
         }
         }
 
 
-        public static CreateTorusKnot(name: string, radius: number, tube: number, radialSegments: number, tubularSegments: number, p: number, q: number, scene: Scene, updatable?: boolean, sideOrientation?: number): Mesh;
-        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;
-        public static CreateTorusKnot(name: string, options: any, tubeOrScene: any, radialSegments?: number, tubularSegments?: number, p?: number, q?: number, scene?: Scene, updatable?: boolean, sideOrientation?: number): Mesh {
-            if (tubeOrScene instanceof Scene) {
-                scene = tubeOrScene;
-                updatable = options.updatable;
-            } else {
-                var radius = options;
-                options = {
-                    radius: radius,
-                    tube: tubeOrScene,
-                    radialSegments: radialSegments,
-                    tubularSegments: tubularSegments,
-                    p: p,
-                    q: q,
-                    sideOrientation: sideOrientation
-                }
+        public static CreateTorusKnot(name: string, radius: number, tube: number, radialSegments: number, tubularSegments: number, p: number, q: number, scene: Scene, updatable?: boolean, sideOrientation?: number): Mesh {
+            var options = {
+                radius: radius,
+                tube: tube,
+                radialSegments: radialSegments,
+                tubularSegments: tubularSegments,
+                p: p,
+                q: q,
+                sideOrientation: sideOrientation,
+                updatable: updatable
             }
             }
-            var torusKnot = new Mesh(name, scene);
-            var vertexData = VertexData.CreateTorusKnot(options);
-
-            vertexData.applyToMesh(torusKnot, updatable);
 
 
-            return torusKnot;
+            return MeshBuilder.CreateTorusKnot(name, options, scene);
         }
         }
 
 
         // Lines
         // Lines
-        public static CreateLines(name: string, points: Vector3[], scene: Scene, updatable?: boolean, instance?: LinesMesh): LinesMesh;
-        public static CreateLines(name: string, options: { points: Vector3[], updatable?: boolean, instance?: LinesMesh }, scene: Scene): LinesMesh;
-        public static CreateLines(name: string, options: any, scene: Scene, updatable?: boolean, instance?: LinesMesh): LinesMesh {
-            var points: Vector3[];
-            if (Array.isArray(options)) {
-                points = options;
-                if (!instance) {
-                    options = {
-                        points: points
-                    }
-                }
-            } else {
-                instance = options.instance;
-                points = options.points;
-            }
-
-            if (instance) { // lines update
-                var positionFunction = 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;
-                    }
-                };
-                instance.updateMeshPositions(positionFunction, false);
-                return instance;
+        public static CreateLines(name: string, points: Vector3[], scene: Scene, updatable?: boolean, instance?: LinesMesh): LinesMesh {
+            var options = {
+                points: points,
+                updatable: updatable,
+                instance: instance
             }
             }
-
-            // lines creation
-            var lines = new LinesMesh(name, scene);
-            var vertexData = VertexData.CreateLines(options);
-            vertexData.applyToMesh(lines, updatable || options.updatable);
-            return lines;
+            return MeshBuilder.CreateLines(name, options, scene);
         }
         }
 
 
         // Dashed Lines
         // Dashed Lines
-        public static CreateDashedLines(name: string, points: Vector3[], dashSize: number, gapSize: number, dashNb: number, scene: Scene, updatable?: boolean, instance?: LinesMesh): LinesMesh;
-        public static CreateDashedLines(name: string, options: { points: Vector3[], dashSize?: number, gapSize?: number, dashNb?: number, updatable?: boolean, instance?: LinesMesh }, scene: Scene): LinesMesh;
-        public static CreateDashedLines(name: string, options: any, dashSizeOrScene: any, gapSize?: number, dashNb?: number, scene?: Scene, updatable?: boolean, instance?: LinesMesh): LinesMesh {
-            var points: Vector3[];
-            var dashSize: number;
-            if (Array.isArray(options)) {
-                points = options;
-                dashSize = dashSizeOrScene;
-                if (!instance) {
-                    options = {
-                        points: points,
-                        dashSize: dashSize,
-                        gapSize: gapSize,
-                        dashNb: dashNb
-                    }
-                }
-            } else {
-                scene = dashSizeOrScene,
-                points = options.points;
-                instance = options.instance;
-                gapSize = options.gapSize;
-                dashNb = options.dashNb;
-                dashSize = options.dashSize;
-            }
-            if (instance) {  //  dashed lines update
-                var positionFunction = (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>instance).dashSize * shft / ((<any>instance).dashSize + (<any>instance).gapSize);
-                    for (i = 0; i < points.length - 1; i++) {
-                        points[i + 1].subtractToRef(points[i], curvect);
-                        nb = Math.floor(curvect.length() / shft);
-                        curvect.normalize();
-                        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;
-                    }
-                };
-                instance.updateMeshPositions(positionFunction, false);
-                return instance;
+        public static CreateDashedLines(name: string, points: Vector3[], dashSize: number, gapSize: number, dashNb: number, scene: Scene, updatable?: boolean, instance?: LinesMesh): LinesMesh {
+            var options = {
+                points: points,
+                dashSize: dashSize,
+                gapSize: gapSize,
+                dashNb: dashNb,
+                updatable: updatable
             }
             }
-            // dashed lines creation
-            var dashedLines = new LinesMesh(name, scene);
-            var vertexData = VertexData.CreateDashedLines(options);
-            vertexData.applyToMesh(dashedLines, updatable || options.updatable);
-            (<any>dashedLines).dashSize = dashSize;
-            (<any>dashedLines).gapSize = gapSize;
-            return dashedLines;
+            return MeshBuilder.CreateDashedLines(name, options, scene);
         }
         }
 
 
         // Extrusion
         // Extrusion

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

@@ -107,6 +107,99 @@ var BABYLON;
             vertexData.applyToMesh(cylinder, options.updatable);
             vertexData.applyToMesh(cylinder, options.updatable);
             return cylinder;
             return cylinder;
         };
         };
+        MeshBuilder.CreateTorus = function (name, options, scene) {
+            var torus = new BABYLON.Mesh(name, scene);
+            var vertexData = BABYLON.VertexData.CreateTorus(options);
+            vertexData.applyToMesh(torus, options.updatable);
+            return torus;
+        };
+        MeshBuilder.CreateTorusKnot = function (name, options, scene) {
+            var torusKnot = new BABYLON.Mesh(name, scene);
+            var vertexData = BABYLON.VertexData.CreateTorusKnot(options);
+            vertexData.applyToMesh(torusKnot, options.updatable);
+            return torusKnot;
+        };
+        MeshBuilder.CreateLines = function (name, options, scene) {
+            var instance = options.instance;
+            var points = options.points;
+            if (instance) {
+                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;
+                    }
+                };
+                instance.updateMeshPositions(positionFunction, false);
+                return instance;
+            }
+            // lines creation
+            var lines = new BABYLON.LinesMesh(name, scene);
+            var vertexData = BABYLON.VertexData.CreateLines(options);
+            vertexData.applyToMesh(lines, options.updatable);
+            return lines;
+        };
+        MeshBuilder.CreateDashedLines = function (name, options, scene) {
+            var points = options.points;
+            var instance = options.instance;
+            var gapSize = options.gapSize;
+            var dashNb = options.dashNb;
+            var dashSize = options.dashSize;
+            if (instance) {
+                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 = instance.dashSize * shft / (instance.dashSize + instance.gapSize);
+                    for (i = 0; i < points.length - 1; i++) {
+                        points[i + 1].subtractToRef(points[i], curvect);
+                        nb = Math.floor(curvect.length() / shft);
+                        curvect.normalize();
+                        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;
+                    }
+                };
+                instance.updateMeshPositions(positionFunction, false);
+                return instance;
+            }
+            // dashed lines creation
+            var dashedLines = new BABYLON.LinesMesh(name, scene);
+            var vertexData = BABYLON.VertexData.CreateDashedLines(options);
+            vertexData.applyToMesh(dashedLines, options.updatable);
+            dashedLines.dashSize = dashSize;
+            dashedLines.gapSize = gapSize;
+            return dashedLines;
+        };
         return MeshBuilder;
         return MeshBuilder;
     })();
     })();
     BABYLON.MeshBuilder = MeshBuilder;
     BABYLON.MeshBuilder = MeshBuilder;

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

@@ -125,5 +125,109 @@
 
 
             return cylinder;
             return cylinder;
         }
         }
+
+        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);
+            var vertexData = VertexData.CreateTorus(options);
+
+            vertexData.applyToMesh(torus, options.updatable);
+
+            return torus;
+        }
+
+        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);
+            var vertexData = VertexData.CreateTorusKnot(options);
+
+            vertexData.applyToMesh(torusKnot, options.updatable);
+
+            return torusKnot;
+        }
+
+        public static CreateLines(name: string, options: { points: Vector3[], updatable?: boolean, instance?: LinesMesh }, scene: Scene): LinesMesh {
+            var instance = options.instance;
+            var points = options.points;
+
+            if (instance) { // lines update
+                var positionFunction = 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;
+                    }
+                };
+                instance.updateMeshPositions(positionFunction, false);
+                return instance;
+            }
+
+            // lines creation
+            var lines = new LinesMesh(name, scene);
+            var vertexData = VertexData.CreateLines(options);
+            vertexData.applyToMesh(lines, options.updatable);
+            return lines;
+        }
+
+        public static CreateDashedLines(name: string, options: { points: Vector3[], dashSize?: number, gapSize?: number, dashNb?: number, updatable?: boolean, instance?: LinesMesh }, scene: Scene): LinesMesh {
+            var points = options.points;
+            var instance = options.instance;
+            var gapSize = options.gapSize;
+            var dashNb = options.dashNb;
+            var dashSize = options.dashSize;
+
+            if (instance) {  //  dashed lines update
+                var positionFunction = (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>instance).dashSize * shft / ((<any>instance).dashSize + (<any>instance).gapSize);
+                    for (i = 0; i < points.length - 1; i++) {
+                        points[i + 1].subtractToRef(points[i], curvect);
+                        nb = Math.floor(curvect.length() / shft);
+                        curvect.normalize();
+                        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;
+                    }
+                };
+                instance.updateMeshPositions(positionFunction, false);
+                return instance;
+            }
+            // dashed lines creation
+            var dashedLines = new LinesMesh(name, scene);
+            var vertexData = VertexData.CreateDashedLines(options);
+            vertexData.applyToMesh(dashedLines, options.updatable);
+            (<any>dashedLines).dashSize = dashSize;
+            (<any>dashedLines).gapSize = gapSize;
+            return dashedLines;
+        }
     }
     }
 }
 }