Skip to content

Commit

Permalink
fix(pointcloud): remove unused variable
Browse files Browse the repository at this point in the history
This commit fixes a left-over from #719
  • Loading branch information
peppsac authored and zarov committed Apr 16, 2018
1 parent 19ae01c commit e0d839d
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 14 deletions.
4 changes: 1 addition & 3 deletions examples/pointcloud.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,7 @@ function showPointcloud(serverUrl, fileName, lopocsTable) {
var info = document.getElementById('info');
oldPostUpdate.apply(pointcloud, arguments);
info.textContent = 'Nb points: ' +
pointcloud.counters.displayedCount.toLocaleString() + ' (' +
Math.floor(100 * pointcloud.counters.displayedCount / pointcloud.counters.pointCount) + '%) (' +
view.mainLoop.gfxEngine.renderer.info.memory.geometries + ')';
pointcloud.displayedCount.toLocaleString();
};
window.view = view;
}
Expand Down
4 changes: 1 addition & 3 deletions examples/pointcloud_globe.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,7 @@ function showPointcloud(serverUrl, fileName) {
var info = document.getElementById('info');
oldPostUpdate.apply(pointcloud, arguments);
info.textContent = 'Nb points: ' +
pointcloud.counters.displayedCount.toLocaleString() + ' (' +
Math.floor(100 * pointcloud.counters.displayedCount / pointcloud.counters.pointCount) + '%) (' +
view.mainLoop.gfxEngine.renderer.info.memory.geometries + ')';
pointcloud.displayedCount.toLocaleString();
};
window.view = view;
}
Expand Down
12 changes: 5 additions & 7 deletions src/Process/PointCloudProcessing.js
Original file line number Diff line number Diff line change
Expand Up @@ -291,22 +291,20 @@ export default {
return;
}

layer.counters = {
displayedCount: 0,
};
layer.displayedCount = 0;
for (const pts of layer.group.children) {
layer.counters.displayedCount += pts.geometry.drawRange.count;
layer.displayedCount += pts.geometry.drawRange.count;
}

if (layer.counters.displayedCount > layer.pointBudget) {
const reduction = layer.pointBudget / layer.counters.displayedCount;
if (layer.displayedCount > layer.pointBudget) {
const reduction = layer.pointBudget / layer.displayedCount;
for (const pts of layer.group.children) {
if (pts.material.visible) {
const count = Math.max(1.0, Math.floor(pts.geometry.drawRange.count * reduction));
pts.geometry.setDrawRange(0, count);
}
}
layer.counters.displayedCount *= reduction;
layer.displayedCount *= reduction;
}

const now = Date.now();
Expand Down
2 changes: 1 addition & 1 deletion utils/debug/PointCloudDebug.js
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ export default {
elt.obj.material.visible = layer.dbgDisplayParents;

if (v && !elt.obj.material.visible) {
layer.counters.displayedCount -= elt.obj.geometry.drawRange.count;
layer.displayedCount -= elt.obj.geometry.drawRange.count;
}
}
}
Expand Down

0 comments on commit e0d839d

Please sign in to comment.