Showing the changes to interface/src/VoxelSystem.cpp (1 of 9 files). Show all
Unified · Split
| @@ -701,7 +701,7 @@ void VoxelSystem::killLocalVoxels() { · 700 unmodified lines | ||
| 701 | 701 | } |
| 702 | 702 | |
| 703 | 703 | |
| 704 | −bool VoxelSystem::randomColorOperation(VoxelNode* node, void* extraData) { | |
| 704 | +bool VoxelSystem::randomColorOperation(VoxelNode* node, int level, void* extraData) { | |
| 705 | 705 | _nodeCount++; |
| 706 | 706 | if (node->isColored()) { |
| 707 | 707 | nodeColor newColor = { 255, randomColorValue(150), randomColorValue(150), 1 }; |
| @@ -717,7 +717,7 @@ void VoxelSystem::randomizeVoxelColors() { · 9 unmodified lines | ||
| 717 | 717 | setupNewVoxelsForDrawing(); |
| 718 | 718 | } |
| 719 | 719 | |
| 720 | −bool VoxelSystem::falseColorizeRandomOperation(VoxelNode* node, void* extraData) { | |
| 720 | +bool VoxelSystem::falseColorizeRandomOperation(VoxelNode* node, int level, void* extraData) { | |
| 721 | 721 | _nodeCount++; |
| 722 | 722 | // always false colorize |
| 723 | 723 | node->setFalseColor(255, randomColorValue(150), randomColorValue(150)); |
| @@ -731,7 +731,7 @@ void VoxelSystem::falseColorizeRandom() { · 7 unmodified lines | ||
| 731 | 731 | setupNewVoxelsForDrawing(); |
| 732 | 732 | } |
| 733 | 733 | |
| 734 | −bool VoxelSystem::trueColorizeOperation(VoxelNode* node, void* extraData) { | |
| 734 | +bool VoxelSystem::trueColorizeOperation(VoxelNode* node, int level, void* extraData) { | |
| 735 | 735 | _nodeCount++; |
| 736 | 736 | node->setFalseColored(false); |
| 737 | 737 | return true; |
| @@ -746,7 +746,7 @@ void VoxelSystem::trueColorize() { · 8 unmodified lines | ||
| 746 | 746 | } |
| 747 | 747 | |
| 748 | 748 | // Will false colorize voxels that are not in view |
| 749 | −bool VoxelSystem::falseColorizeInViewOperation(VoxelNode* node, void* extraData) { | |
| 749 | +bool VoxelSystem::falseColorizeInViewOperation(VoxelNode* node, int level, void* extraData) { | |
| 750 | 750 | const ViewFrustum* viewFrustum = (const ViewFrustum*) extraData; |
| 751 | 751 | _nodeCount++; |
| 752 | 752 | if (node->isColored()) { |
| @@ -766,7 +766,7 @@ void VoxelSystem::falseColorizeInView(ViewFrustum* viewFrustum) { · 13 unmodified lines | ||
| 766 | 766 | } |
| 767 | 767 | |
| 768 | 768 | // Will false colorize voxels based on distance from view |
| 769 | −bool VoxelSystem::falseColorizeDistanceFromViewOperation(VoxelNode* node, void* extraData) { | |
| 769 | +bool VoxelSystem::falseColorizeDistanceFromViewOperation(VoxelNode* node, int level, void* extraData) { | |
| 770 | 770 | ViewFrustum* viewFrustum = (ViewFrustum*) extraData; |
| 771 | 771 | if (node->isColored()) { |
| 772 | 772 | float distance = node->distanceToCamera(*viewFrustum); |
| @@ -789,7 +789,7 @@ float VoxelSystem::_minDistance = FLT_MAX; · 16 unmodified lines | ||
| 789 | 789 | // Helper function will get the distance from view range, would be nice if you could just keep track |
| 790 | 790 | // of this as voxels are created and/or colored... seems like some transform math could do that so |
| 791 | 791 | // we wouldn't need to do two passes of the tree |
| 792 | −bool VoxelSystem::getDistanceFromViewRangeOperation(VoxelNode* node, void* extraData) { | |
| 792 | +bool VoxelSystem::getDistanceFromViewRangeOperation(VoxelNode* node, int level, void* extraData) { | |
| 793 | 793 | ViewFrustum* viewFrustum = (ViewFrustum*) extraData; |
| 794 | 794 | // only do this for truly colored voxels... |
| 795 | 795 | if (node->isColored()) { |
| @@ -842,7 +842,7 @@ public: · 46 unmodified lines | ||
| 842 | 842 | |
| 843 | 843 | // "Remove" voxels from the tree that are not in view. We don't actually delete them, |
| 844 | 844 | // we remove them from the tree and place them into a holding area for later deletion |
| 845 | −bool VoxelSystem::removeOutOfViewOperation(VoxelNode* node, void* extraData) { | |
| 845 | +bool VoxelSystem::removeOutOfViewOperation(VoxelNode* node, int level, void* extraData) { | |
| 846 | 846 | removeOutOfViewArgs* args = (removeOutOfViewArgs*)extraData; |
| 847 | 847 | |
| 848 | 848 | // If our node was previously added to the don't recurse bag, then return false to |
| @@ -977,7 +977,7 @@ public: · 128 unmodified lines | ||
| 977 | 977 | bool colorThis; |
| 978 | 978 | }; |
| 979 | 979 | |
| 980 | −bool VoxelSystem::falseColorizeRandomEveryOtherOperation(VoxelNode* node, void* extraData) { | |
| 980 | +bool VoxelSystem::falseColorizeRandomEveryOtherOperation(VoxelNode* node, int level, void* extraData) { | |
| 981 | 981 | falseColorizeRandomEveryOtherArgs* args = (falseColorizeRandomEveryOtherArgs*)extraData; |
| 982 | 982 | args->totalNodes++; |
| 983 | 983 | if (node->isColored()) { |
| @@ -1030,7 +1030,7 @@ public: · 46 unmodified lines | ||
| 1030 | 1030 | bool hasIndexFound[MAX_VOXELS_PER_SYSTEM]; |
| 1031 | 1031 | }; |
| 1032 | 1032 | |
| 1033 | −bool VoxelSystem::collectStatsForTreesAndVBOsOperation(VoxelNode* node, void* extraData) { | |
| 1033 | +bool VoxelSystem::collectStatsForTreesAndVBOsOperation(VoxelNode* node, int level, void* extraData) { | |
| 1034 | 1034 | collectStatsForTreesAndVBOsArgs* args = (collectStatsForTreesAndVBOsArgs*)extraData; |
| 1035 | 1035 | args->totalNodes++; |
| 1036 | 1036 | |
| @@ -1182,7 +1182,7 @@ struct FalseColorizeSubTreeOperationArgs { · 145 unmodified lines | ||
| 1182 | 1182 | long voxelsTouched; |
| 1183 | 1183 | }; |
| 1184 | 1184 | |
| 1185 | −bool VoxelSystem::falseColorizeSubTreeOperation(VoxelNode* node, void* extraData) { | |
| 1185 | +bool VoxelSystem::falseColorizeSubTreeOperation(VoxelNode* node, int level, void* extraData) { | |
| 1186 | 1186 | if (node->getShouldRender()) { |
| 1187 | 1187 | FalseColorizeSubTreeOperationArgs* args = (FalseColorizeSubTreeOperationArgs*) extraData; |
| 1188 | 1188 | node->setFalseColor(args->color[0], args->color[1], args->color[2]); |
| @@ -1191,7 +1191,7 @@ bool VoxelSystem::falseColorizeSubTreeOperation(VoxelNode* node, void* extraData · 2 unmodified lines | ||
| 1191 | 1191 | return true; |
| 1192 | 1192 | } |
| 1193 | 1193 | |
| 1194 | −bool VoxelSystem::falseColorizeOccludedOperation(VoxelNode* node, void* extraData) { | |
| 1194 | +bool VoxelSystem::falseColorizeOccludedOperation(VoxelNode* node, int level, void* extraData) { | |
| 1195 | 1195 | |
| 1196 | 1196 | FalseColorizeOccludedArgs* args = (FalseColorizeOccludedArgs*) extraData; |
| 1197 | 1197 | args->totalVoxels++; |
| @@ -1228,7 +1228,7 @@ bool VoxelSystem::falseColorizeOccludedOperation(VoxelNode* node, void* extraDat · 30 unmodified lines | ||
| 1228 | 1228 | subArgs.color[2] = 0; |
| 1229 | 1229 | subArgs.voxelsTouched = 0; |
| 1230 | 1230 | |
| 1231 | − args->tree->recurseNodeWithOperation(node, falseColorizeSubTreeOperation, &subArgs ); | |
| 1231 | + args->tree->recurseNodeWithOperation(node, level, falseColorizeSubTreeOperation, &subArgs ); | |
| 1232 | 1232 | |
| 1233 | 1233 | args->subtreeVoxelsSkipped += (subArgs.voxelsTouched - 1); |
| 1234 | 1234 | args->totalVoxels += (subArgs.voxelsTouched - 1); |
| @@ -1312,7 +1312,7 @@ void VoxelSystem::falseColorizeOccluded() { · 77 unmodified lines | ||
| 1312 | 1312 | setupNewVoxelsForDrawing(); |
| 1313 | 1313 | } |
| 1314 | 1314 | |
| 1315 | −bool VoxelSystem::falseColorizeOccludedV2Operation(VoxelNode* node, void* extraData) { | |
| 1315 | +bool VoxelSystem::falseColorizeOccludedV2Operation(VoxelNode* node, int level, void* extraData) { | |
| 1316 | 1316 | |
| 1317 | 1317 | FalseColorizeOccludedArgs* args = (FalseColorizeOccludedArgs*) extraData; |
| 1318 | 1318 | args->totalVoxels++; |
| @@ -1349,7 +1349,7 @@ bool VoxelSystem::falseColorizeOccludedV2Operation(VoxelNode* node, void* extraD · 30 unmodified lines | ||
| 1349 | 1349 | subArgs.color[2] = 0; |
| 1350 | 1350 | subArgs.voxelsTouched = 0; |
| 1351 | 1351 | |
| 1352 | − args->tree->recurseNodeWithOperation(node, falseColorizeSubTreeOperation, &subArgs ); | |
| 1352 | + args->tree->recurseNodeWithOperation(node, level, falseColorizeSubTreeOperation, &subArgs ); | |
| 1353 | 1353 | |
| 1354 | 1354 | args->subtreeVoxelsSkipped += (subArgs.voxelsTouched - 1); |
| 1355 | 1355 | args->totalVoxels += (subArgs.voxelsTouched - 1); |