From 2ced344b1ed9fdc0c1f9d55574f83607fef6d592 Mon Sep 17 00:00:00 2001 From: liuxianghui <519646741@qq.com> Date: Wed, 15 Dec 2021 10:47:53 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E9=AB=98=E4=BA=AE=E8=A7=84?= =?UTF-8?q?=E5=88=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/app/babylon/tool/babylon-tool.ts | 6 ++++++ 1 file changed, 6 insertions(+) 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; }