Browse Source

Merge pull request #748 from jbousquie/feature.CreatePolyhedron

Feature.create polyhedron
David Catuhe 10 năm trước cách đây
mục cha
commit
6341be8d3a
2 tập tin đã thay đổi với 115 bổ sung0 xóa
  1. 10 0
      src/Mesh/babylon.mesh.ts
  2. 105 0
      src/Mesh/babylon.mesh.vertexData.ts

+ 10 - 0
src/Mesh/babylon.mesh.ts

@@ -2076,6 +2076,16 @@
             return tube;
         }
 
+        public static CreatePolyhedron(name: string, options: {type?: number, size?: number, sizeX?: number, sizeY?: number, sizeZ?: number, custom?: any, faceUV?: Vector4[], faceColors?: Color4[], updatable?: boolean, sideOrientation?: number}, scene: Scene): Mesh {
+            var polyhedron = new Mesh(name, scene);
+
+            var vertexData = VertexData.CreatePolyhedron(options);
+
+            vertexData.applyToMesh(polyhedron, options.updatable);
+
+            return polyhedron;
+        }
+
         // Decals
         public static CreateDecal(name: string, sourceMesh: AbstractMesh, options: { position?: Vector3, normal?: Vector3, size?: Vector3, angle?: number });
         public static CreateDecal(name: string, sourceMesh: AbstractMesh, position: Vector3, normal: Vector3, size: Vector3, angle: number);

Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 105 - 0
src/Mesh/babylon.mesh.vertexData.ts