Merge branch 'Antea-clip-pages' into develop
This commit is contained in:
commit
e5271b859f
@ -340,6 +340,25 @@ Potree.updateVisibility = function(pointclouds, camera, renderer){
|
||||
visible = visible && !(numVisiblePoints + node.getNumPoints() > Potree.pointBudget);
|
||||
visible = visible && level < maxLevel;
|
||||
|
||||
if (pointcloud.material.numClipBoxes > 0 && visible && pointcloud.material.clipMode == Potree.ClipMode.CLIP_OUTSIDE) {
|
||||
let box2 = box.clone();
|
||||
pointcloud.updateMatrixWorld(true);
|
||||
box2.applyMatrix4(pointcloud.matrixWorld);
|
||||
let intersectsClipBoxes = false;
|
||||
for(let clipBox of pointcloud.material.clipBoxes) {
|
||||
let clipMatrixWorld = clipBox.matrix;
|
||||
let clipBoxWorld = new THREE.Box3(
|
||||
new THREE.Vector3(-0.5, -0.5, -0.5),
|
||||
new THREE.Vector3(0.5, 0.5, 0.5))
|
||||
.applyMatrix4(clipMatrixWorld);
|
||||
if (box2.intersectsBox(clipBoxWorld)) {
|
||||
intersectsClipBoxes = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
visible = visible && intersectsClipBoxes;
|
||||
}
|
||||
|
||||
if(node.spacing){
|
||||
lowestSpacing = Math.min(lowestSpacing, node.spacing);
|
||||
}else if(node.geometryNode && node.geometryNode.spacing){
|
||||
|
||||
@ -1449,7 +1449,7 @@ Potree.Viewer = class PotreeViewer extends THREE.EventDispatcher{
|
||||
box.updateMatrixWorld();
|
||||
let boxInverse = new THREE.Matrix4().getInverse(box.matrixWorld);
|
||||
let boxPosition = box.getWorldPosition();
|
||||
return {inverse: boxInverse, position: boxPosition};
|
||||
return {matrix: box.matrixWorld, inverse: boxInverse, position: boxPosition};
|
||||
});
|
||||
|
||||
for(let pointcloud of this.scene.pointclouds){
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user