History

first cut at user adjustable LOD

ZappoMan committed 13 years ago

Commit fbc3a4d1 parent 2931e2e14 files · +133 −72Browse files

Showing the changes to interface/src/VoxelSystem.cpp (1 of 14 files). Show all

Unified · Split

interface/src/VoxelSystem.cpp+9−5
@@ -139,7 +139,8 @@ void VoxelSystem::voxelUpdated(VoxelNode* node) { · 138 unmodified lines
139139 if (node->getVoxelSystem() == this) {
140140 bool shouldRender = false; // assume we don't need to render it
141141 // if it's colored, we might need to render it!
142− shouldRender = node->calculateShouldRender(_viewFrustum);
142+ float voxelSizeScale = DEFAULT_VOXEL_SIZE_SCALE;
143+ shouldRender = node->calculateShouldRender(_viewFrustum, voxelSizeScale);
143144
144145 if (node->getShouldRender() != shouldRender) {
145146 node->setShouldRender(shouldRender);
@@ -155,7 +156,7 @@ void VoxelSystem::voxelUpdated(VoxelNode* node) { · 9 unmodified lines
155156 VoxelNode* childNode = node->getChildAtIndex(i);
156157 if (childNode) {
157158 bool wasShouldRender = childNode->getShouldRender();
158− bool isShouldRender = childNode->calculateShouldRender(_viewFrustum);
159+ bool isShouldRender = childNode->calculateShouldRender(_viewFrustum, voxelSizeScale);
159160 if (wasShouldRender && !isShouldRender) {
160161 childrenGotHiddenCount++;
161162 }
@@ -923,7 +924,8 @@ int VoxelSystem::newTreeToArrays(VoxelNode* node) { · 761 unmodified lines
923924 int voxelsUpdated = 0;
924925 bool shouldRender = false; // assume we don't need to render it
925926 // if it's colored, we might need to render it!
926− shouldRender = node->calculateShouldRender(_viewFrustum);
927+ float voxelSizeScale = DEFAULT_VOXEL_SIZE_SCALE;
928+ shouldRender = node->calculateShouldRender(_viewFrustum, voxelSizeScale);
927929
928930 node->setShouldRender(shouldRender);
929931 // let children figure out their renderness
@@ -1771,7 +1773,8 @@ bool VoxelSystem::showAllLocalVoxelsOperation(VoxelNode* node, void* extraData) · 841 unmodified lines
17711773
17721774 args->nodesScanned++;
17731775
1774− bool shouldRender = true; // node->calculateShouldRender(&args->thisViewFrustum);
1776+ float voxelSizeScale = DEFAULT_VOXEL_SIZE_SCALE;
1777+ bool shouldRender = node->calculateShouldRender(&args->thisViewFrustum, voxelSizeScale);
17751778 node->setShouldRender(shouldRender);
17761779
17771780 if (shouldRender) {
@@ -1947,7 +1950,8 @@ bool VoxelSystem::showAllSubTreeOperation(VoxelNode* node, void* extraData) { · 169 unmodified lines
19471950
19481951 args->nodesInside++;
19491952
1950− bool shouldRender = node->calculateShouldRender(&args->thisViewFrustum);
1953+ float voxelSizeScale = DEFAULT_VOXEL_SIZE_SCALE;
1954+ bool shouldRender = node->calculateShouldRender(&args->thisViewFrustum, voxelSizeScale);
19511955 node->setShouldRender(shouldRender);
19521956
19531957 if (shouldRender && !node->isKnownBufferIndex()) {