|
@@ -2,9 +2,18 @@ import math from './math.js'
|
|
|
|
|
|
let bimViewer
|
|
|
|
|
|
+
|
|
|
+
|
|
|
export default class ConvertViews extends THREE.EventDispatcher{
|
|
|
- constructor() {
|
|
|
- super()
|
|
|
+ constructor( ) {
|
|
|
+ super()
|
|
|
+ this.settings = {
|
|
|
+ durations : {flyToPano:1000, dolly:60}
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
}
|
|
|
|
|
|
|
|
@@ -390,8 +399,7 @@ export default class ConvertViews extends THREE.EventDispatcher{
|
|
|
|
|
|
|
|
|
//补充control
|
|
|
-
|
|
|
- bimViewer.getViewer().animator.setDuration(60)//滚轮缩放时长,原先:1000
|
|
|
+
|
|
|
|
|
|
let baseSpeed = THREE.MathUtils.clamp( modelSize.length() / 10, 1, 10)
|
|
|
|
|
@@ -403,7 +411,7 @@ export default class ConvertViews extends THREE.EventDispatcher{
|
|
|
let speed = baseSpeed + dis / 8
|
|
|
//console.log('speed', speed)
|
|
|
|
|
|
- this.bimFlyTo({forwardDis: e.wheelDelta > 0 ? speed : -speed})
|
|
|
+ this.bimFlyTo({forwardDis: e.wheelDelta > 0 ? speed : -speed, duration:this.settings.durations.dolly})
|
|
|
})
|
|
|
|
|
|
//右键pan
|
|
@@ -782,7 +790,9 @@ export default class ConvertViews extends THREE.EventDispatcher{
|
|
|
position = new THREE.Vector3().addVectors(info.position, dir.clone().multiplyScalar(data.forwardDis))//forwardDis:前进距离
|
|
|
|
|
|
}
|
|
|
-
|
|
|
+ if(data.duration != void 0){
|
|
|
+ bimViewer.getViewer().animator.setDuration(data.duration)//滚轮缩放时长,原先:1000
|
|
|
+ }
|
|
|
let target = new THREE.Vector3().addVectors(position, dir)
|
|
|
let msg = {
|
|
|
position,
|