|
@@ -58066,9 +58066,10 @@
|
|
|
var viewport = e.viewport || viewer.mainViewport;
|
|
|
var camera = viewport.camera;
|
|
|
|
|
|
- let hasDepth = this.useDepth/* && camera.isPerspectiveCamera */ &&
|
|
|
- (Potree.settings.pointEnableRT || Potree.settings.displayMode == 'showPanos' || viewer.useEDL);
|
|
|
-
|
|
|
+ //深度图不准确
|
|
|
+ let hasDepth = this.useDepth && Potree.settings.displayMode == 'showPointCloud' &&
|
|
|
+ (Potree.settings.pointEnableRT || viewer.useEDL);
|
|
|
+
|
|
|
this.setRealDepth(hasDepth);
|
|
|
|
|
|
if(hasDepth){
|
|
@@ -71028,9 +71029,14 @@ void main()
|
|
|
var viewport = e.viewport || viewer.mainViewport;
|
|
|
var camera = viewport.camera;
|
|
|
|
|
|
- let hasDepth = this.useDepth /* && camera.isPerspectiveCamera */ &&
|
|
|
- (Potree.settings.pointEnableRT || Potree.settings.displayMode == 'showPanos' || viewer.useEDL);
|
|
|
-
|
|
|
+ /* let hasDepth = this.useDepth &&
|
|
|
+ (Potree.settings.pointEnableRT || Potree.settings.displayMode == 'showPanos' || viewer.useEDL)
|
|
|
+ */
|
|
|
+ //深度图不准确
|
|
|
+ let hasDepth = this.useDepth && Potree.settings.displayMode == 'showPointCloud' &&
|
|
|
+ (Potree.settings.pointEnableRT || viewer.useEDL);
|
|
|
+
|
|
|
+
|
|
|
this.setRealDepth(hasDepth);
|
|
|
|
|
|
if(hasDepth){
|
|
@@ -71059,10 +71065,16 @@ void main()
|
|
|
this.dontFixOrient = options.dontFixOrient;
|
|
|
this.options = options;
|
|
|
this.lineDir = options.lineDir;
|
|
|
+ this.position.y = options.disToLine || 0; //离线距离
|
|
|
+
|
|
|
|
|
|
this.root.matrixAutoUpdate = false;
|
|
|
this.matrixMap = new Map();
|
|
|
this.name = options.name || 'sprite';
|
|
|
+ //if(options.disToLine)console.log('disToLine',this.name)
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
this.useViewport = null;
|
|
|
this.viewports = options.viewports;//指定更新的viewports
|
|
|
this.visible_ = true;
|
|
@@ -71143,6 +71155,13 @@ void main()
|
|
|
return v;
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
update(e={}){
|
|
|
if(!e.viewport){
|
|
|
let viewports = this.viewports || viewer.viewports;
|
|
@@ -71160,72 +71179,127 @@ void main()
|
|
|
//rotation
|
|
|
|
|
|
if(!this.dontFixOrient){ //orthoCamera一般要加dontFixOrient
|
|
|
- let orient2d;
|
|
|
-
|
|
|
- if(this.lineDir){
|
|
|
- this.root.updateMatrix();//先更新,getWorldPosition才能得到正确的
|
|
|
- this.root.updateMatrixWorld(true);
|
|
|
- let center = this.root.getWorldPosition(new Vector3());
|
|
|
- //由于两个端点容易在屏幕外,所以使用center和center加dir
|
|
|
- let lineDir = this.lineDir.clone();
|
|
|
+ let measure = this.root.measure;
|
|
|
+ let lineDir = measure && measure.lineDir && measure.lineDir.clone();
|
|
|
+ let orient2dAngle;
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ if(lineDir){
|
|
|
+ let orient2dInfo = measure.orient2dInfo;
|
|
|
|
|
|
|
|
|
- let r1 = Potree.Utils.getPos2d(center, camera, viewer.renderArea, e.viewport);
|
|
|
- if(!r1.trueSide)return Potree.Utils.updateVisible(this, 'unableCompute', false);// 但这句会使realVisible为false从而无法更新//console.error('!r1.trueSide') //中心点如果在背面直接不渲染了
|
|
|
-
|
|
|
- let r2, point2;
|
|
|
|
|
|
- let p2State = '', len=1, p2StateHistory = [];
|
|
|
- while(p2State != 'got' && p2StateHistory.length<10){
|
|
|
- point2 = center.clone().add(lineDir.multiplyScalar(len));
|
|
|
-
|
|
|
- r2 = Potree.Utils.getPos2d(point2, camera, viewer.renderArea, e.viewport);
|
|
|
- if(!r2.trueSide){ //很少遇到点2在背面的
|
|
|
- if(!p2StateHistory.includes('tooLong-reverse')){
|
|
|
- p2State = 'tooLong-reverse'; //先尝试反向
|
|
|
- len = -len;
|
|
|
+ let getOrient2dAngle = ()=>{
|
|
|
+
|
|
|
+ this.root.updateMatrix();//先更新,getWorldPosition才能得到正确的
|
|
|
+ this.root.updateMatrixWorld(true);
|
|
|
+ let center = this.root.getWorldPosition(new Vector3());
|
|
|
+ //由于两个端点容易在屏幕外,所以使用center和center加dir
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ let r1 = Potree.Utils.getPos2d(center, camera, viewer.renderArea, e.viewport);
|
|
|
+ if(!r1.trueSide)return Potree.Utils.updateVisible(this, 'unableCompute', false);// 但这句会使realVisible为false从而无法更新//console.error('!r1.trueSide') //中心点如果在背面直接不渲染了
|
|
|
+
|
|
|
+ let r2, point2;
|
|
|
+
|
|
|
+ let p2State = '', len=1, p2StateHistory = [];
|
|
|
+ while(p2State != 'got' && p2StateHistory.length<10){
|
|
|
+ point2 = center.clone().add(lineDir.multiplyScalar(len));
|
|
|
+
|
|
|
+ r2 = Potree.Utils.getPos2d(point2, camera, viewer.renderArea, e.viewport);
|
|
|
+ if(!r2.trueSide){ //很少遇到点2在背面的
|
|
|
+ if(!p2StateHistory.includes('tooLong-reverse')){
|
|
|
+ p2State = 'tooLong-reverse'; //先尝试反向
|
|
|
+ len = -len;
|
|
|
+ }else {
|
|
|
+ p2State = 'tooLong';
|
|
|
+ len = len / 2;
|
|
|
+ }
|
|
|
}else {
|
|
|
- p2State = 'tooLong';
|
|
|
- len = len / 2;
|
|
|
- }
|
|
|
- }else {
|
|
|
- let dis = r2.pos.distanceTo(r1.pos);
|
|
|
- if(math.closeTo(dis,0)){
|
|
|
- //console.log('dis == 0')
|
|
|
- Potree.Utils.updateVisible(this, 'unableCompute', false);
|
|
|
- return
|
|
|
- break
|
|
|
+ let dis = r2.pos.distanceTo(r1.pos);
|
|
|
+ if(math.closeTo(dis,0)){
|
|
|
+ //console.log('dis == 0')
|
|
|
+ Potree.Utils.updateVisible(this, 'unableCompute', false);
|
|
|
+ return
|
|
|
+ break
|
|
|
+ }
|
|
|
+ if(dis<10 && !p2StateHistory.includes('tooLong')){//和r1的屏幕距离太近,要加长,否则精度过低
|
|
|
+ p2State = 'tooShort';
|
|
|
+ len = 100/dis * len;
|
|
|
+ }else {
|
|
|
+ p2State = 'got'; break;
|
|
|
+ }
|
|
|
}
|
|
|
- if(dis<10 && !p2StateHistory.includes('tooLong')){//和r1的屏幕距离太近,要加长,否则精度过低
|
|
|
- p2State = 'tooShort';
|
|
|
- len = 100/dis * len;
|
|
|
- }else {
|
|
|
- p2State = 'got'; break;
|
|
|
- }
|
|
|
- }
|
|
|
- p2StateHistory.push(p2State);
|
|
|
+ p2StateHistory.push(p2State);
|
|
|
+ }
|
|
|
+ //console.log(p2StateHistory,len)
|
|
|
+
|
|
|
+ if(!r2.trueSide){
|
|
|
+ return Potree.Utils.updateVisible(this, 'unableCompute', false)//, console.log(' !r2.trueSide', )
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ let orient2dInfo = {};
|
|
|
+ let p1 = r1.pos, p2 = r2.pos;
|
|
|
+ if(p2StateHistory.filter(e=>e == 'tooLong-reverse').length%2 == 1){//反,for marker
|
|
|
+ p2 = r1.pos, p1 = r2.pos;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ let vec = new Vector2().subVectors(p1,p2);
|
|
|
+ orient2dAngle = -vec.angle(); //根据测量线在屏幕上的角度在旋转label,使之和屏幕上的二维线平行。
|
|
|
+ if(p1.x < p2.x){
|
|
|
+ orient2dInfo.reverse = true;
|
|
|
+ }
|
|
|
+
|
|
|
+ //console.log(this.parent.text, THREE.Math.radToDeg(angle), p1.x < p2.x )
|
|
|
+
|
|
|
+ orient2dInfo.orient2dAngle = orient2dAngle;
|
|
|
+ measure.orient2dInfo = orient2dInfo;
|
|
|
+
|
|
|
+ return orient2dInfo
|
|
|
+
|
|
|
+ };
|
|
|
+
|
|
|
+ Potree.Utils.updateVisible(this, 'unableCompute', true);
|
|
|
+
|
|
|
+ if(!orient2dInfo){
|
|
|
+ orient2dInfo = getOrient2dAngle();
|
|
|
}
|
|
|
- //console.log(p2StateHistory,len)
|
|
|
|
|
|
- if(!r2.trueSide){
|
|
|
- return Potree.Utils.updateVisible(this, 'unableCompute', false)//, console.log(' !r2.trueSide', )
|
|
|
+ if(orient2dInfo){
|
|
|
+ orient2dAngle = orient2dInfo.orient2dAngle;
|
|
|
+ if(this.root.name == 'edgeLabel'){
|
|
|
+ if(orient2dInfo.reverse){
|
|
|
+ orient2dAngle += Math.PI; //避免字是倒着的情况
|
|
|
+ }
|
|
|
+ }else if(this.root.name == "measure_point"){ //箭头
|
|
|
+ let index = this.measure.markers.indexOf(this);
|
|
|
+
|
|
|
+ if(index == 1){
|
|
|
+ orient2dAngle -= Math.PI;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }else {
|
|
|
+ Potree.Utils.updateVisible(this, 'unableCompute', false);
|
|
|
}
|
|
|
-
|
|
|
- Potree.Utils.updateVisible(this, 'unableCompute', true);
|
|
|
- let p1 = r1.pos, p2 = r2.pos;
|
|
|
- let vec = new Vector2().subVectors(p1,p2);
|
|
|
- let angle = -vec.angle(); //根据测量线在屏幕上的角度在旋转label,使之和屏幕上的二维线平行。
|
|
|
- if(p1.x < p2.x) angle += Math.PI; //避免字是倒着的情况
|
|
|
-
|
|
|
- orient2d = new Quaternion().setFromAxisAngle(new Vector3(0,0,1), angle);
|
|
|
- //console.log(this.parent.text, THREE.Math.radToDeg(angle), p1.x < p2.x )
|
|
|
- }
|
|
|
-
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
let parentQua = this.root.parent.getWorldQuaternion(new Quaternion);
|
|
|
this.root.quaternion.multiplyQuaternions(parentQua.invert(),camera.quaternion); //乘上parentQua.invert()是为了中和掉父结点的qua,使只剩下camera.quaternion
|
|
|
|
|
|
- if(this.lineDir){
|
|
|
- this.root.quaternion.multiply(orient2d);
|
|
|
+ if(orient2dAngle){
|
|
|
+ let qua = new Quaternion().setFromAxisAngle(new Vector3(0,0,1), orient2dAngle);
|
|
|
+ this.root.quaternion.multiply(qua);
|
|
|
}
|
|
|
|
|
|
}
|
|
@@ -71262,7 +71336,7 @@ void main()
|
|
|
this.root.updateMatrix();
|
|
|
this.root.updateMatrixWorld(true);
|
|
|
this.matrixMap.set(e.viewport, this.root.matrix.clone());
|
|
|
-
|
|
|
+ this.needsUpdate = false;
|
|
|
this.useViewport = e.viewport;
|
|
|
}
|
|
|
|
|
@@ -71339,8 +71413,7 @@ void main()
|
|
|
this.borderRadius = options.borderRadius || 6;
|
|
|
this.margin = options.margin;
|
|
|
if(options.text != void 0)this.setText(options.text);
|
|
|
- this.name = options.name;
|
|
|
-
|
|
|
+ this.name = options.name;
|
|
|
//this.setText(text);
|
|
|
|
|
|
|
|
@@ -75352,7 +75425,7 @@ void main()
|
|
|
color:'#00C8AF',
|
|
|
default:{
|
|
|
color:"#2F8FFF",//"#00c7b2",
|
|
|
- opacity:0.8
|
|
|
+ opacity:0.85
|
|
|
},
|
|
|
highlight:{
|
|
|
color:"#ff8f28",//"#00c7b2", (255, 143, 40, 1
|
|
@@ -75367,7 +75440,7 @@ void main()
|
|
|
|
|
|
lineWidth: 3,
|
|
|
|
|
|
- textColor: "#FFFFFF"
|
|
|
+ textColor: "#000000" //"#FFFFFF"
|
|
|
|
|
|
},
|
|
|
material:{//初始化
|
|
@@ -81832,29 +81905,43 @@ void main()
|
|
|
var lineMats ;
|
|
|
var planeMats;
|
|
|
|
|
|
+
|
|
|
+
|
|
|
const lineDepthInfo = {
|
|
|
- clipDistance : 4,//消失距离
|
|
|
- occlusionDistance: 1,//变为backColor距离
|
|
|
+ clipDistance : 4,//消失距离
|
|
|
+ occlusionDistance: 1,//变为backColor距离
|
|
|
};
|
|
|
- const LabelDepthInfo = {
|
|
|
- clipDistance : 6,//消失距离
|
|
|
- occlusionDistance: 2,//变为backColor距离
|
|
|
+ const planeDepthInfo = {
|
|
|
+ clipDistance : 30,//消失距离
|
|
|
+ occlusionDistance: 4,//变为backColor距离
|
|
|
+ maxOcclusionFactor:0.3,
|
|
|
+ maxClipFactor:0.1
|
|
|
};
|
|
|
- /* const LabelDepthInfo = {
|
|
|
- clipDistance : 0.1,//消失距离
|
|
|
- occlusionDistance: 0.1,//变为backColor距离
|
|
|
- } */
|
|
|
+
|
|
|
+
|
|
|
|
|
|
const markerSizeInfo = {
|
|
|
minSize : 30*2 , maxSize : 65*2, nearBound : 0.2, farBound : 4,
|
|
|
};
|
|
|
const labelSizeInfo = {width2d:190};
|
|
|
const mainLabelProp = {
|
|
|
- backgroundColor: {r: defaultColor$1.r*255, g: defaultColor$1.g*255, b: defaultColor$1.b*255, a:config$1.measure.default.opacity},
|
|
|
+ //backgroundColor: {r: defaultColor.r*255, g: defaultColor.g*255, b: defaultColor.b*255, a:config.measure.default.opacity},
|
|
|
+ backgroundColor: {r: 0, g: 0, b: 0, a:0},
|
|
|
textColor: {r: textColor.r*255, g: textColor.g*255, b: textColor.b*255, a: 1.0},
|
|
|
+ textBorderColor: {r:255, g: 255, b:255, a: 1.0},
|
|
|
+ textBorderThick:3,
|
|
|
fontsize: 14,
|
|
|
- useDepth : true , borderRadius : 12, margin:{x:20,y:4},
|
|
|
+ borderRadius : 12, margin:{x:20,y:4},
|
|
|
renderOrder : 5, pickOrder:5,
|
|
|
+ disToLine:-0.15,
|
|
|
+
|
|
|
+ useDepth : true ,
|
|
|
+ // 2023.10 尽量不让数字被挡住
|
|
|
+ clipDistance : 50,//消失距离
|
|
|
+ occlusionDistance: 10,//变为backColor距离
|
|
|
+ maxOcclusionFactor:0.2,
|
|
|
+ maxClipFactor:0.1
|
|
|
+
|
|
|
};
|
|
|
|
|
|
|
|
@@ -81863,7 +81950,7 @@ void main()
|
|
|
backgroundColor: {r: 255, g: 255, b: 255, a:config$1.measure.default.opacity},
|
|
|
textColor: {r: 0.3, g: 0.3, b:0.3, a: 1.0},
|
|
|
fontsize:12, borderRadius : 12, margin:{x:20,y:4},
|
|
|
- renderOrder : 4, pickOrder:4,
|
|
|
+ renderOrder : 4, pickOrder:4,
|
|
|
};
|
|
|
|
|
|
|
|
@@ -82073,15 +82160,19 @@ void main()
|
|
|
if(this.showDistances || this.labelText){ // edge labels
|
|
|
let edgeLabel = this.edgeLabels[index];
|
|
|
let distance = this.labelText || point.distanceTo(nextPoint);
|
|
|
- edgeLabel.shouldVisi = this.labelText || (index < lastIndex || this.isRect || this.closed && !this.isNew ) && distance>0;
|
|
|
+ edgeLabel.shouldVisi = (this.labelText || distance>0) && (index < lastIndex || this.isRect || this.closed && !this.isNew );
|
|
|
/* this.closed || */edgeLabel.setVisible(edgeLabel.shouldVisi);
|
|
|
- edgeLabel.sprite.lineDir = new Vector3().subVectors(point,nextPoint).normalize(); //[point,nextPoint]
|
|
|
- if(edgeLabel.visible){
|
|
|
+ if(edgeLabel.shouldVisi){
|
|
|
+ this.lineDir = new Vector3().subVectors(point,nextPoint).normalize(); //[point,nextPoint]
|
|
|
+
|
|
|
setEdgeLabel(edgeLabel,point,nextPoint,distance);
|
|
|
- }
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
}
|
|
|
- }
|
|
|
-
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
if(this.measureType == 'Distance' && this.points.length>1){//设置水平垂直辅助线
|
|
|
var pTop, pBtm;
|
|
|
if(this.points[0].z > this.points[1].z ){
|
|
@@ -82124,9 +82215,7 @@ void main()
|
|
|
this.areaLabel.setText(msg);
|
|
|
this.areaLabel.setVisible(true);
|
|
|
//}
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
+ }
|
|
|
|
|
|
};
|
|
|
|
|
@@ -82134,21 +82223,33 @@ void main()
|
|
|
|
|
|
setEdgeLabelPos(label,p1,p2){ //调整label的位置,使倾斜后看起来在线的中心,而不要挡住端点
|
|
|
let center = new Vector3().addVectors(p1,p2).multiplyScalar(0.5);
|
|
|
-
|
|
|
- if(!label.sprite.lineDir || viewer.mainViewport.camera.type == 'OrthographicCamera'){
|
|
|
- label.setPos(center);
|
|
|
- }else {
|
|
|
- let eyePos = viewer.mainViewport.camera.position;
|
|
|
- let dir = viewer.mainViewport.view.direction; //new THREE.Vector3().subVectors(center,eyePos).normalize()
|
|
|
- let vec = label.sprite.lineDir;
|
|
|
- let cos = dir.dot(vec);
|
|
|
-
|
|
|
- let efficiency = 0.35; // 0-1 数值越高,r越容易接近1或-1,label越容易在倾斜后靠近近端点。
|
|
|
- let r = 0.5*efficiency*cos + 0.5;
|
|
|
- //console.log(r, cos )
|
|
|
- center = p1.clone().multiplyScalar(1-r).add(p2.clone().multiplyScalar(r)); //label在线上滑动,使尽量保持在视觉中心
|
|
|
- label.setPos(center);
|
|
|
- }
|
|
|
+
|
|
|
+ if(this.lineDir){
|
|
|
+ if(viewer.mainViewport.camera.type == 'OrthographicCamera'){
|
|
|
+ label.setPos(center);
|
|
|
+ }else {
|
|
|
+ let eyePos = viewer.mainViewport.camera.position;
|
|
|
+ let dir = viewer.mainViewport.view.direction; //new THREE.Vector3().subVectors(center,eyePos).normalize()
|
|
|
+ //let vec = label.sprite.lineDir
|
|
|
+ let cos = dir.dot(this.lineDir);
|
|
|
+
|
|
|
+ let efficiency = 0.35; // 0-1 数值越高,r越容易接近1或-1,label越容易在倾斜后靠近近端点。
|
|
|
+ let r = 0.5*efficiency*cos + 0.5;
|
|
|
+
|
|
|
+ center = p1.clone().multiplyScalar(1-r).add(p2.clone().multiplyScalar(r)); //label在线上滑动,使尽量保持在视觉中心
|
|
|
+ label.setPos(center);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ //归零
|
|
|
+ this.orient2dInfo = null;
|
|
|
+ this.markers.forEach(e=>e.needsUpdate=true);
|
|
|
+ }else {
|
|
|
+
|
|
|
+ label.setPos(center);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
}
|
|
|
|
|
|
|
|
@@ -82165,7 +82266,7 @@ void main()
|
|
|
marker.addEventListener('drop',(e)=>{
|
|
|
viewer.inputHandler.dispatchEvent({type: 'isMeasuring', v:false, cause:'stopDragging'} );
|
|
|
});
|
|
|
-
|
|
|
+ marker.measure = this;
|
|
|
let edge;
|
|
|
{ // edges
|
|
|
edge = LineDraw.createFatLine( [ ],{material:this.getLineMat('edgeDefault')} );
|
|
@@ -82191,6 +82292,7 @@ void main()
|
|
|
|
|
|
if(this.showEdges){ // edge labels
|
|
|
const edgeLabel = this.createEdgeLabel('edgeLabel', !this.closed);
|
|
|
+ edgeLabel.measure = this;
|
|
|
this.edgeLabels.push(edgeLabel);
|
|
|
|
|
|
}
|
|
@@ -82349,15 +82451,18 @@ void main()
|
|
|
|
|
|
setLabelHightState(label, state){
|
|
|
if(state){
|
|
|
- let color = new Color(Potree.config.measure.highlight.color);
|
|
|
- label.backgroundColor = {r:255*color.r, g:255*color.g, b:255*color.b, a:config$1.measure.highlight.opacity},
|
|
|
+ let color = new Color(Potree.config.measure.highlight.color);
|
|
|
+ //label.sprite.material.opacity = config.measure.highlight.opacity
|
|
|
+
|
|
|
+ //label.backgroundColor = {r:255*color.r, g:255*color.g, b:255*color.b, a:config.measure.highlight.opacity},
|
|
|
//label.backgroundColor.a = config.measure.highlight.opacity
|
|
|
label.sprite.material.useDepth = false;
|
|
|
//label.textColor = {r: this.color.r*255, g: this.color.g*255, b: this.color.b*255, a: 1}
|
|
|
}else {
|
|
|
- label.backgroundColor = {r: this.color.r*255, g: this.color.g*255, b: this.color.b*255, a:config$1.measure.default.opacity};
|
|
|
+ //label.backgroundColor = {r: this.color.r*255, g: this.color.g*255, b: this.color.b*255, a:config.measure.default.opacity}
|
|
|
//label.backgroundColor.a = config.measure.default.opacity
|
|
|
label.sprite.material.useDepth = true;
|
|
|
+ //label.sprite.material.opacity = 0.98
|
|
|
//label.textColor = {r: 255, g: 255, b: 255, a: 1}
|
|
|
|
|
|
}
|
|
@@ -82544,7 +82649,7 @@ void main()
|
|
|
|
|
|
createEdgeLabel(name, hasHoverEvent){
|
|
|
|
|
|
- mainLabelProp.backgroundColor = {r: this.color.r*255, g: this.color.g*255, b: this.color.b*255, a:config$1.measure.default.opacity};
|
|
|
+ //mainLabelProp.backgroundColor = {r: this.color.r*255, g: this.color.g*255, b: this.color.b*255, a:config.measure.default.opacity}
|
|
|
|
|
|
|
|
|
const edgeLabel = new TextSprite$2(
|
|
@@ -82563,9 +82668,13 @@ void main()
|
|
|
edgeLabel.addEventListener('click',()=>{
|
|
|
if(!this.isNew) this.focus();
|
|
|
});
|
|
|
+ //edgeLabel.sprite.material.opacity = config.measure.default.opacity
|
|
|
}
|
|
|
edgeLabel.visible = false;
|
|
|
edgeLabel.sprite.material.depthTestWhenPick = true;
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
Potree.Utils.setObjectLayers(edgeLabel, 'measure' );
|
|
|
this.add(edgeLabel);
|
|
|
return edgeLabel
|
|
@@ -82613,7 +82722,8 @@ void main()
|
|
|
markerMats['default' + color] = new DepthBasicMaterial($.extend({},lineDepthInfo,{
|
|
|
transparent: !0,
|
|
|
opacity: 1,
|
|
|
- map: texLoader$2.load(Potree.resourcePath+'/textures/pic_point_s32.png' ),
|
|
|
+ //map: texLoader.load(Potree.resourcePath+'/textures/pic_point_s32.png' ),
|
|
|
+ map: texLoader$2.load(Potree.resourcePath+'/textures/arrows_l_32.png' ),
|
|
|
useDepth:true,
|
|
|
replaceColor:this.color,
|
|
|
beReplacedRed: 0.184, //0.18431372
|
|
@@ -82622,7 +82732,7 @@ void main()
|
|
|
markerMats['select' + color] = new DepthBasicMaterial($.extend({},lineDepthInfo,{
|
|
|
transparent: !0,
|
|
|
opacity: 1,
|
|
|
- map: texLoader$2.load(Potree.resourcePath+'/textures/pic_point32.png' ),
|
|
|
+ map: texLoader$2.load(Potree.resourcePath+'/textures/arrows_l_32.png' ),
|
|
|
//useDepth:true ,
|
|
|
replaceColor: new Color(Potree.config.measure.highlight.color) ,
|
|
|
beReplacedRed: 0.184, //0.18431372
|
|
@@ -82653,7 +82763,7 @@ void main()
|
|
|
|
|
|
let color = this.color.getHexString();
|
|
|
if(!lineMats['edgeDefault'+color]){
|
|
|
- lineMats['edgeDefault'+color] = LineDraw.createFatLineMat({
|
|
|
+ lineMats['edgeDefault'+color] = LineDraw.createFatLineMat(Object.assign({}, lineDepthInfo, {
|
|
|
color: this.color,
|
|
|
lineWidth: config$1.measure.lineWidth,
|
|
|
useDepth :true,
|
|
@@ -82664,15 +82774,15 @@ void main()
|
|
|
transparent: true,
|
|
|
opacity: config$1.measure.default.opacity,
|
|
|
depthTestWhenPick:true,
|
|
|
- });
|
|
|
- lineMats['edgeSelect'+color] = LineDraw.createFatLineMat({
|
|
|
+ }));
|
|
|
+ lineMats['edgeSelect'+color] = LineDraw.createFatLineMat(Object.assign({}, lineDepthInfo,{
|
|
|
color: Potree.config.measure.highlight.color ,
|
|
|
dashSize: 0.5,
|
|
|
gapSize: 0.2,
|
|
|
lineWidth: config$1.measure.lineWidth ,
|
|
|
transparent: true,
|
|
|
opacity: config$1.measure.highlight.opacity
|
|
|
- });
|
|
|
+ }));
|
|
|
}
|
|
|
|
|
|
|
|
@@ -82688,7 +82798,7 @@ void main()
|
|
|
|
|
|
createAreaPlane(){
|
|
|
planeMats || (planeMats = {
|
|
|
- default: new DepthBasicMaterial( $.extend({},LabelDepthInfo,{
|
|
|
+ default: new DepthBasicMaterial( $.extend({},planeDepthInfo,{
|
|
|
color:color,
|
|
|
side:DoubleSide,
|
|
|
opacity:0.2,
|
|
@@ -83411,6 +83521,8 @@ void main()
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+
|
|
|
});
|
|
|
|
|
|
|
|
@@ -88510,9 +88622,14 @@ void main()
|
|
|
|
|
|
const viewer = this.viewer;
|
|
|
let camera = params.camera ? params.camera : viewer.scene.getActiveCamera();
|
|
|
- let rtEDL = (Potree.settings.pointEnableRT || Potree.settings.displayMode == 'showPanos' || viewer.useEDL) &&
|
|
|
- Features.EXT_DEPTH.isSupported() /* && camera.type != "OrthographicCamera" */&& !params.dontRenderRtEDL && (params.rtEDL || this.getRtEDL(params.viewport)); // 平面相机不用depthTex直接打开depthTest?且不使用edl
|
|
|
- let useEDL = viewer.useEDL && rtEDL && Potree.settings.displayMode != 'showPanos';
|
|
|
+ /* let rtEDL = (Potree.settings.pointEnableRT || Potree.settings.displayMode == 'showPanos' || viewer.useEDL) &&
|
|
|
+ Features.EXT_DEPTH.isSupported() && !params.dontRenderRtEDL && (params.rtEDL || this.getRtEDL(params.viewport)) // 平面相机不用depthTex直接打开depthTest?且不使用edl
|
|
|
+ */
|
|
|
+ let rtEDL = (Potree.settings.pointEnableRT || viewer.useEDL) && Potree.settings.displayMode == 'showPointCloud'
|
|
|
+ && Features.EXT_DEPTH.isSupported() /* && camera.type != "OrthographicCamera" */&& !params.dontRenderRtEDL && (params.rtEDL || this.getRtEDL(params.viewport)); // 平面相机不用depthTex直接打开depthTest?且不使用edl
|
|
|
+
|
|
|
+
|
|
|
+ let useEDL = viewer.useEDL && rtEDL && Potree.settings.displayMode != 'showPanos';
|
|
|
|
|
|
let target = params.target || null;
|
|
|
|
|
@@ -90413,7 +90530,7 @@ void main()
|
|
|
let material = e.object.material;
|
|
|
|
|
|
return e.object.pickDontCheckDis || ( material.depthTest == false || material.depthWrite == false) && !material.realUseDepth //!material.depthTestWhenPick
|
|
|
- || ( material.useDepth ? e.distance < this.intersect.distance + material.uniforms.occlusionDistance.value : e.distance < this.intersect.distance )
|
|
|
+ || ( material.useDepth ? e.distance < this.intersect.distance + material.uniforms.clipDistance.value : e.distance < this.intersect.distance )
|
|
|
});
|
|
|
}
|
|
|
|
|
@@ -95837,41 +95954,41 @@ ENDSEC
|
|
|
this.pano0 = pano0;
|
|
|
this.pano1 = pano1;
|
|
|
|
|
|
- this.updateDepthTex(pano0);
|
|
|
- this.updateDepthTex(pano1);
|
|
|
-
|
|
|
+ /* this.updateDepthTex(pano0)
|
|
|
+ this.updateDepthTex(pano1)
|
|
|
+ */
|
|
|
|
|
|
//console.log('setProjectedPanos', pano0&&pano0.id, pano1&&pano1.id)
|
|
|
this.needsUpdate = true;
|
|
|
}
|
|
|
|
|
|
+ //深度图不准
|
|
|
|
|
|
-
|
|
|
- updateDepthTex(pano, extra){
|
|
|
+ /* updateDepthTex(pano, extra){
|
|
|
if( !Potree.settings.useDepthTex || !pano || !pano.depthTex || pano!=this.pano0 && pano!=this.pano1)return
|
|
|
//console.log('updateDepthTex', pano.id, this.pano0 && this.pano0.id, this.pano1 && this.pano1.id)
|
|
|
|
|
|
|
|
|
if(this.pano0){
|
|
|
this.uniforms.depthMap0.value = this.pano0.entered ? this.pano0.depthTex : null; //dispose了就不要赋值否则dispose会失败
|
|
|
- this.uniforms.cameraHeight0.value = this.pano0.floorPosition.distanceTo(this.pano0.position);
|
|
|
- this.uniforms.ceilHeight0.value = this.pano0.getCeilHeight() - this.pano0.position.z;
|
|
|
+ this.uniforms.cameraHeight0.value = this.pano0.floorPosition.distanceTo(this.pano0.position)
|
|
|
+ this.uniforms.ceilHeight0.value = this.pano0.getCeilHeight() - this.pano0.position.z
|
|
|
}
|
|
|
if(this.pano1){
|
|
|
- this.uniforms.depthMap1.value = this.pano1.depthTex;
|
|
|
- this.uniforms.cameraHeight1.value = this.pano1.floorPosition.distanceTo(this.pano1.position);
|
|
|
- this.uniforms.ceilHeight1.value = this.pano1.getCeilHeight() - this.pano1.position.z;
|
|
|
+ this.uniforms.depthMap1.value = this.pano1.depthTex
|
|
|
+ this.uniforms.cameraHeight1.value = this.pano1.floorPosition.distanceTo(this.pano1.position)
|
|
|
+ this.uniforms.ceilHeight1.value = this.pano1.getCeilHeight() - this.pano1.position.z
|
|
|
}
|
|
|
- this.updateDepthTexEnable();
|
|
|
- }
|
|
|
+ this.updateDepthTexEnable()
|
|
|
+ }
|
|
|
|
|
|
updateDepthTexEnable(){
|
|
|
- let hasDepthTex = this.pano0 && this.pano1 && this.pano0.pointcloud.hasDepthTex && this.pano1.pointcloud.hasDepthTex; //暂时不知道一个有图一个没图怎么写所以
|
|
|
+ let hasDepthTex = this.pano0 && this.pano1 && this.pano0.pointcloud.hasDepthTex && this.pano1.pointcloud.hasDepthTex //暂时不知道一个有图一个没图怎么写所以
|
|
|
|
|
|
- Potree.Utils.addOrRemoveDefine(this, 'hasDepthTex', hasDepthTex?'add':'remove' );
|
|
|
+ Potree.Utils.addOrRemoveDefine(this, 'hasDepthTex', hasDepthTex?'add':'remove' )
|
|
|
|
|
|
|
|
|
- }
|
|
|
+ }*/
|
|
|
|
|
|
/* EnableDepthTex(){//开启DepthTex
|
|
|
if(this.defines['hasDepthTex']){
|
|
@@ -97420,7 +97537,7 @@ ENDSEC
|
|
|
}
|
|
|
done(true);
|
|
|
|
|
|
- this.updateDepthTex(this.currentPano);
|
|
|
+ //this.updateDepthTex(this.currentPano)
|
|
|
this.updateProjectedPanos();//dispose
|
|
|
|
|
|
|