|
@@ -8,7 +8,7 @@ export default class ConvertViews extends THREE.EventDispatcher{
|
|
constructor( ) {
|
|
constructor( ) {
|
|
super()
|
|
super()
|
|
this.settings = {
|
|
this.settings = {
|
|
- durations : {flyToPano:1000, dolly:60}
|
|
|
|
|
|
+ durations : {flyToPano:1000, dolly:60, bimAniOrigin:1000}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@@ -411,7 +411,7 @@ export default class ConvertViews extends THREE.EventDispatcher{
|
|
let speed = baseSpeed + dis / 8
|
|
let speed = baseSpeed + dis / 8
|
|
//console.log('speed', speed)
|
|
//console.log('speed', speed)
|
|
|
|
|
|
- this.bimFlyTo({forwardDis: e.wheelDelta > 0 ? speed : -speed, duration:this.settings.durations.dolly})
|
|
|
|
|
|
+ this.bimFlyTo({forwardDis: e.wheelDelta > 0 ? speed : -speed, duration:this.settings.durations.dolly, radius:dis})
|
|
})
|
|
})
|
|
|
|
|
|
//右键pan
|
|
//右键pan
|
|
@@ -784,17 +784,24 @@ export default class ConvertViews extends THREE.EventDispatcher{
|
|
}
|
|
}
|
|
bimFlyTo(data){
|
|
bimFlyTo(data){
|
|
let info = bimViewer.getCameraStatus()
|
|
let info = bimViewer.getCameraStatus()
|
|
- let dir = new THREE.Vector3().subVectors(info.target, info.position).normalize()
|
|
|
|
|
|
+
|
|
|
|
+ let vec = new THREE.Vector3().subVectors(info.target, info.position)
|
|
|
|
+ let radius = vec.length() //修改了target到position的距离会影响pan时的速度
|
|
|
|
+ let dir = vec.clone().normalize()
|
|
|
|
+
|
|
let position = data.position
|
|
let position = data.position
|
|
if(!position){
|
|
if(!position){
|
|
position = new THREE.Vector3().addVectors(info.position, dir.clone().multiplyScalar(data.forwardDis))//forwardDis:前进距离
|
|
position = new THREE.Vector3().addVectors(info.position, dir.clone().multiplyScalar(data.forwardDis))//forwardDis:前进距离
|
|
-
|
|
|
|
|
|
+ radius = Math.max(radius-data.forwardDis, 0.7)
|
|
}
|
|
}
|
|
if(data.duration != void 0){
|
|
if(data.duration != void 0){
|
|
bimViewer.getViewer().animator.setDuration(data.duration)//滚轮缩放时长,原先:1000
|
|
bimViewer.getViewer().animator.setDuration(data.duration)//滚轮缩放时长,原先:1000
|
|
}
|
|
}
|
|
- let target = new THREE.Vector3().addVectors(position, dir)
|
|
|
|
- let msg = {
|
|
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ let target = new THREE.Vector3().addVectors(position, dir.clone().multiplyScalar(radius))
|
|
|
|
+ let msg = {//不能修改
|
|
position,
|
|
position,
|
|
target,
|
|
target,
|
|
up: new THREE.Vector3(0,0,1),
|
|
up: new THREE.Vector3(0,0,1),
|