Showing the changes to interface/src/VoxelSystem.cpp (1 of 1 file). Show all
Unified · Split
| @@ -547,24 +547,14 @@ bool VoxelSystem::falseColorizeInViewOperation(VoxelNode* node, bool down, void* · 546 unmodified lines | |||
| 547 | return true; | 547 | return true; |
| 548 | } | 548 | } |
| 549 | 549 | ||
| 550 | ViewFrustum* viewFrustum = (ViewFrustum*) extraData; | 550 | const ViewFrustum* viewFrustum = (const ViewFrustum*) extraData; |
| 551 | 551 | ||
| 552 | _nodeCount++; | 552 | _nodeCount++; |
| 553 | 553 | ||
| 554 | // only do this for truely colored voxels... | 554 | // only do this for truely colored voxels... |
| 555 | if (node->isColored()) { | 555 | if (node->isColored()) { |
| 556 | // first calculate the AAbox for the voxel | ||
| 557 | AABox voxelBox; | ||
| 558 | node->getAABox(voxelBox); | ||
| 559 | |||
| 560 | voxelBox.scale(TREE_SCALE); | ||
| 561 | |||
| 562 | printf("voxelBox corner=(%f,%f,%f) x=%f\n", | ||
| 563 | voxelBox.getCorner().x, voxelBox.getCorner().y, voxelBox.getCorner().z, | ||
| 564 | voxelBox.getSize().x); | ||
| 565 | |||
| 566 | // If the voxel is outside of the view frustum, then false color it red | 556 | // If the voxel is outside of the view frustum, then false color it red |
| 567 | if (ViewFrustum::OUTSIDE == viewFrustum->boxInFrustum(voxelBox)) { | 557 | if (!node->isInView(*viewFrustum)) { |
| 568 | // Out of view voxels are colored RED | 558 | // Out of view voxels are colored RED |
| 569 | unsigned char newR = 255; | 559 | unsigned char newR = 255; |
| 570 | unsigned char newG = 0; | 560 | unsigned char newG = 0; |
| @@ -573,11 +563,7 @@ bool VoxelSystem::falseColorizeInViewOperation(VoxelNode* node, bool down, void* · 2 unmodified lines | |||
| 573 | //printf("voxel OUTSIDE view - FALSE colorizing node %d TRUE color is %x,%x,%x \n", | 563 | //printf("voxel OUTSIDE view - FALSE colorizing node %d TRUE color is %x,%x,%x \n", |
| 574 | // _nodeCount,node->getTrueColor()[0],node->getTrueColor()[1],node->getTrueColor()[2]); | 564 | // _nodeCount,node->getTrueColor()[0],node->getTrueColor()[1],node->getTrueColor()[2]); |
| 575 | node->setFalseColor(newR,newG,newB); | 565 | node->setFalseColor(newR,newG,newB); |
| 576 | } else { | ||
| 577 | printf("voxel NOT OUTSIDE view\n"); | ||
| 578 | } | 566 | } |
| 579 | } else { | ||
| 580 | printf("voxel not colored, don't consider it\n"); | ||
| 581 | } | 567 | } |
| 582 | 568 | ||
| 583 | return true; // keep going! | 569 | return true; // keep going! |