diff --git a/src/app/babylon/tool/babylon-tool.ts b/src/app/babylon/tool/babylon-tool.ts index f5b43c5..e9e7203 100644 --- a/src/app/babylon/tool/babylon-tool.ts +++ b/src/app/babylon/tool/babylon-tool.ts @@ -352,6 +352,9 @@ export class BabylonTool { camera.alpha = BabylonTool.limitPI(camera.alpha); camera.beta = BabylonTool.limitPI(camera.beta); + alpha = BabylonTool.limitPI(alpha); + beta = BabylonTool.limitPI(beta); + //缓动动画 let easingFunction = new QuadraticEase(); easingFunction.setEasingMode(EasingFunction.EASINGMODE_EASEOUT); @@ -433,6 +436,8 @@ export class BabylonTool { public static limitPI(value: number) { let result = value; + console.log("输入", result); + while (result < - Math.PI) { result += Math.PI * 2; } @@ -440,6 +445,7 @@ export class BabylonTool { while (result > Math.PI * 2) { result -= Math.PI * 2; } + console.log("输出", result); return result; }