|
@@ -5,7 +5,7 @@ export default class ConvertViews extends THREE.EventDispatcher{
|
|
super()
|
|
super()
|
|
this.sourceApp = null
|
|
this.sourceApp = null
|
|
this.targetApp = null
|
|
this.targetApp = null
|
|
-
|
|
|
|
|
|
+ this.sceneType = null
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
@@ -15,8 +15,7 @@ export default class ConvertViews extends THREE.EventDispatcher{
|
|
this.sourceApp = null;
|
|
this.sourceApp = null;
|
|
if(!o.dontClearTarget){
|
|
if(!o.dontClearTarget){
|
|
this.targetApp = null
|
|
this.targetApp = null
|
|
- }
|
|
|
|
-
|
|
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
init(sourceApp, targetApp, sourceDom, sceneType, cameraData, sourcePano) {
|
|
init(sourceApp, targetApp, sourceDom, sceneType, cameraData, sourcePano) {
|
|
@@ -27,17 +26,19 @@ export default class ConvertViews extends THREE.EventDispatcher{
|
|
this.sourceApp = sourceApp
|
|
this.sourceApp = sourceApp
|
|
this.targetApp = targetApp
|
|
this.targetApp = targetApp
|
|
this.sourceDom = sourceDom
|
|
this.sourceDom = sourceDom
|
|
|
|
+ this.sceneType = sceneType
|
|
let viewer = this.viewer = targetApp.viewer
|
|
let viewer = this.viewer = targetApp.viewer
|
|
|
|
|
|
- this.needConvertAxis = sceneType == '4dkk'
|
|
|
|
|
|
+ this.needConvertAxis = sceneType == '4dkk' // Y朝上需要转换
|
|
|
|
+
|
|
this.lastCamStatus = viewer.getCameraStatus()
|
|
this.lastCamStatus = viewer.getCameraStatus()
|
|
- this.computeAveDiffLon(sourcePano)
|
|
|
|
|
|
+ this.computeShift(sourcePano)
|
|
|
|
|
|
viewer.setNavigationMode(targetApp.Glodon.Bimface.Viewer.NavigationMode3D.Walk)
|
|
viewer.setNavigationMode(targetApp.Glodon.Bimface.Viewer.NavigationMode3D.Walk)
|
|
viewer.setFlySpeedRate(5)
|
|
viewer.setFlySpeedRate(5)
|
|
- viewer.getViewer().setTransitionAnimationState(false) //setCameraStatus瞬间变化相机
|
|
|
|
-
|
|
|
|
- viewer.addEventListener('Rendered', (e)=>{
|
|
|
|
|
|
+ viewer.getViewer().setTransitionAnimationState(false) //setCameraStatus瞬间变化相机 ,or setCameraAnimation?
|
|
|
|
+
|
|
|
|
+ viewer.addEventListener('Rendered', (e)=>{//反向改变左侧相机
|
|
let info = viewer.getCameraStatus()
|
|
let info = viewer.getCameraStatus()
|
|
let poseChanged = !math.closeTo(this.lastCamStatus.position, info.position)
|
|
let poseChanged = !math.closeTo(this.lastCamStatus.position, info.position)
|
|
|| !math.closeTo(this.lastCamStatus.target, info.target)
|
|
|| !math.closeTo(this.lastCamStatus.target, info.target)
|
|
@@ -48,8 +49,7 @@ export default class ConvertViews extends THREE.EventDispatcher{
|
|
this.send(info)
|
|
this.send(info)
|
|
this.lastCamStatus = info
|
|
this.lastCamStatus = info
|
|
}
|
|
}
|
|
- }
|
|
|
|
-
|
|
|
|
|
|
+ }
|
|
})
|
|
})
|
|
|
|
|
|
|
|
|
|
@@ -218,8 +218,7 @@ export default class ConvertViews extends THREE.EventDispatcher{
|
|
|
|
|
|
|
|
|
|
|
|
|
|
- computeAveDiffLon(sourcePano) {
|
|
|
|
- //获取两个场景的lon偏差值
|
|
|
|
|
|
+ computeShift(sourcePano) { //获取两个场景的旋转和位移偏差值
|
|
//需要点的个数>1, 且两个场景点一一对应,位置接近且顺序一致
|
|
//需要点的个数>1, 且两个场景点一一对应,位置接近且顺序一致
|
|
//pick两个点来计算
|
|
//pick两个点来计算
|
|
let diffLonAve = 0,
|
|
let diffLonAve = 0,
|
|
@@ -296,7 +295,7 @@ export default class ConvertViews extends THREE.EventDispatcher{
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
- lockCamera(locked){
|
|
|
|
|
|
+ lockCamera(locked){//禁止操作改变相机
|
|
this.locked = locked
|
|
this.locked = locked
|
|
this.updateCtrlEnable()
|
|
this.updateCtrlEnable()
|
|
}
|
|
}
|
|
@@ -397,3 +396,16 @@ export default class ConvertViews extends THREE.EventDispatcher{
|
|
//位置参照第一个漫游点。保持相机相对第一个漫游点的位移和
|
|
//位置参照第一个漫游点。保持相机相对第一个漫游点的位移和
|
|
} */
|
|
} */
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+/*
|
|
|
|
+
|
|
|
|
+note:
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+旋转只能通过target设置, 不能直接改camera.quaternion
|
|
|
|
+当且仅当发送方相机属性变化后才传递过来,就不在这里判断是否变化了。
|
|
|
|
+(所以只需要实时检测相机是否改变, hasChanged后发送)
|
|
|
|
+
|
|
|
|
+ */
|