[Pointcloud] Add per-node priority update in pointclouds#2654
[Pointcloud] Add per-node priority update in pointclouds#2654Desplandis wants to merge 1 commit intoiTowns:masterfrom
Conversation
0fb1469 to
a6ea0ef
Compare
| root.voxelOBB.quaternion.copy(rotation).invert(); | ||
|
|
||
| root.voxelOBB.updateMatrix(); | ||
| // Update matrixWorld since OBB is not part of scene hierarchy |
There was a problem hiding this comment.
It is has there is this line
this.object3d.add(this.root.clampOBB);
this.root.clampOBB.updateMatrixWorld(true);
In all PointCloudLayer after we call setOBBes(). So I decided not to call it 2 times...
3d0d6ea to
6e614f9
Compare
6e614f9 to
a9ac7fe
Compare
| const min = this.box3D.min; | ||
| const max = this.box3D.max; | ||
|
|
||
| const center = new THREE.Vector3() | ||
| .addVectors(min, max) | ||
| .multiplyScalar(0.5); |
There was a problem hiding this comment.
const center = new THREE.Vector3();
this.box3D.getCenter(center);
| .addVectors(min, max) | ||
| .multiplyScalar(0.5); | ||
|
|
||
| const extents = new THREE.Vector3() |
There was a problem hiding this comment.
Is this really an extents ? I feel like it's more the halfed size of the Box3 then:
const size = new THREE.Vector3();
const halfSize = this.box3D.getSize(size).multiplyScalar(0.5);
| // Get bounding sphere from the OBB's box3D | ||
| const box3 = object.box3D; | ||
| const sphere = new THREE.Sphere(); | ||
| box3.getBoundingSphere(sphere); |
There was a problem hiding this comment.
Why using the sphere of the cubique OBB ? there is a clampOBB closer to the data...
| return true; | ||
| } | ||
|
|
||
| getBoundingSphere(sphere: THREE.Sphere = new THREE.Sphere()): THREE.Sphere { |
There was a problem hiding this comment.
I don't see where you use it. Is it just for having it available ?
| } | ||
|
|
||
| node.link[layer.id] = helper; | ||
| layer.addEventListener('tile-visibility-change', (event) => { |
There was a problem hiding this comment.
I would say that it's not a bad idea to remove the layer and use event, But I think it should be done in antoher PR and done for the other debuger as well...
|
@Desplandis The checks have not all passed... |
Description
This PR introduces a priority-based update mechanism for point cloud layers.
Before this PR, the update logic traversed the tree in a depth-first fashion, issued requests during traversal, and only afterward limited the number of point clouds rendered. This often resulted in unnecessary requests and complex update logic.
The new approach uses a priority queue (à la potree) to traverse only the most relevant nodes, sorted by their screen-space size.
Depends #2685.
Blocked by issue #2694 .
Benefits:
Motivation and Context