|
|
@ -51,7 +51,7 @@ export class BabylonTool { |
|
|
|
static getWorldPosition(mesh: AbstractMesh): Vector3 { |
|
|
|
static getWorldPosition(mesh: AbstractMesh): Vector3 { |
|
|
|
let result = mesh.position; |
|
|
|
let result = mesh.position; |
|
|
|
if (mesh.parent != null) { |
|
|
|
if (mesh.parent != null) { |
|
|
|
result = mesh.absolutePosition; |
|
|
|
result = mesh.getAbsolutePosition(); |
|
|
|
} |
|
|
|
} |
|
|
|
return result.clone(); |
|
|
|
return result.clone(); |
|
|
|
} |
|
|
|
} |
|
|
@ -436,8 +436,6 @@ 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; |
|
|
|
} |
|
|
|
} |
|
|
@ -445,7 +443,6 @@ 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; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|