From 33eeb7b1f9d147bbf3eb3c806100200bc296206d Mon Sep 17 00:00:00 2001 From: mschuetz Date: Wed, 11 Mar 2015 13:03:01 +0100 Subject: [PATCH] support hiding point cloud with pointcloud.visible attribute --- src/PointCloudOctree.js | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/src/PointCloudOctree.js b/src/PointCloudOctree.js index a9c5fa9e..efb8e1bf 100644 --- a/src/PointCloudOctree.js +++ b/src/PointCloudOctree.js @@ -264,6 +264,16 @@ Potree.PointCloudOctree.prototype.updateLoadQueue = function(vn){ } Potree.PointCloudOctree.prototype.update = function(camera, renderer){ + this.visibleGeometry = []; + this.loadQueue = []; + this.visibleNodes = []; + this.numVisibleNodes = 0; + this.numVisiblePoints = 0; + + if(!this.visible){ + return; + } + this.updateMatrixWorld(true); this.visibleGeometry = this.getVisibleGeometry(camera); @@ -282,10 +292,7 @@ Potree.PointCloudOctree.prototype.update = function(camera, renderer){ this.boundingBoxNodes[i].visible = false; } - this.loadQueue = []; - this.visibleNodes = []; - this.numVisibleNodes = 0; - this.numVisiblePoints = 0; +