|
@@ -106155,25 +106155,25 @@ ENDSEC
|
|
|
|
|
|
const fareast = 300;
|
|
|
//相机位置
|
|
|
- if(playerCamera.type == 'OrthographicCamera'){
|
|
|
-
|
|
|
- var finalDisToAim = 2;
|
|
|
-
|
|
|
+ if(playerCamera.type == 'OrthographicCamera'){
|
|
|
+ var finalDisToAim = 2;
|
|
|
}else {
|
|
|
var finalDisToAim = dis>magDisMin ? dis > fareast ? magDisMax : (dis-magDisMin) / (fareast-magDisMin) * (magDisMax-magDisMin) + magDisMin : dis / 2; //dis>magDistance_ ? magDistance_ : dis / 2;
|
|
|
-
|
|
|
}
|
|
|
|
|
|
- this.camera.position.copy(aimPos).add(dirToCamera.multiplyScalar(finalDisToAim));
|
|
|
- this.camera.lookAt(aimPos);
|
|
|
+
|
|
|
this.camera.fov = playerCamera.type == 'OrthographicCamera' ? 30 : playerCamera.fov / 2;
|
|
|
this.camera.updateProjectionMatrix();
|
|
|
|
|
|
+
|
|
|
if(playerCamera.type == 'OrthographicCamera'){
|
|
|
- orthoView.position.copy(this.camera.position);
|
|
|
+ orthoView.position.copy(aimPos).sub(viewer.mainViewport.view.direction.multiplyScalar(finalDisToAim));
|
|
|
orthoView.yaw = viewer.mainViewport.view.yaw;
|
|
|
orthoView.pitch = viewer.mainViewport.view.pitch;
|
|
|
orthoView.applyToCamera(this.camera);
|
|
|
+ }else {
|
|
|
+ this.camera.position.copy(aimPos).add(dirToCamera.multiplyScalar(finalDisToAim));
|
|
|
+ this.camera.lookAt(aimPos);
|
|
|
}
|
|
|
|
|
|
|