|
@@ -198,7 +198,7 @@ export class ExtendPointCloudOctree extends PointCloudOctree{
|
|
|
material.resolution = resolution
|
|
|
|
|
|
|
|
|
- //material.spacing = this.pcoGeometry.spacing; // * Math.max(this.scale.x, this.scale.y, this.scale.z); //应该不需要
|
|
|
+ material.spacing = this.pcoGeometry.spacing; // * Math.max(this.scale.x, this.scale.y, this.scale.z); //应该不需要
|
|
|
material.near = camera.near;
|
|
|
material.far = camera.far;
|
|
|
material.uniforms.octreeSize.value = this.pcoGeometry.boundingBox.getSize(new THREE.Vector3()).x;
|
|
@@ -213,7 +213,7 @@ export class ExtendPointCloudOctree extends PointCloudOctree{
|
|
|
|
|
|
let getVal = (a, b) => a != void 0 ? a : b;
|
|
|
|
|
|
-
|
|
|
+
|
|
|
|
|
|
let pickWindowSize_ = THREE.Math.clamp( Math.round((1.1-this.maxLevel/this.nodeMaxLevel)*80), 5, 100)
|
|
|
let pickWindowSize = getVal(params.pickWindowSize, pickWindowSize_ ); /* 65 */ //拾取像素边长,越小越精准,但点云稀疏的话可能容易出现识别不到的情况。 另外左下侧会有缝隙无法识别到,缝隙大小和这个值有关//突然发现pickWindowSize在一百以内的变化对pick费时影响甚微,1和100差1毫秒不到,但400时会多4毫秒
|
|
@@ -233,12 +233,10 @@ export class ExtendPointCloudOctree extends PointCloudOctree{
|
|
|
window.testScreen = 0
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
+
|
|
|
let pointSizeType = getVal(params.pointSizeType, this.material.pointSizeType);
|
|
|
let pointSize = getVal(params.pointSize, this.material.size);
|
|
|
-
|
|
|
+
|
|
|
let nodes = this.nodesOnRay(this.visibleNodes, ray);
|
|
|
|
|
|
if (nodes.length === 0) {
|
|
@@ -271,8 +269,8 @@ export class ExtendPointCloudOctree extends PointCloudOctree{
|
|
|
|
|
|
{ // update pick material
|
|
|
pickMaterial.pointSizeType = pointSizeType;
|
|
|
- //pickMaterial.shape = this.material.shape;
|
|
|
- pickMaterial.shape = Potree.PointShape.PARABOLOID;
|
|
|
+ pickMaterial.shape = this.material.shape;
|
|
|
+ // pickMaterial.shape = Potree.PointShape.PARABOLOID;
|
|
|
|
|
|
pickMaterial.uniforms.uFilterReturnNumberRange.value = this.material.uniforms.uFilterReturnNumberRange.value;
|
|
|
pickMaterial.uniforms.uFilterNumberOfReturnsRange.value = this.material.uniforms.uFilterNumberOfReturnsRange.value;
|
|
@@ -286,7 +284,9 @@ export class ExtendPointCloudOctree extends PointCloudOctree{
|
|
|
pickMaterial.uniforms.maxSize.value = this.material.uniforms.maxSize.value;
|
|
|
pickMaterial.classification = this.material.classification;
|
|
|
pickMaterial.recomputeClassification();
|
|
|
-
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
//pickClipped判断转移到上一层函数
|
|
|
let {bigClipInBox,clipBoxes_in,clipBoxes_out} = this.material
|
|
|
pickMaterial.setClipBoxes(bigClipInBox, clipBoxes_in, clipBoxes_out, [])
|
|
@@ -304,7 +304,7 @@ export class ExtendPointCloudOctree extends PointCloudOctree{
|
|
|
parseInt(pixelPos.x - (pickWindowSize - 1) / 2),
|
|
|
parseInt(pixelPos.y - (pickWindowSize - 1) / 2),
|
|
|
parseInt(pickWindowSize), parseInt(pickWindowSize));
|
|
|
-
|
|
|
+
|
|
|
|
|
|
renderer.state.buffers.depth.setTest(pickMaterial.depthTest);
|
|
|
renderer.state.buffers.depth.setMask(pickMaterial.depthWrite);
|
|
@@ -346,7 +346,7 @@ export class ExtendPointCloudOctree extends PointCloudOctree{
|
|
|
|
|
|
let pixels = buffer;
|
|
|
let ibuffer = new Uint32Array(buffer.buffer); //四个数整合成一个
|
|
|
-
|
|
|
+console.log(pixels.join(','))
|
|
|
// find closest hit inside pixelWindow boundaries
|
|
|
let min = Number.MAX_VALUE;
|
|
|
let hits = [], hits2 = [], rSquare;
|