فهرست منبع

Merge pull request #818 from jbousquie/fix.Mesh.parameters

Fix.mesh.parameters
David Catuhe 9 سال پیش
والد
کامیت
7ecb244c75
1فایلهای تغییر یافته به همراه10 افزوده شده و 1 حذف شده
  1. 10 1
      src/Mesh/babylon.mesh.ts

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

@@ -1288,6 +1288,15 @@
 
         // Cylinder and cone
         public static CreateCylinder(name: string, height: number, diameterTop: number, diameterBottom: number, tessellation: number, subdivisions: any, scene: Scene, updatable?: any, sideOrientation?: number): Mesh {
+            if (scene === undefined || !(scene instanceof Scene)) {
+                if (scene !== undefined) {
+                    sideOrientation = updatable || Mesh.DEFAULTSIDE;
+                    updatable = scene;
+                }
+                scene = <Scene>subdivisions;
+                subdivisions = 1;
+            }            
+
             var options = {
                 height: height,
                 diameterTop: diameterTop,
@@ -1389,7 +1398,7 @@
             var options = {
                 shape: shape,
                 radius: radius,
-                tesselation: tessellation,
+                tessellation: tessellation,
                 sideOrientation: sideOrientation,
                 updatable: updatable
             };