|
@@ -68,7 +68,7 @@ export class ExtendPointCloudOctree extends PointCloudOctree{
|
|
|
this.nodeMaxLevel = level
|
|
|
//viewer.dispatchEvent({type:'updateNodeMaxLevel', pointcloud: this, nodeMaxLevel:level})
|
|
|
|
|
|
- //console.log('updateNodeMaxLevel ' + this.dataset_id + " : "+ this.nodeMaxLevel)
|
|
|
+ console.log('updateNodeMaxLevel ' + this.dataset_id + " : "+ this.nodeMaxLevel)
|
|
|
|
|
|
this.setPointLevel()//重新计算
|
|
|
|
|
@@ -477,7 +477,7 @@ export class ExtendPointCloudOctree extends PointCloudOctree{
|
|
|
changePointSize(num, sizeFitToLevel) {
|
|
|
|
|
|
if(this.material.pointSizeType != PointSizeType.ATTENUATED){
|
|
|
- return num && (this.material.size = num)
|
|
|
+ return num && (this.material.size = num / Potree.config.material.realPointSize / 1.3)
|
|
|
}
|
|
|
if (num == void 0) {
|
|
|
num = this.temp.pointSize
|
|
@@ -502,10 +502,10 @@ export class ExtendPointCloudOctree extends PointCloudOctree{
|
|
|
this.material.size = value
|
|
|
}else{
|
|
|
|
|
|
- let base = this.material.spacing / Math.pow(2, this.maxLevel) //点云大小在level为0时设置为spacing,每长一级,大小就除以2
|
|
|
+ let base = this.material.spacing / Math.pow(2, this.maxLevel) //点云大小在level为0时设置为spacing,每长一级,大小就除以2. (不同场景还是会有偏差)
|
|
|
base *= this.nodeMaxLevel > 0 ? Math.max(0.1, Math.pow(this.maxLevel / this.nodeMaxLevel, 1.3)) : 0.1 //低质量的缩小点,因为视觉上看太大了。navvis是不铺满的,我们也留一点缝隙
|
|
|
|
|
|
- this.material.size = base * 3 * num/* * window.devicePixelRatio */
|
|
|
+ this.material.size = base * 5 * num/* * window.devicePixelRatio */
|
|
|
//在t-8BCqxQAr93 会议室 和 t-e2Kb2iU 隧道 两个场景里调节,因为它们的spacing相差较大,观察会议室墙壁的龟裂程度
|
|
|
this.temp.sizeFitToLevel[str] = this.material.size
|
|
|
}
|
|
@@ -578,7 +578,19 @@ export class ExtendPointCloudOctree extends PointCloudOctree{
|
|
|
updateBound(){
|
|
|
var boundingBox_ = this.pcoGeometry.tightBoundingBox.clone().applyMatrix4(this.matrixWorld)
|
|
|
this.bound = boundingBox_
|
|
|
+ this.bound2 = this.getBoundWithPanos()
|
|
|
}
|
|
|
+ getBoundWithPanos(){//确保pano在内的bound
|
|
|
+ let bound = this.bound.clone()
|
|
|
+ this.panos.forEach(pano=>{
|
|
|
+ let panoBound = new THREE.Box3
|
|
|
+ panoBound.expandByPoint(pano.position)
|
|
|
+ panoBound.expandByVector(new THREE.Vector3(1,1,1));//give pano a margin
|
|
|
+ bound.union(panoBound)
|
|
|
+ })
|
|
|
+ return bound
|
|
|
+ }
|
|
|
+
|
|
|
getPanosBound(){
|
|
|
if(this.panos.length > 0){
|
|
|
let minSize = new THREE.Vector3(1,1,1)
|