소스 검색

Fixing CreateCylinder

David Catuhe 11 년 전
부모
커밋
4dad4c53a0
4개의 변경된 파일23개의 추가작업 그리고 5개의 파일을 삭제
  1. 9 0
      Babylon/Mesh/babylon.mesh.js
  2. 10 1
      Babylon/Mesh/babylon.mesh.ts
  3. 1 1
      babylon.1.13-beta-debug.js
  4. 3 3
      babylon.1.13-beta.js

+ 9 - 0
Babylon/Mesh/babylon.mesh.js

@@ -750,6 +750,15 @@ var BABYLON;
 
         // Cylinder and cone (Code inspired by SharpDX.org)
         Mesh.CreateCylinder = function (name, height, diameterTop, diameterBottom, tessellation, subdivisions, scene, updatable) {
+            // subdivisions is a new parameter, we need to support old signature
+            if (scene === undefined || !(scene instanceof BABYLON.Scene)) {
+                if (scene !== undefined) {
+                    updatable = scene;
+                }
+                scene = subdivisions;
+                subdivisions = 1;
+            }
+
             var cylinder = new BABYLON.Mesh(name, scene);
             var vertexData = BABYLON.VertexData.CreateCylinder(height, diameterTop, diameterBottom, tessellation, subdivisions);
 

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

@@ -759,7 +759,16 @@
         }
 
         // Cylinder and cone (Code inspired by SharpDX.org)
-        public static CreateCylinder(name: string, height: number, diameterTop: number, diameterBottom: number, tessellation: number, subdivisions: number, scene: Scene, updatable?: boolean): Mesh {
+        public static CreateCylinder(name: string, height: number, diameterTop: number, diameterBottom: number, tessellation: number, subdivisions: any, scene: Scene, updatable?: any): Mesh {
+            // subdivisions is a new parameter, we need to support old signature
+            if (scene === undefined || !(scene instanceof Scene)) {
+                if (scene !== undefined) {
+                    updatable = scene;
+                }
+                scene = <Scene>subdivisions;
+                subdivisions = 1;
+            }
+
             var cylinder = new BABYLON.Mesh(name, scene);
             var vertexData = BABYLON.VertexData.CreateCylinder(height, diameterTop, diameterBottom, tessellation, subdivisions);
 

파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 1 - 1
babylon.1.13-beta-debug.js


파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 3 - 3
babylon.1.13-beta.js