|
@@ -74303,15 +74303,7 @@ void main()
|
|
|
};
|
|
|
|
|
|
//改 总共两种box : 可见和不可见(都是并集)
|
|
|
-
|
|
|
- if(viewer.clipBuildBox){
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
+
|
|
|
let clipBoxes_in = pointcloud.material.clipBoxes_in;
|
|
|
let clipBoxes_out = pointcloud.material.clipBoxes_out;
|
|
|
let bigClipInBox = pointcloud.material.bigClipInBox;
|
|
@@ -76320,7 +76312,8 @@ void main()
|
|
|
prefix3: 'https://4dkk.4dage.com',
|
|
|
prefix4: 'https://uat-laser.4dkankan.com',//test.4dkankan
|
|
|
prefix5: 'https://laser.4dkankan.com/backend',
|
|
|
- prefix6: 'https://mix3d.4dkankan.com/backend',
|
|
|
+ prefix6: 'https://mix3d.4dkankan.com/backend',
|
|
|
+ prefix7: 'https://xfhd.4dkankan.com/backend',
|
|
|
},
|
|
|
|
|
|
transitionsTime:{
|
|
@@ -83783,8 +83776,15 @@ void main()
|
|
|
}
|
|
|
|
|
|
createEdgeLabel(name, hasHoverEvent){
|
|
|
+
|
|
|
+ let inf = {
|
|
|
+ sizeInfo: labelSizeInfo, name:name||'edgeLabel',
|
|
|
+ };
|
|
|
+ if(name && name.includes('Guide')){
|
|
|
+ inf.fontsize = 12;
|
|
|
+ }
|
|
|
const edgeLabel = new TextSprite$2(
|
|
|
- $.extend(hasHoverEvent ? mainLabelProp : subLabelProp,{sizeInfo: labelSizeInfo, name:name||'edgeLabel'})
|
|
|
+ $.extend({}, hasHoverEvent ? mainLabelProp : subLabelProp, inf)
|
|
|
);
|
|
|
if(hasHoverEvent){
|
|
|
edgeLabel.addEventListener('mouseover',()=>{
|
|
@@ -88441,7 +88441,7 @@ void main()
|
|
|
if(params.notAdditiveBlending){
|
|
|
gl.blendFuncSeparate( gl.SRC_ALPHA, gl.ONE_MINUS_SRC_ALPHA, gl.ONE, gl.ONE_MINUS_SRC_ALPHA ); //NormalBlending
|
|
|
/* gl.enable(gl.DEPTH_TEST);
|
|
|
- gl.depthMask(true); //如果不开启depthWrite,加测量线后深度会错乱。 */
|
|
|
+ gl.depthMask(true); //如果不开启depthWrite, 深度会错乱。 */ //无解
|
|
|
gl.disable(gl.DEPTH_TEST);
|
|
|
gl.depthMask(true);
|
|
|
}else {
|
|
@@ -92522,14 +92522,14 @@ void main()
|
|
|
return {
|
|
|
camera, viewport, pointer
|
|
|
}
|
|
|
- }
|
|
|
+ }
|
|
|
|
|
|
|
|
|
- ifBlockedByIntersect({pos3d, margin=0, cameraPos, pickWindowSize, pano, useDepthTex, viewport}={}){//某点是否被遮挡(不允许camera修改位置, 因为depthTex不好置换)
|
|
|
+ ifBlockedByIntersect({point, margin=0, cameraPos, pickWindowSize, pano, useDepthTex, viewport}={}){//某点是否被遮挡(不允许camera修改位置, 因为depthTex不好置换)
|
|
|
viewport = viewport || this.hoverViewport || viewer.mainViewport;
|
|
|
- let intersect = this.getIntersect({viewport, onlyGetIntersect:true, pickWindowSize, useDepthTex, pos3d, cameraPos, pano });
|
|
|
+ let intersect = this.getIntersect({viewport, onlyGetIntersect:true, pickWindowSize, useDepthTex, point, cameraPos, pano });
|
|
|
let cameraPos_ = (!cameraPos && pano) ? pano.position : (cameraPos||viewport.view.position);
|
|
|
- if(intersect && intersect.distance+margin <= pos3d.distanceTo(cameraPos_)){
|
|
|
+ if(intersect && intersect.distance+margin <= point.distanceTo(cameraPos_)){
|
|
|
return intersect //被遮挡
|
|
|
}
|
|
|
//点云模式,对没加载出的点云不准确。 尤其是需要修改相机位置时,因临时修改并不能使点云加载。
|
|
@@ -99784,7 +99784,7 @@ void main()
|
|
|
/* if(this.panos.length > 15 && !force){
|
|
|
return 'noCompute' //数量过多会卡
|
|
|
}else{ */
|
|
|
- /* ifNeighbour = !viewer.inputHandler.ifBlockedByIntersect({pos3d:pano1.position, margin, cameraPos:pano0.position})
|
|
|
+ /* ifNeighbour = !viewer.inputHandler.ifBlockedByIntersect({point:pano1.position, margin, cameraPos:pano0.position})
|
|
|
//console.log('使用点云判断')
|
|
|
if(ifNeighbour){//点云模式下未加载的点云会判断为true
|
|
|
let dir = new THREE.Vector3().subVectors(pano1.position,pano0.position).normalize()
|
|
@@ -99808,10 +99808,10 @@ void main()
|
|
|
};
|
|
|
if(computeDirFirst){//先计算方向,防止重复计算ifBlockedByIntersect
|
|
|
if(inDirection()){
|
|
|
- ifNeighbour = !viewer.inputHandler.ifBlockedByIntersect({pos3d:pano1.position, margin, cameraPos:pano0.position});
|
|
|
+ ifNeighbour = !viewer.inputHandler.ifBlockedByIntersect({point:pano1.position, margin, cameraPos:pano0.position});
|
|
|
}
|
|
|
}else {
|
|
|
- ifNeighbour = !viewer.inputHandler.ifBlockedByIntersect({pos3d:pano1.position, margin, cameraPos:pano0.position});
|
|
|
+ ifNeighbour = !viewer.inputHandler.ifBlockedByIntersect({point:pano1.position, margin, cameraPos:pano0.position});
|
|
|
if(ifNeighbour && !inDirection()){
|
|
|
ifNeighbour = undefined; //不确定
|
|
|
}
|
|
@@ -100331,7 +100331,7 @@ void main()
|
|
|
(pano)=>{
|
|
|
let score = 0;
|
|
|
if(pano.depthTex && checkIntersect){
|
|
|
- let intersect = !!viewer.ifPointBlockedByIntersect(target, pano.id, true); //viewer.inputHandler.ifBlockedByIntersect({pos3d:target, margin:0.1, cameraPos:pano})
|
|
|
+ let intersect = !!viewer.ifPointBlockedByIntersect(target, pano.id, true); //viewer.inputHandler.ifBlockedByIntersect({point:target, margin:0.1, cameraPos:pano})
|
|
|
if(intersect){
|
|
|
score = 0;
|
|
|
}else {
|
|
@@ -121692,8 +121692,8 @@ ENDSEC
|
|
|
|
|
|
|
|
|
switchPanoVisible(pano, v, informBy2d){
|
|
|
- //console.log(pano.id,v)
|
|
|
- pano.circle.visible = v;
|
|
|
+ //console.log(pano.id,v)
|
|
|
+ Potree.Utils.updateVisible(pano.circle , 'panoEditor', v);
|
|
|
Potree.Utils.updateVisible(pano, 'panoEditor', v);
|
|
|
Potree.Utils.updateVisible(pano.pointcloud, 'panoEditor', v);
|
|
|
if(v){
|
|
@@ -152926,13 +152926,13 @@ ENDSEC
|
|
|
|
|
|
|
|
|
|
|
|
- ifPointBlockedByIntersect(pos3d , panoId, soon ){//点是否被遮挡
|
|
|
+ ifPointBlockedByIntersect(point , panoId, soon ){//点是否被遮挡
|
|
|
let ifShelter;
|
|
|
let now = Date.now();
|
|
|
let extraPanoId = panoId != void 0;
|
|
|
if(!this.shelterCount)return
|
|
|
|
|
|
- let history = shelterHistory.find(e=>e.pos3d.equals(pos3d));
|
|
|
+ let history = shelterHistory.find(e=>e.point.equals(point));
|
|
|
let cameraPos = this.mainViewport.view.position.clone();
|
|
|
if(panoId == void 0){
|
|
|
if(this.images360.isAtPano(0.05)){
|
|
@@ -152955,7 +152955,7 @@ ENDSEC
|
|
|
shelterHistory.splice(index, 1);
|
|
|
|
|
|
}else {//新增
|
|
|
- history = {pos3d, panos:{}, notAtPano:{}};
|
|
|
+ history = {point, panos:{}, notAtPano:{}};
|
|
|
|
|
|
const minCount = 100;
|
|
|
if(shelterHistory.length > minCount){//去除最早的
|
|
@@ -152979,21 +152979,21 @@ ENDSEC
|
|
|
if(panoId != void 0){
|
|
|
let pano = this.images360.getPano(panoId);
|
|
|
if((soon || this.shelterCount.byTex<this.shelterCount.maxByTex) && pano.depthTex){
|
|
|
- ifShelter = !!viewer.inputHandler.ifBlockedByIntersect({pos3d, margin:Potree.config.shelterMargin, useDepthTex:true, pano, viewport:this.mainViewport } );
|
|
|
+ ifShelter = !!viewer.inputHandler.ifBlockedByIntersect({point, margin:Potree.config.shelterMargin, useDepthTex:true, pano, viewport:this.mainViewport } );
|
|
|
history.panos[panoId] = ifShelter;
|
|
|
this.shelterCount.byTex ++ ;
|
|
|
- //console.log('computeByTex direct', panoId, pos3d, ifShelter)
|
|
|
+ //console.log('computeByTex direct', panoId, point, ifShelter)
|
|
|
}else {
|
|
|
- //console.log('延迟tex',panoId, pos3d )
|
|
|
+ //console.log('延迟tex',panoId, point )
|
|
|
history.waitCompute = {panoId, forceGet:extraPanoId };
|
|
|
return useLastResult()
|
|
|
}
|
|
|
}else {
|
|
|
if(/* history.ifShelter == void 0 || */ this.shelterCount.byCloud<this.shelterCount.maxByCloud){//弊端:第一个总是直接计算,后面的都是延后。但无法改进,因是一个个传进来的,无法预测。
|
|
|
- ifShelter = !!viewer.inputHandler.ifBlockedByIntersect({pos3d, margin:Potree.config.shelterMargin, pickWindowSize:3} );
|
|
|
+ ifShelter = !!viewer.inputHandler.ifBlockedByIntersect({point, margin:Potree.config.shelterMargin, pickWindowSize:3} );
|
|
|
history.notAtPano = {cameraPos , ifShelter };
|
|
|
this.shelterCount.byCloud ++ ;
|
|
|
- //console.log('computeByCloud direct', pos3d.toArray())
|
|
|
+ //console.log('computeByCloud direct', point.toArray())
|
|
|
}else {
|
|
|
//console.log('延迟cloud' )
|
|
|
history.waitCompute = {cameraPos};
|
|
@@ -153049,11 +153049,11 @@ ENDSEC
|
|
|
if(byTex >= maxTexCount)break
|
|
|
|
|
|
byTex ++;
|
|
|
- let ifShelter = !!viewer.inputHandler.ifBlockedByIntersect({pos3d:history.pos3d, margin:Potree.config.shelterMargin, useDepthTex:true, viewport:this.mainViewport } );
|
|
|
+ let ifShelter = !!viewer.inputHandler.ifBlockedByIntersect({point:history.point, margin:Potree.config.shelterMargin, useDepthTex:true, viewport:this.mainViewport } );
|
|
|
history.panos[this.images360.currentPano.id] = ifShelter;
|
|
|
history.ifShelter = ifShelter;
|
|
|
delete history.waitCompute;
|
|
|
- //console.log('补1', history.pos3d.toArray())
|
|
|
+ //console.log('补1', history.point.toArray())
|
|
|
}else {
|
|
|
if(this.images360.currentPano.pointcloud.hasDepthTex){
|
|
|
//先等待加载完深度图
|
|
@@ -153092,14 +153092,14 @@ ENDSEC
|
|
|
|
|
|
|
|
|
|
|
|
- let list = waitCloud2.map(e=>e.pos3d);
|
|
|
+ let list = waitCloud2.map(e=>e.point);
|
|
|
let result = Common$1.batchHandling.getSlice('shelterByCloud', list, {maxUseCount:maxCloudCount,useEquals:true, stopWhenAllUsed:true} ); //iphonex稳定后大概在7-10。
|
|
|
//list.length>0 && console.log('list',list, maxCloudCount)
|
|
|
|
|
|
result.list.forEach(e=>{
|
|
|
- let history = waitCloud2.find(a=>a.pos3d.equals(e));
|
|
|
+ let history = waitCloud2.find(a=>a.point.equals(e));
|
|
|
|
|
|
- let ifShelter = !!viewer.inputHandler.ifBlockedByIntersect({pos3d:history.pos3d, margin: Potree.config.shelterMargin , pickWindowSize:3, viewport:this.mainViewport} );
|
|
|
+ let ifShelter = !!viewer.inputHandler.ifBlockedByIntersect({point:history.point, margin: Potree.config.shelterMargin , pickWindowSize:3, viewport:this.mainViewport} );
|
|
|
|
|
|
if(history.waitCompute.cameraPos){
|
|
|
history.notAtPano = {cameraPos: history.waitCompute.cameraPos , ifShelter };
|
|
@@ -153108,7 +153108,7 @@ ENDSEC
|
|
|
}
|
|
|
history.ifShelter = ifShelter;
|
|
|
byCloud++;
|
|
|
- //console.log('补2', history.pos3d.toArray())
|
|
|
+ //console.log('补2', history.point.toArray())
|
|
|
delete history.waitCompute;
|
|
|
});
|
|
|
|
|
@@ -156089,12 +156089,12 @@ ENDSEC
|
|
|
|
|
|
if(0 ){//如果没有被选中,会被遮挡。 2023.11.15 最好展示全局(尤其截图时),虽然被遮挡,但focus的过程是选中状态全显示的,可以看出所在范围。
|
|
|
let checkIntersect = ( )=>{
|
|
|
- let intersect = this.inputHandler.ifBlockedByIntersect({pos3d:position, cameraPos: target});// 不一定准确
|
|
|
+ let intersect = this.inputHandler.ifBlockedByIntersect({point:position, cameraPos: target});// 不一定准确
|
|
|
if(intersect){
|
|
|
let blockCount = 0, unblockCount = 0, visi;
|
|
|
for(let i=0;i<object.points.length;i++){ //如果顶点超过一半不可见,就要更改位置
|
|
|
let p = object.points[i];
|
|
|
- let blocked = this.inputHandler.ifBlockedByIntersect({pos3d:p, margin:0.3 , cameraPos:position, pickWindowSize:4});
|
|
|
+ let blocked = this.inputHandler.ifBlockedByIntersect({point:p, margin:0.3 , cameraPos:position, pickWindowSize:4});
|
|
|
if(blocked){
|
|
|
blockCount ++;
|
|
|
if(blockCount / object.points.length >= 0.5){
|
|
@@ -156125,7 +156125,7 @@ ENDSEC
|
|
|
let position1 = position.clone();
|
|
|
let dir = new Vector3().subVectors(position, target);
|
|
|
position.copy(target).sub(dir);
|
|
|
- let intersect2 = this.inputHandler.ifBlockedByIntersect({pos3d: position, cameraPos:target});// 不一定准确
|
|
|
+ let intersect2 = this.inputHandler.ifBlockedByIntersect({point: position, cameraPos:target});// 不一定准确
|
|
|
if(intersect2){
|
|
|
if(intersect2.distance < intersect.distance ){
|
|
|
position.copy(position1);//恢复
|
|
@@ -156237,7 +156237,7 @@ ENDSEC
|
|
|
|
|
|
if(o.checkIntersect){//识别被点云遮住的话
|
|
|
let intersect; //反向查找从target到相机的第一个intersect
|
|
|
- intersect = this.inputHandler.ifBlockedByIntersect({pos3d:position, margin:0, cameraPos:target} /* {pos3d:target, margin: 0.2, cameraPos:position} */);
|
|
|
+ intersect = this.inputHandler.ifBlockedByIntersect({point:position, margin:0, cameraPos:target} /* {point:target, margin: 0.2, cameraPos:position} */);
|
|
|
|
|
|
if(intersect){
|
|
|
position.copy(intersect.location);
|