|
@@ -7,10 +7,10 @@ import * as THREE from "../../../libs/three.js/build/three.module.js";
|
|
|
class SplitScreen extends THREE.EventDispatcher{
|
|
|
constructor (args = {}) {
|
|
|
super();
|
|
|
-
|
|
|
+ this.noRotSide = args.noRotSide
|
|
|
}
|
|
|
/*
|
|
|
- viewport.targetPlane // bound中心点处的plane,方向和view一致
|
|
|
+ viewport.targetPlane // bound中心点处的plane,朝向view的方向
|
|
|
viewport.shiftTarget // camera的位置project在targetPlane上的位置
|
|
|
这两个参数的主要目的是为了getPosOutOfModel,以及rotateSideCamera时保持相对位置
|
|
|
*/
|
|
@@ -77,7 +77,7 @@ class SplitScreen extends THREE.EventDispatcher{
|
|
|
let view = viewport.view
|
|
|
let info = {bound}
|
|
|
|
|
|
- let {boundSize, boundCenter} = this.getViewBound(viewport, bound )
|
|
|
+ let {boundSize, boundCenter} = this.getViewBound(viewport/* , bound */ )// 去掉bound是因为需要在所有点云的一侧才能都看到
|
|
|
|
|
|
//this.setShiftTarget(viewport, boundCenter)
|
|
|
|
|
@@ -122,7 +122,9 @@ class SplitScreen extends THREE.EventDispatcher{
|
|
|
//let {boundSize, center} = viewer.bound
|
|
|
boundSize = boundSize || this.getViewBound(viewport).boundSize
|
|
|
let expand = 10;
|
|
|
- let radius = boundSize.length() * 2
|
|
|
+
|
|
|
+
|
|
|
+ let radius = (this.noRotSide ? boundSize.clone().projectOnVector(viewport.view.direction).length() : boundSize.length() ) * 2
|
|
|
let position = viewport.shiftTarget.clone().sub(viewport.view.direction.clone().multiplyScalar(radius + expand))
|
|
|
|
|
|
return position
|