浏览代码

Default Values for CreateDashedLines Added

If  options not set for gapSize and dashSize then variables on lines 425, and 426 are undefined and so undefined is stored in the mesh properties of gapSize and dashSize for dashedLines object on lines 477 and 478. This means that when an instance is used dashshft on line 445 is calculated using undefined variables resulting in NaN for positions[p + 3], positions[p + 4], positions[p + 5] on lines 456 to 458.
BabylonJSGuide 8 年之前
父节点
当前提交
552c026ffb
共有 1 个文件被更改,包括 2 次插入3 次删除
  1. 2 3
      src/Mesh/babylon.meshBuilder.ts

+ 2 - 3
src/Mesh/babylon.meshBuilder.ts

@@ -422,9 +422,8 @@
         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;
+            var gapSize = options.gapSize || 1;
+            var dashSize = options.dashSize || 3;
 
             if (instance) {  //  dashed lines update
                 var positionFunction = (positions: number[]): void => {