|
@@ -25528,6 +25528,7 @@
|
|
}
|
|
}
|
|
if (!isTouch || e.touches.length == 1) {
|
|
if (!isTouch || e.touches.length == 1) {
|
|
if ((!this.drag || this.drag.notPressMouse || Potree.settings.intersectOnObjs && this.drag.object) && !isFlying) {
|
|
if ((!this.drag || this.drag.notPressMouse || Potree.settings.intersectOnObjs && this.drag.object) && !isFlying) {
|
|
|
|
+ var _curr$_listeners;
|
|
/* let blacklist = this.drag && this.drag */
|
|
/* let blacklist = this.drag && this.drag */
|
|
var hoveredElements = this.getHoveredElements();
|
|
var hoveredElements = this.getHoveredElements();
|
|
if (hoveredElements.length > 0) {
|
|
if (hoveredElements.length > 0) {
|
|
@@ -25557,19 +25558,30 @@
|
|
this.lastMouseoverElement = curr;
|
|
this.lastMouseoverElement = curr;
|
|
viewer.dispatchEvent('content_changed');
|
|
viewer.dispatchEvent('content_changed');
|
|
}
|
|
}
|
|
- if (hoveredElements.length > 0) {
|
|
|
|
- var object = hoveredElements.map(e => e.object).find(e => e._listeners && e._listeners['mousemove']);
|
|
|
|
- if (object) {
|
|
|
|
- /* object.dispatchEvent({
|
|
|
|
- type: 'mousemove',
|
|
|
|
- object: object
|
|
|
|
- }); */
|
|
|
|
- object.dispatchEvent($.extend(this.getEventDesc(e), {
|
|
|
|
|
|
+ if (curr !== null && curr !== void 0 && (_curr$_listeners = curr._listeners) !== null && _curr$_listeners !== void 0 && _curr$_listeners.mousemove) {
|
|
|
|
+ if (curr) {
|
|
|
|
+ //xzw改为只取第一个
|
|
|
|
+ curr.dispatchEvent($.extend(this.getEventDesc(e), {
|
|
type: 'mousemove',
|
|
type: 'mousemove',
|
|
- hoveredElement: hoveredElements.find(e => e.object == object)
|
|
|
|
|
|
+ hoveredElement: cur
|
|
}));
|
|
}));
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+ /* if(hoveredElements.length > 0){
|
|
|
|
+ let object = hoveredElements
|
|
|
|
+ .map(e => e.object)
|
|
|
|
+ .find(e => (e._listeners && e._listeners['mousemove']));
|
|
|
|
+
|
|
|
|
+ if(object){
|
|
|
|
+ object.dispatchEvent($.extend(
|
|
|
|
+ this.getEventDesc(e),
|
|
|
|
+ {
|
|
|
|
+ type: 'mousemove',
|
|
|
|
+ hoveredElement: hoveredElements.find(e=>e.object == object)
|
|
|
|
+ }
|
|
|
|
+ ));
|
|
|
|
+ }
|
|
|
|
+ } */
|
|
this.hoveredElements = hoveredElements;
|
|
this.hoveredElements = hoveredElements;
|
|
}
|
|
}
|
|
|
|
|
|
@@ -42274,7 +42286,7 @@
|
|
}; //稍微小点防止字体模糊
|
|
}; //稍微小点防止字体模糊
|
|
|
|
|
|
var titleLineHeight = 2;
|
|
var titleLineHeight = 2;
|
|
- var arrowCountMax = 100; //箭头总数不能超过这个值。 The count value passed into the constructor represents the maximum number of instances of this mesh. You can change the number of instances at runtime to an integer value in the range [0, count].If you need more instances than the original count value, you have to create a new InstancedMesh.
|
|
|
|
|
|
+ var arrowCountMax = 1000; //箭头总数不能超过这个值。 The count value passed into the constructor represents the maximum number of instances of this mesh. You can change the number of instances at runtime to an integer value in the range [0, count].If you need more instances than the original count value, you have to create a new InstancedMesh.
|
|
var lastArrowCamPos,
|
|
var lastArrowCamPos,
|
|
lastArrowCount = 0;
|
|
lastArrowCount = 0;
|
|
var depthProps = {
|
|
var depthProps = {
|
|
@@ -42357,6 +42369,7 @@
|
|
marker.scale.set(s, s, s);
|
|
marker.scale.set(s, s, s);
|
|
};
|
|
};
|
|
var fakeMarker;
|
|
var fakeMarker;
|
|
|
|
+ var lastFadeTime;
|
|
var showFakeMarker = (path, position) => {
|
|
var showFakeMarker = (path, position) => {
|
|
//添加marker时指示位置
|
|
//添加marker时指示位置
|
|
if (!fakeMarker) {
|
|
if (!fakeMarker) {
|
|
@@ -42368,10 +42381,12 @@
|
|
path.add(fakeMarker);
|
|
path.add(fakeMarker);
|
|
fakeMarker.position.copy(position);
|
|
fakeMarker.position.copy(position);
|
|
Potree.Utils.updateVisible(fakeMarker, 'add', true);
|
|
Potree.Utils.updateVisible(fakeMarker, 'add', true);
|
|
|
|
+ viewer.dispatchEvent('content_changed');
|
|
return fakeMarker;
|
|
return fakeMarker;
|
|
};
|
|
};
|
|
var hideFakeMarker = () => {
|
|
var hideFakeMarker = () => {
|
|
fakeMarker && Potree.Utils.updateVisible(fakeMarker, 'add', false);
|
|
fakeMarker && Potree.Utils.updateVisible(fakeMarker, 'add', false);
|
|
|
|
+ lastFadeTime = Date.now();
|
|
};
|
|
};
|
|
class Path$1 extends ctrlPolygon {
|
|
class Path$1 extends ctrlPolygon {
|
|
constructor(prop) {
|
|
constructor(prop) {
|
|
@@ -42412,7 +42427,8 @@
|
|
y: 0.5
|
|
y: 0.5
|
|
},
|
|
},
|
|
//向上移动一半
|
|
//向上移动一半
|
|
- maxLineWidth: 300
|
|
|
|
|
|
+ maxLineWidth: 300,
|
|
|
|
+ textAlign: Potree.settings.isOfficial && 'left'
|
|
}));
|
|
}));
|
|
this.titleLabel.sprite.material.depthTest = false;
|
|
this.titleLabel.sprite.material.depthTest = false;
|
|
var line = LineDraw.createFatLine([new Vector3(0, 0, 0), new Vector3(0, 0, titleLineHeight)], Object.assign({}, depthProps, {
|
|
var line = LineDraw.createFatLine([new Vector3(0, 0, 0), new Vector3(0, 0, titleLineHeight)], Object.assign({}, depthProps, {
|
|
@@ -42484,7 +42500,7 @@
|
|
//和measure不同的是它的边是连在一起的一整条
|
|
//和measure不同的是它的边是连在一起的一整条
|
|
this.edge = new Mesh(voidGeometry, new DepthBasicMaterial($.extend({}, depthProps, {
|
|
this.edge = new Mesh(voidGeometry, new DepthBasicMaterial($.extend({}, depthProps, {
|
|
color: this.pathColor || '#fff',
|
|
color: this.pathColor || '#fff',
|
|
- opacity: 0.4,
|
|
|
|
|
|
+ opacity: 0.3,
|
|
side: 2,
|
|
side: 2,
|
|
transparent: true,
|
|
transparent: true,
|
|
fadeFar: this.fadeFar
|
|
fadeFar: this.fadeFar
|
|
@@ -42550,7 +42566,7 @@
|
|
this.hideArrowUntilUpdate();
|
|
this.hideArrowUntilUpdate();
|
|
this.dispatchEvent('changed');
|
|
this.dispatchEvent('changed');
|
|
} else {
|
|
} else {
|
|
- this.isNew || viewer.measuringTool.isAdding || this.dispatchEvent('click'); //viewer.focusOnObject(this, 'measure') //正在添加测量线时不要focus其他线(容易误触)
|
|
|
|
|
|
+ this.isNew || viewer.measuringTool.isAdding || this.dispatchEvent('clicked'); //viewer.focusOnObject(this, 'measure') //正在添加测量线时不要focus其他线(容易误触)
|
|
}
|
|
}
|
|
});
|
|
});
|
|
};
|
|
};
|
|
@@ -42636,7 +42652,9 @@
|
|
transform2D: {
|
|
transform2D: {
|
|
x: 0,
|
|
x: 0,
|
|
y: 0.2
|
|
y: 0.2
|
|
- } //朝上偏移一些 配合最外层z混合增高
|
|
|
|
|
|
+ },
|
|
|
|
+ //朝上偏移一些 配合最外层z混合增高
|
|
|
|
+ textAlign: Potree.settings.isOfficial && 'left'
|
|
}));
|
|
}));
|
|
if (hasHoverEvent) {
|
|
if (hasHoverEvent) {
|
|
label.addEventListener('mouseover', () => {
|
|
label.addEventListener('mouseover', () => {
|
|
@@ -42772,7 +42790,7 @@
|
|
action: 'add',
|
|
action: 'add',
|
|
name: 'pen_delPoint'
|
|
name: 'pen_delPoint'
|
|
});
|
|
});
|
|
- hideFakeMarker();
|
|
|
|
|
|
+ //hideFakeMarker()
|
|
}
|
|
}
|
|
this.hoverStates.marker = marker;
|
|
this.hoverStates.marker = marker;
|
|
} /* ,{importance:1} */);
|
|
} /* ,{importance:1} */);
|
|
@@ -43137,7 +43155,7 @@
|
|
}, 300); //为了防止不停点击不停更新,所以隐藏一下不变了再更新
|
|
}, 300); //为了防止不停点击不停更新,所以隐藏一下不变了再更新
|
|
}
|
|
}
|
|
static updateArrows(force) {
|
|
static updateArrows(force) {
|
|
- var far = math.linearClamp(Potree.fpsRendered2, [10, 60], [80, 180]); //几乎看不见了
|
|
|
|
|
|
+ var far = math.linearClamp(Potree.fpsRendered2, [10, 60], [200, 350]); //几乎看不见了
|
|
|
|
|
|
var paths = viewer.scene.measurements.filter(e => {
|
|
var paths = viewer.scene.measurements.filter(e => {
|
|
var _e$arrows;
|
|
var _e$arrows;
|
|
@@ -43168,7 +43186,7 @@
|
|
});
|
|
});
|
|
}
|
|
}
|
|
});
|
|
});
|
|
- var spaceDis = MathUtils.clamp(math.toPrecision(Math.pow(minDisSq, 0.1) * 5, 1), 5, 8); //箭头之间的间距,适当调节稀疏
|
|
|
|
|
|
+ var spaceDis = MathUtils.clamp(math.toPrecision(Math.pow(minDisSq, 0.1) * 5, 1), 5, 10); //箭头之间的间距,适当调节稀疏
|
|
spaceDis *= math.linearClamp(Potree.fpsRendered2, [10, 60], [3, 1]);
|
|
spaceDis *= math.linearClamp(Potree.fpsRendered2, [10, 60], [3, 1]);
|
|
if ((lastArrowCamPos && math.closeTo(lastArrowCamPos, viewer.mainViewport.view.position, 2) || lines.length == 0) && !force) return; //很远的时候lines空的不更新(不清空)
|
|
if ((lastArrowCamPos && math.closeTo(lastArrowCamPos, viewer.mainViewport.view.position, 2) || lines.length == 0) && !force) return; //很远的时候lines空的不更新(不清空)
|
|
lastArrowCamPos = viewer.mainViewport.view.position.clone();
|
|
lastArrowCamPos = viewer.mainViewport.view.position.clone();
|
|
@@ -56857,7 +56875,7 @@
|
|
})));
|
|
})));
|
|
this.spot.scale.set(defaultSpotScale, defaultSpotScale, defaultSpotScale);
|
|
this.spot.scale.set(defaultSpotScale, defaultSpotScale, defaultSpotScale);
|
|
this.spot.renderOrder = this.spot.pickOrder = Potree.config.renderOrders.tag.spot;
|
|
this.spot.renderOrder = this.spot.pickOrder = Potree.config.renderOrders.tag.spot;
|
|
- Potree.settings.isOfficial || this.changeImage(Potree.resourcePath + '/textures/spot_default.png');
|
|
|
|
|
|
+ Potree.settings.isOfficial || this.changeMap(Potree.resourcePath + '/textures/spot_default.png');
|
|
this.line = LineDraw.createFatLine([], {
|
|
this.line = LineDraw.createFatLine([], {
|
|
mat: lineMat
|
|
mat: lineMat
|
|
});
|
|
});
|
|
@@ -56867,7 +56885,7 @@
|
|
root: group,
|
|
root: group,
|
|
text: '',
|
|
text: '',
|
|
sizeInfo: {
|
|
sizeInfo: {
|
|
- width2d: 130
|
|
|
|
|
|
+ width2d: 150
|
|
},
|
|
},
|
|
textColor: {
|
|
textColor: {
|
|
r: 255,
|
|
r: 255,
|
|
@@ -56892,7 +56910,9 @@
|
|
transform2Dpercent: {
|
|
transform2Dpercent: {
|
|
x: 0,
|
|
x: 0,
|
|
y: 0.5
|
|
y: 0.5
|
|
- } //向上移动一半
|
|
|
|
|
|
+ },
|
|
|
|
+ //向上移动一半
|
|
|
|
+ textAlign: Potree.settings.isOfficial && 'left'
|
|
})); //更新sprite时,实际更新的是root: spot的矩阵
|
|
})); //更新sprite时,实际更新的是root: spot的矩阵
|
|
this.setTitle(this.title);
|
|
this.setTitle(this.title);
|
|
this.updateTitlePos();
|
|
this.updateTitlePos();
|
|
@@ -78280,7 +78300,8 @@
|
|
*
|
|
*
|
|
*
|
|
*
|
|
*/
|
|
*/
|
|
- var minRadius = 2;
|
|
|
|
|
|
+ var minRadius = 2,
|
|
|
|
+ maxRadius = 300;
|
|
class OrbitControls$1 extends EventDispatcher {
|
|
class OrbitControls$1 extends EventDispatcher {
|
|
constructor(viewer, viewport) {
|
|
constructor(viewer, viewport) {
|
|
super();
|
|
super();
|
|
@@ -78373,19 +78394,9 @@
|
|
});
|
|
});
|
|
};
|
|
};
|
|
var scroll = e => {
|
|
var scroll = e => {
|
|
- var _viewer$inputHandler$, _viewer$inputHandler$2;
|
|
|
|
if (!this.enabled) return;
|
|
if (!this.enabled) return;
|
|
var resolvedRadius = this.currentViewport.view.radius + this.radiusDelta;
|
|
var resolvedRadius = this.currentViewport.view.radius + this.radiusDelta;
|
|
-
|
|
|
|
- /* let model = viewer.inputHandler.intersect?.model || viewer.inputHandler.intersect?.pointcloud || viewer.modules.MergeEditor?.selected;
|
|
|
|
- let min = 0.1
|
|
|
|
- if(model){
|
|
|
|
- min *= model.scale.x //有的模型太小。注意:如果没有选中模型且没有intersect会无法前进是会有点怪
|
|
|
|
- }
|
|
|
|
- if(resolvedRadius < min && e.delta>0)return; //防止缩放太小,导致很慢 */
|
|
|
|
this.radiusDelta += -e.delta * resolvedRadius * 0.1;
|
|
this.radiusDelta += -e.delta * resolvedRadius * 0.1;
|
|
- var model = ((_viewer$inputHandler$ = viewer.inputHandler.intersect) === null || _viewer$inputHandler$ === void 0 ? void 0 : _viewer$inputHandler$.object) || ((_viewer$inputHandler$2 = viewer.inputHandler.intersect) === null || _viewer$inputHandler$2 === void 0 ? void 0 : _viewer$inputHandler$2.pointcloud);
|
|
|
|
- model && this.updateRadiusByModel(model, viewer.inputHandler.intersect.location.distanceTo(this.currentViewport.view.position));
|
|
|
|
this.stopTweens();
|
|
this.stopTweens();
|
|
};
|
|
};
|
|
var dblclick = e => {
|
|
var dblclick = e => {
|
|
@@ -78474,6 +78485,19 @@
|
|
if (distance < minRadius) minRadius = distance * 0.5; //融合页面当focus一个很小的物体时,需要将minRadius也调小
|
|
if (distance < minRadius) minRadius = distance * 0.5; //融合页面当focus一个很小的物体时,需要将minRadius也调小
|
|
}
|
|
}
|
|
});
|
|
});
|
|
|
|
+ this.viewer.addEventListener('camera_changed', e => {
|
|
|
|
+ if (e.viewport == this.currentViewport) {
|
|
|
|
+ var _viewer$inputHandler$, _viewer$inputHandler$2;
|
|
|
|
+ var model = ((_viewer$inputHandler$ = viewer.inputHandler.intersect) === null || _viewer$inputHandler$ === void 0 ? void 0 : _viewer$inputHandler$.object) || ((_viewer$inputHandler$2 = viewer.inputHandler.intersect) === null || _viewer$inputHandler$2 === void 0 ? void 0 : _viewer$inputHandler$2.pointcloud);
|
|
|
|
+ if (model) this.updateRadiusByModel(model, viewer.inputHandler.intersect.location.distanceTo(this.currentViewport.view.position));else {
|
|
|
|
+ var disToGroundInDir = Math.abs(this.currentViewport.camera.position.z / this.currentViewport.view.direction.z); //相机和地面交点距离
|
|
|
|
+ maxRadius = Math.max(2, disToGroundInDir * 1.5); //越靠近地面速度越慢,防止移动来移动去久了之后距离模型很近但radius很大
|
|
|
|
+
|
|
|
|
+ minRadius = disToGroundInDir * 0.9; //防止在高空放大很慢
|
|
|
|
+ //console.log('changeRadius common', minRadius, maxRadius)
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ });
|
|
}
|
|
}
|
|
setScene(scene) {
|
|
setScene(scene) {
|
|
this.scene = scene;
|
|
this.scene = scene;
|
|
@@ -78583,7 +78607,8 @@
|
|
var len = size.length();
|
|
var len = size.length();
|
|
var distance = MathUtils.clamp(dis, 0.8 * object.scale.x, Math.max(len * 0.1, 3 * object.scale.x));
|
|
var distance = MathUtils.clamp(dis, 0.8 * object.scale.x, Math.max(len * 0.1, 3 * object.scale.x));
|
|
minRadius = distance;
|
|
minRadius = distance;
|
|
- //console.log('updateRadiusByModel',distance)
|
|
|
|
|
|
+ maxRadius = dis * 2;
|
|
|
|
+ //console.log('updateRadiusByModel',minRadius, maxRadius)
|
|
return distance;
|
|
return distance;
|
|
}
|
|
}
|
|
stopTweens() {
|
|
stopTweens() {
|
|
@@ -78658,6 +78683,9 @@
|
|
var radius = view.radius + _progression * this.radiusDelta;
|
|
var radius = view.radius + _progression * this.radiusDelta;
|
|
var _V = view.direction.multiplyScalar(-radius);
|
|
var _V = view.direction.multiplyScalar(-radius);
|
|
var _position = new Vector3().addVectors(view.getPivot(), _V);
|
|
var _position = new Vector3().addVectors(view.getPivot(), _V);
|
|
|
|
+ if (radius > maxRadius) {
|
|
|
|
+ radius = maxRadius;
|
|
|
|
+ }
|
|
if (this.constantlyForward) {
|
|
if (this.constantlyForward) {
|
|
// 到达中心点后还能继续向前移动,也就是能推进中心点
|
|
// 到达中心点后还能继续向前移动,也就是能推进中心点
|
|
if (radius < minRadius) {
|
|
if (radius < minRadius) {
|