|
@@ -75616,7 +75616,7 @@ void main()
|
|
|
depTexLocBindDataset: true,//是否在pano模式下,使用深度图得到intersect的话,改intersect能属于该pano所在的点云。也就相当于在全景模式下intersect的点属于该全景图
|
|
|
|
|
|
notAdditiveBlending:false, //点云是否使用普通的blend, 否则会曝光过渡
|
|
|
- precision:2, // 两位小数
|
|
|
+ precision:0, // 位小数
|
|
|
useV4url:true, //v4的全景图等路径不一样 scene_view_data
|
|
|
|
|
|
useRTskybox:true, //直接使用rtEDL绘制到屏幕,当是全景模式时. 在降4倍时能给render节省1毫秒,gpu时间未测
|
|
@@ -82052,7 +82052,7 @@ void main()
|
|
|
this.setEdgeLabelPos(label,p1,p2);
|
|
|
|
|
|
distance = distance == void 0 ? p1.distanceTo(p2) : distance;
|
|
|
- var text = this.labelText || viewer.unitConvert.convert(distance, 'distance', Potree.settings.precision, this.unitSystem, 0.1 , true);//distance要传0.1 这个factor
|
|
|
+ var text = this.labelText || viewer.unitConvert.convert(distance, 'distance', Potree.settings.precision , this.unitSystem, 0.001 , true, true);//distance要传0.1 这个factor
|
|
|
label.setText(text);
|
|
|
|
|
|
};
|
|
@@ -96318,24 +96318,32 @@ ENDSEC
|
|
|
getCeilHeight(){//天花板高度值 (假设不存在depth为0的点,所有为0的要么是在盲区,要么是无穷远。)
|
|
|
|
|
|
if(this.ceilZ == void 0){
|
|
|
- const depthTiming = Potree.timeCollect.depthSampler.median; //pc firefox达到4. chrome为0.01
|
|
|
+ //const depthTiming = Potree.timeCollect.depthSampler.median //pc firefox达到4. chrome为0.01
|
|
|
|
|
|
|
|
|
//用三个间隔120度散开,和中心垂直线成一定夹角的三个向量去求 最高高度 (不求平均的原因:万一是0不好算)
|
|
|
|
|
|
let rotMat = new Matrix4().makeRotationX((Potree.config.depthTexUVyLimit+0.01)*Math.PI);// 角度不能小于天花板中空的半径
|
|
|
|
|
|
+ let dir0 = new Vector3(0,0,1).applyMatrix4(rotMat);
|
|
|
|
|
|
|
|
|
- let dirs = [new Vector3(0,0,1).applyMatrix4(rotMat)];
|
|
|
- if(depthTiming < 1){
|
|
|
- let rotMat1 = new Matrix4().makeRotationZ(Math.PI*2 / 3);
|
|
|
- dirs.push(dirs[0].clone().applyMatrix4(rotMat1));
|
|
|
+ let dirs = [
|
|
|
+ dir0,
|
|
|
+ dir0.clone().applyMatrix4(new Matrix4().makeRotationZ(Math.PI*2 / 3)),
|
|
|
+ dir0.clone().applyMatrix4(new Matrix4().makeRotationZ(-Math.PI*2 / 3))
|
|
|
+ ];
|
|
|
+
|
|
|
+
|
|
|
+ /* if(depthTiming < 1){
|
|
|
+ let rotMat1 = new THREE.Matrix4().makeRotationZ(Math.PI*2 / 3);
|
|
|
+ dirs.push(dirs[0].clone().applyMatrix4(rotMat1))
|
|
|
}
|
|
|
if(depthTiming < 0.3){
|
|
|
- let rotMat2 = new Matrix4().makeRotationZ(-Math.PI*2 / 3);
|
|
|
+ let rotMat2 = new THREE.Matrix4().makeRotationZ(-Math.PI*2 / 3);
|
|
|
dirs.push(dirs[0].clone().applyMatrix4(rotMat2));
|
|
|
- }
|
|
|
+ } */
|
|
|
+
|
|
|
|
|
|
let zs = dirs.map(dir_=>{
|
|
|
let dir = dir_.clone().applyMatrix4(this.panoMatrix2); //pano不一定是垂直的, 需要把之前的dirInPano先转成真实的dir,防止超出角度限制
|
|
@@ -97444,7 +97452,7 @@ ENDSEC
|
|
|
|
|
|
|
|
|
|
|
|
- isNeighbour(pano0, pano1, dontCompute, onlyUseTex, computeDirFirst){//是否之间没有遮挡(在加载visibles之前,自己算) 最好pano0是currentPano
|
|
|
+ isNeighbour(pano0, pano1, {dontCompute, onlyUseTex, computeDirFirst, computeTwoDir}={}){//是否之间没有遮挡(在加载visibles之前,自己算) 最好pano0是currentPano
|
|
|
|
|
|
if(!pano0 || !pano1 )return
|
|
|
|
|
@@ -97489,7 +97497,7 @@ ENDSEC
|
|
|
}
|
|
|
};
|
|
|
|
|
|
- if( map0[pano1.id] == void 0 && !ifNeighbour ) {//主方向为空且不为邻居
|
|
|
+ if(!ifNeighbour && (map0[pano1.id] == void 0 || (computeTwoDir && map1[pano0.id] == void 0))) {//主方向为空且不为邻居
|
|
|
let simpleJudge = pano0.position.distanceToSquared(pano1.position) > 300; //在远处去掉对floorPosition的判断
|
|
|
if(pano0.depthTex || pano1.depthTex){
|
|
|
|
|
@@ -98154,10 +98162,13 @@ ENDSEC
|
|
|
|
|
|
for(let a=0, b=g.length; a<b; a++){
|
|
|
let item = g[a];
|
|
|
- if(this.isNeighbour(pano, item.item, true) != void 0) continue
|
|
|
+ if(item.item == pano)continue
|
|
|
+ if(this.isNeighbour(pano,item.item,{dontCompute:true}) || this.neighbourMap[pano.id][item.item.id]!= void 0 && this.neighbourMap[item.item.id][pano.id]!= void 0)continue //为true或两个方向都算了的
|
|
|
|
|
|
+ //console.log('check isNeighbour', pano.id, item.item.id)
|
|
|
+
|
|
|
let byCloud = !pano.pointcloud.hasDepthTex;
|
|
|
- let result = this.isNeighbour(pano, item.item, false, !byCloud, true);//计算
|
|
|
+ let result = this.isNeighbour(pano, item.item, {onlyUseTex: !byCloud, computeDirFirst:true, computeTwoDir:true});//计算
|
|
|
|
|
|
if(result != void 0){//计算了
|
|
|
//console.log('提前计算neighbor', pano.id, item.item.id)
|
|
@@ -102924,9 +102935,9 @@ ENDSEC
|
|
|
return this.convert(t, n, precision, r, minFactor)
|
|
|
}
|
|
|
|
|
|
- convert(number, domain, precision = 2, system, minFactor, ifEighths = !1) {
|
|
|
+ convert(number, domain, precision = 2, system, minFactor, ifEighths = !1, ifRestrictFactor) {
|
|
|
if (!number) return "";
|
|
|
- var s = this.getMostRelevantMeasurement(domain, system || this.UnitService.currentSystem, number, minFactor);
|
|
|
+ var s = this.getMostRelevantMeasurement(domain, system || this.UnitService.currentSystem, number, minFactor, ifRestrictFactor);
|
|
|
return this.getFormattedMeasurementString(s[0], s[1], precision, ifEighths)
|
|
|
}
|
|
|
|
|
@@ -102976,7 +102987,7 @@ ENDSEC
|
|
|
return 0 !== r ? r + "' " + s + a + '"' : "" + s + a + '"'
|
|
|
}
|
|
|
|
|
|
- getMostRelevantMeasurement(domain, system, number, minFactor=0) {
|
|
|
+ getMostRelevantMeasurement(domain, system, number, minFactor=0, ifRestrictFactor) {
|
|
|
/* var a = r.values(UnitsOfMeasurement.getUnitsOfMeasurementByDomainAndSystem(domain, system))
|
|
|
, s = r.filter(a, function(t) {
|
|
|
return t.factor >= i
|
|
@@ -102988,9 +102999,12 @@ ENDSEC
|
|
|
let u = UnitsOfMeasurement.getUnitsOfMeasurementByDomainAndSystem(domain, system);
|
|
|
for(let i in u){a.push(u[i]);}
|
|
|
|
|
|
- let s = a.filter(m=>m.factor >= minFactor);
|
|
|
-
|
|
|
-
|
|
|
+ let s;
|
|
|
+ if(ifRestrictFactor){
|
|
|
+ s = a.filter(m=>m.factor == minFactor);
|
|
|
+ }else {
|
|
|
+ s = a.filter(m=>m.factor >= minFactor);
|
|
|
+ }
|
|
|
|
|
|
let c = s.reduce(function(prev, currentValue) {//reduce最终值是最后一次return的值 ( 没看懂这句话作用)
|
|
|
return currentValue.fromBase(number) < prev.fromBase(number) && currentValue.fromBase(number) >= 1 ? currentValue : prev
|
|
@@ -103474,17 +103488,15 @@ ENDSEC
|
|
|
}
|
|
|
}) */
|
|
|
//viewer.setControls(viewer.orbitControls);
|
|
|
- viewer.setLimitFar(false);
|
|
|
+ //viewer.setLimitFar(false)
|
|
|
|
|
|
- /*
|
|
|
- Potree.settings.unableNavigate = true
|
|
|
- Potree.settings.ifShowMarker = false
|
|
|
- Potree.Utils.updateVisible(viewer.measuringTool.scene, 'clipModel', false)
|
|
|
- //Potree.Utils.updateVisible(viewer.mapViewer.cursor, 'clipModel', false)//隐藏地图游标
|
|
|
- viewer.inputHandler.toggleSelection(this.box);
|
|
|
- viewer.inputHandler.fixSelection = true
|
|
|
- viewer.transformationTool.frame.material.color.set(Potree.config.clip.color)//navvis 15899953
|
|
|
- viewer.setPointStandardMat(true) */
|
|
|
+
|
|
|
+ //Potree.settings.unableNavigate = true
|
|
|
+ //Potree.settings.ifShowMarker = false
|
|
|
+ Potree.Utils.updateVisible(viewer.measuringTool.scene, 'clipModel', false);
|
|
|
+
|
|
|
+
|
|
|
+ //viewer.setPointStandardMat(true)
|
|
|
|
|
|
{
|
|
|
this.events = {
|
|
@@ -103521,13 +103533,13 @@ ENDSEC
|
|
|
|
|
|
//viewer.setControls(viewer.fpControls);
|
|
|
|
|
|
- Potree.settings.unableNavigate = false;
|
|
|
- Potree.settings.ifShowMarker = this.previousView.ifShowMarker;
|
|
|
+ //Potree.settings.unableNavigate = false
|
|
|
+ //Potree.settings.ifShowMarker = this.previousView.ifShowMarker
|
|
|
Potree.Utils.updateVisible(viewer.measuringTool.scene, 'clipModel', true);
|
|
|
//Potree.Utils.updateVisible(viewer.mapViewer.cursor, 'clipModel', true)
|
|
|
- viewer.setView(this.previousView);
|
|
|
+ //viewer.setView(this.previousView)
|
|
|
//viewer.setClipState(true)
|
|
|
- viewer.controls.setTarget(null);
|
|
|
+ //viewer.controls.setTarget(null)
|
|
|
|
|
|
this.editing = false;
|
|
|
},
|
|
@@ -133599,17 +133611,12 @@ ENDSEC
|
|
|
depthSampler : {minCount:400, median: 25}, //median预置一个中等值,以防止cpu过低的设备首次卡顿
|
|
|
|
|
|
};
|
|
|
+ for(let i in Potree.timeCollect){
|
|
|
+ Potree.timeCollect[i].measures = [];
|
|
|
+ Potree.timeCollect[i].sum = 0;
|
|
|
+ Potree.timeCollect[i].start = true;
|
|
|
+ }
|
|
|
|
|
|
- setTimeout(()=>{
|
|
|
- for(let i in Potree.timeCollect){
|
|
|
- Potree.timeCollect[i].measures = [];
|
|
|
- Potree.timeCollect[i].sum = 0;
|
|
|
- Potree.timeCollect[i].start = true;
|
|
|
- }
|
|
|
- /* setTimeout(()=>{
|
|
|
- console.log('timeCollect', Potree.timeCollect.depthSampler.median, Potree.timeCollect.depthSampler.ave, Potree.timeCollect.depthSampler.measures.length)
|
|
|
- },10000) */
|
|
|
- },2000);
|
|
|
}
|
|
|
|
|
|
|
|
@@ -134301,7 +134308,7 @@ ENDSEC
|
|
|
computeShelter(){
|
|
|
//先算用深度图的,然后再点云;
|
|
|
|
|
|
- let depthTiming = Potree.timeCollect.depthSampler.median;
|
|
|
+ //let depthTiming = Potree.timeCollect.depthSampler.median
|
|
|
let byTex=0, byCloud=0;
|
|
|
let len = shelterHistory.length;
|
|
|
let waitCloud = [];
|