소스 검색

Making sure created radius is always finite
This cased a bug when creating a default arcrotate camera in an empty scene

Raanan Weber 7 년 전
부모
커밋
f8fa860f0c
1개의 변경된 파일3개의 추가작업 그리고 0개의 파일을 삭제
  1. 3 0
      src/babylon.scene.ts

+ 3 - 0
src/babylon.scene.ts

@@ -4662,6 +4662,9 @@
 
                 var camera: TargetCamera;
                 var radius = worldSize.length() * 1.5;
+                if (!isFinite(radius)) {
+                    radius = 1;
+                }
                 if (createArcRotateCamera) {
                     var arcRotateCamera = new ArcRotateCamera("default camera", -(Math.PI / 2), Math.PI / 2, radius, worldCenter, this);
                     arcRotateCamera.lowerRadiusLimit = radius * 0.01;