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