Browse Source

optionholes given default

Cubees 8 năm trước cách đây
mục cha
commit
5f3086a94f
1 tập tin đã thay đổi với 1 bổ sung1 xóa
  1. 1 1
      src/Mesh/babylon.meshBuilder.ts

+ 1 - 1
src/Mesh/babylon.meshBuilder.ts

@@ -793,7 +793,7 @@
         public static CreatePolygon(name: string, options: {shape: Vector3[], holes?: Vector3[][], depth?: number, updatable?: boolean, sideOrientation?: number, frontUVs?: Vector4, backUVs?: Vector4}, scene: Scene): Mesh {
         public static CreatePolygon(name: string, options: {shape: Vector3[], holes?: Vector3[][], depth?: number, updatable?: boolean, sideOrientation?: number, frontUVs?: Vector4, backUVs?: Vector4}, scene: Scene): Mesh {
             options.sideOrientation = MeshBuilder.updateSideOrientation(options.sideOrientation, scene);
             options.sideOrientation = MeshBuilder.updateSideOrientation(options.sideOrientation, scene);
 			var shape = options.shape;
 			var shape = options.shape;
-			var holes = options.holes;
+			var holes = options.holes || [];
 			var depth = options.depth || 0;
 			var depth = options.depth || 0;
 			var contours: Array<Vector2> = [];
 			var contours: Array<Vector2> = [];
 			var hole: Array<Vector2> = [];
 			var hole: Array<Vector2> = [];