|
@@ -52,6 +52,8 @@ Viewer.constructor = Viewer
|
|
Viewer.prototype.bindEvents = function () {
|
|
Viewer.prototype.bindEvents = function () {
|
|
this.renderer.domElement.addEventListener('pointerdown', this.onPointerDown.bind(this), false);
|
|
this.renderer.domElement.addEventListener('pointerdown', this.onPointerDown.bind(this), false);
|
|
this.renderer.domElement.addEventListener('pointerup', this.onPointerUp.bind(this), false);
|
|
this.renderer.domElement.addEventListener('pointerup', this.onPointerUp.bind(this), false);
|
|
|
|
+ this.renderer.domElement.addEventListener('pointermove', this.onPointerMove.bind(this), false);
|
|
|
|
+
|
|
}
|
|
}
|
|
|
|
|
|
Viewer.prototype.setRenderer = function () {
|
|
Viewer.prototype.setRenderer = function () {
|
|
@@ -172,14 +174,14 @@ Viewer.prototype.animate = function () {
|
|
this.dispatchEvent({ type: 'view.changed'/* , changeSlightly: changed.changeSlightly */ })
|
|
this.dispatchEvent({ type: 'view.changed'/* , changeSlightly: changed.changeSlightly */ })
|
|
delayNeedUpdated = true
|
|
delayNeedUpdated = true
|
|
|
|
|
|
- if (!transitions.funcs.some(function (e) { return e.name === 'cameraFly' })) {
|
|
|
|
|
|
+ if (!transitions.funcs.some(function (e) { return e.name.includes('cameraFly') })) {
|
|
convertTool.intervalTool.isWaiting('delayUpdate', () => { //延时update,防止卡顿
|
|
convertTool.intervalTool.isWaiting('delayUpdate', () => { //延时update,防止卡顿
|
|
if (delayNeedUpdated) {
|
|
if (delayNeedUpdated) {
|
|
delayNeedUpdated = false
|
|
delayNeedUpdated = false
|
|
this.dispatchEvent({ type: 'delayUpdate' })
|
|
this.dispatchEvent({ type: 'delayUpdate' })
|
|
return true
|
|
return true
|
|
}
|
|
}
|
|
- }, 200)
|
|
|
|
|
|
+ }, 300)
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
@@ -316,7 +318,12 @@ Viewer.prototype.onPointerMove = function (event) {
|
|
if (event.isPrimary === false) return;
|
|
if (event.isPrimary === false) return;
|
|
mouse.x = (event.clientX / window.innerWidth) * 2 - 1;
|
|
mouse.x = (event.clientX / window.innerWidth) * 2 - 1;
|
|
mouse.y = - (event.clientY / window.innerHeight) * 2 + 1;
|
|
mouse.y = - (event.clientY / window.innerHeight) * 2 + 1;
|
|
- if (!this.pointerDownPos) this.checkIntersection();
|
|
|
|
|
|
+ if (!this.pointerDownPos){
|
|
|
|
+ //this.checkIntersection();
|
|
|
|
+ }else{
|
|
|
|
+ transitions.cancelByName('cameraFly2')
|
|
|
|
+ }
|
|
|
|
+ //console.log('onPointerMove', this.pointerDownPos)
|
|
}
|
|
}
|
|
Viewer.prototype.onPointerDown = function (event) {
|
|
Viewer.prototype.onPointerDown = function (event) {
|
|
if (event.isPrimary === false) return;
|
|
if (event.isPrimary === false) return;
|