|
@@ -159,7 +159,7 @@ Viewer.prototype.init = function () {
|
|
|
}
|
|
|
|
|
|
|
|
|
-
|
|
|
+let delayNeedUpdated
|
|
|
Viewer.prototype.animate = function () {
|
|
|
var deltaTime = Math.min(1, this.updateClock.getDelta());
|
|
|
this.update(deltaTime)
|
|
@@ -168,7 +168,20 @@ Viewer.prototype.animate = function () {
|
|
|
let changed = this.hasChanged()
|
|
|
if (changed.cameraChanged) {
|
|
|
this.dispatchEvent({ type: 'view.changed', changeSlightly: changed.changeSlightly })
|
|
|
-
|
|
|
+ delayNeedUpdated = true
|
|
|
+
|
|
|
+ if( !transitions.funcs.some(function (e) { return e.name === 'cameraFly' })){
|
|
|
+ convertTool.intervalTool.isWaiting('delayUpdate', ()=>{ //延时update,防止卡顿
|
|
|
+ if(delayNeedUpdated){
|
|
|
+ delayNeedUpdated = false
|
|
|
+ this.dispatchEvent({ type: 'delayUpdate' })
|
|
|
+ console.log('delayUpdate')
|
|
|
+ return true
|
|
|
+ }
|
|
|
+ }, 200)
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
let label_ = this.labels.filter(e => e.elem[0].style.display == 'block')
|
|
|
label_.sort((a, b) => b.pos2d.z - a.pos2d.z)
|
|
|
label_.forEach((e, index) => e.elem.css('z-index', index + 1000));
|
|
@@ -311,6 +324,7 @@ Viewer.prototype.onPointerDown = function (event) {
|
|
|
mouse.x = (event.clientX / window.innerWidth) * 2 - 1;
|
|
|
mouse.y = - (event.clientY / window.innerHeight) * 2 + 1;
|
|
|
this.pointerDownPos = mouse.clone()
|
|
|
+ //console.log('onPointerDown')
|
|
|
}
|
|
|
|
|
|
Viewer.prototype.onPointerUp = function (event) {
|
|
@@ -319,7 +333,7 @@ Viewer.prototype.onPointerUp = function (event) {
|
|
|
this.dispatchEvent({ type: 'onPointerUp' })
|
|
|
mouse.x = (event.clientX / window.innerWidth) * 2 - 1;
|
|
|
mouse.y = - (event.clientY / window.innerHeight) * 2 + 1;
|
|
|
- if (mouse.distanceTo(this.pointerDownPos) < 0.006) {//click
|
|
|
+ if (this.pointerDownPos && mouse.distanceTo(this.pointerDownPos) < 0.006) {//click
|
|
|
this.checkIntersection()
|
|
|
// if (this.intersects.length) {
|
|
|
// console.log(this.intersects[0].point);
|
|
@@ -337,6 +351,7 @@ Viewer.prototype.onPointerUp = function (event) {
|
|
|
// this.clickTime = time;
|
|
|
}
|
|
|
this.pointerDownPos = null
|
|
|
+ //console.log('onPointerUp')
|
|
|
}
|
|
|
|
|
|
|