|
@@ -42972,95 +42972,6 @@
|
|
|
this.lastUpdatePoints_ = this.points.map(e => e.clone());
|
|
|
} //不使用curve的曲线是因为那种geo点数较多,且改的话不知道updateArrows怎么改,除非变为贴图,但就和需求中需要调节间距违背。
|
|
|
|
|
|
- updateEdge1() {
|
|
|
- //drawPathRibbon版
|
|
|
- if (this.lastUpdatePoints_ && Potree.Common.ifSame(this.lastUpdatePoints_, this.points) && this.halfPathWidth == this.lastHalfPathWidth) return; //没变 不更新
|
|
|
- //this.edge.geometry = MeshDraw.getExtrudeGeo(edgeExtrudePoints, null, {extrudePath: this.points, openEnded:true, shapeDontClose:true/* , dontSmooth:true, steps: this.points.length-1 */})
|
|
|
- //getExtrudeGeo是平滑过的曲线,和设计不一样,且容易翻转,转角有时候细分过少
|
|
|
-
|
|
|
- //只允许path水平放置
|
|
|
- var geo;
|
|
|
- var points_ = this.getDifferentPoint(this.points);
|
|
|
- var len = points_.length;
|
|
|
- this.edge.geometry.dispose();
|
|
|
- if (len <= 1) {
|
|
|
- geo = voidGeometry;
|
|
|
- } else {
|
|
|
- //drawPathRibbon setFloorCurves
|
|
|
- var line = new CatmullRomCurve3(points_, false);
|
|
|
- var points = line.getSpacedPoints(100);
|
|
|
- var posArr = [],
|
|
|
- faceArr = [];
|
|
|
- for (var i = this.halfPathWidth, n = new Vector3(), r = new Vector3(0, 0, 0), a = new Vector3(), s = 0; s < points.length; s += 1) {
|
|
|
- a.copy(points[s]), 0 === s ? a.sub(points[s + 1]) : a.sub(points[s - 1]).negate(), a.normalize(), n.crossVectors(a, new Vector3(0, 0, 1)), n.multiplyScalar(i);
|
|
|
- var l = new Vector3().copy(points[s]).add(r);
|
|
|
- l.sub(n), posArr.push(l),
|
|
|
- //o.vertices.push(l),
|
|
|
- (l = new Vector3().copy(points[s]).add(r)).add(n), posArr.push(l); //o.vertices.push(l)
|
|
|
- } //问题:不是水平放置,高度不同时有点扭转,且宽度改变了
|
|
|
-
|
|
|
- var c,
|
|
|
- h,
|
|
|
- u,
|
|
|
- d = 0;
|
|
|
- for (s = 0; s < points.length - 1; s += 1) {
|
|
|
- var p = 2 * s;
|
|
|
- // , f = d
|
|
|
- // , g = d += points[s + 1].distanceTo(points[s])
|
|
|
- // , m = t[s]
|
|
|
- // , v = t[s + 1];
|
|
|
- //(c = new P.Face3(p,1 + p,2 + p)).vertexColors = [new P.Color(m), new P.Color(m), new P.Color(v)],
|
|
|
- //o.faces.push(c),
|
|
|
- faceArr.push([p, 1 + p, 2 + p]);
|
|
|
- //o.faceVertexUvs[0].push([new P.Vector2(0,f), new P.Vector2(1,f), new P.Vector2(0,g)]),
|
|
|
- //(c = new P.Face3(2 + p,1 + p,3 + p)).vertexColors = [new P.Color(v), new P.Color(m), new P.Color(v)],
|
|
|
- //o.faces.push(c),
|
|
|
- faceArr.push([2 + p, 1 + p, 3 + p]);
|
|
|
- //o.faceVertexUvs[0].push([new P.Vector2(0,g), new P.Vector2(1,f), new P.Vector2(1,g)])
|
|
|
- }
|
|
|
- //o.computeFaceNormals(),
|
|
|
- //o.computeVertexNormals(),
|
|
|
-
|
|
|
- geo = MeshDraw.createGeometry(posArr, faceArr);
|
|
|
- }
|
|
|
- this.edge.geometry = geo;
|
|
|
- this.lastHalfPathWidth = this.halfPathWidth;
|
|
|
- this.lastUpdatePoints_ = this.points.map(e => e.clone());
|
|
|
- } //不使用curve的曲线是因为那种geo点数较多,且改的话不知道updateArrows怎么改,除非变为贴图,但就和需求中需要调节间距违背。
|
|
|
-
|
|
|
- /*
|
|
|
-
|
|
|
- updateEdge(){
|
|
|
- if(this.lastUpdatePoints_ && Potree.Common.ifSame(this.lastUpdatePoints_,this.points) && this.halfPathWidth == this.lastHalfPathWidth) return //没变 不更新
|
|
|
- //this.edge.geometry = MeshDraw.getExtrudeGeo(edgeExtrudePoints, null, {extrudePath: this.points, openEnded:true, shapeDontClose:true })
|
|
|
- //getExtrudeGeo是平滑过的曲线,和设计不一样,且容易翻转,转角有时候细分过少
|
|
|
-
|
|
|
- //只允许path水平放置
|
|
|
- let geo
|
|
|
- let points_ = this.getDifferentPoint(this.points)
|
|
|
- let len = points_.length
|
|
|
- this.edge.geometry.dispose()
|
|
|
-
|
|
|
- if(len <= 1){
|
|
|
- geo = voidGeometry
|
|
|
- }else{
|
|
|
- //drawPathRibbon setFloorCurves
|
|
|
- let line = new THREE.CatmullRomCurve3(points_, false )
|
|
|
- let points = line.getSpacedPoints(100)
|
|
|
- let posArr = [], faceArr = []
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
- geo = MeshDraw.createGeometry(posArr, faceArr)
|
|
|
- }
|
|
|
-
|
|
|
- this.edge.geometry = geo
|
|
|
-
|
|
|
- this.lastHalfPathWidth = this.halfPathWidth
|
|
|
- this.lastUpdatePoints_ = this.points.map(e=>e.clone())
|
|
|
- } */
|
|
|
-
|
|
|
update() {
|
|
|
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
|
if (options.index == -1) return;
|
|
@@ -81804,7 +81715,8 @@
|
|
|
if (!history.waitCompute.forceGet && (history.waitCompute.panoId != this.images360.currentPano.id || !this.images360.isAtPano(0.1))) {
|
|
|
delete history.waitCompute; //取消计算
|
|
|
} else {
|
|
|
- if (this.images360.currentPano.depthTex) {
|
|
|
+ var _this$images360$curre;
|
|
|
+ if ((_this$images360$curre = this.images360.currentPano) !== null && _this$images360$curre !== void 0 && _this$images360$curre.depthTex) {
|
|
|
if (byTex >= maxTexCount) break;
|
|
|
byTex++;
|
|
|
var ifShelter = !!viewer.inputHandler.ifBlockedByIntersect({
|
|
@@ -81818,7 +81730,8 @@
|
|
|
delete history.waitCompute;
|
|
|
//console.log('补1', history.point.toArray())
|
|
|
} else {
|
|
|
- if (this.images360.currentPano.pointcloud.hasDepthTex) {
|
|
|
+ var _this$images360$curre2;
|
|
|
+ if ((_this$images360$curre2 = this.images360.currentPano) !== null && _this$images360$curre2 !== void 0 && _this$images360$curre2.pointcloud.hasDepthTex) {
|
|
|
//先等待加载完深度图
|
|
|
} else {
|
|
|
waitCloud.push(history);
|
|
@@ -84944,7 +84857,7 @@
|
|
|
//console.log('mapFocusOn: '+target.toArray())
|
|
|
this.mapViewer.moveTo(target.clone(), null, duration);
|
|
|
}
|
|
|
- if (Potree.settings.displayMode == 'showPointCloud') {
|
|
|
+ if (Potree.settings.displayMode == 'showPointCloud' && !o.requestShowPano) {
|
|
|
if (o.dontChangePos) {
|
|
|
position.copy(cameraPos);
|
|
|
} else {
|
|
@@ -84992,7 +84905,7 @@
|
|
|
console.log('移近');
|
|
|
}
|
|
|
}
|
|
|
- } else if (Potree.settings.displayMode == 'showPanos') {
|
|
|
+ } else {
|
|
|
var _pano = viewer.images360.fitPanoTowardPoint({
|
|
|
point: target,
|
|
|
dir: this.mainViewport.view.direction,
|
|
@@ -85722,8 +85635,8 @@
|
|
|
}
|
|
|
});
|
|
|
var judge = () => {
|
|
|
- var _this$images360$curre;
|
|
|
- if (!((_this$images360$curre = this.images360.currentPano) !== null && _this$images360$curre !== void 0 && _this$images360$curre.depthTex) && Potree.settings.displayMode == 'showPanos') {
|
|
|
+ var _this$images360$curre3;
|
|
|
+ if (!((_this$images360$curre3 = this.images360.currentPano) !== null && _this$images360$curre3 !== void 0 && _this$images360$curre3.depthTex) && Potree.settings.displayMode == 'showPanos') {
|
|
|
Potree.Utils.updateVisible(mesh, 'show', true);
|
|
|
} else {
|
|
|
Potree.Utils.updateVisible(mesh, 'show', false);
|