Showing the changes to interface/src/VoxelSystem.cpp (1 of 3 files). Show all
Unified · Split
| @@ -1416,7 +1416,7 @@ void VoxelSystem::falseColorizeDistanceFromView() { · 1415 unmodified lines | ||
| 1416 | 1416 | class removeOutOfViewArgs { |
| 1417 | 1417 | public: |
| 1418 | 1418 | VoxelSystem* thisVoxelSystem; |
| 1419 | − ViewFrustum* thisViewFrustum; | |
| 1419 | + ViewFrustum thisViewFrustum; | |
| 1420 | 1420 | VoxelNodeBag dontRecurseBag; |
| 1421 | 1421 | unsigned long nodesScanned; |
| 1422 | 1422 | unsigned long nodesRemoved; |
| @@ -1426,14 +1426,20 @@ public: · 3 unmodified lines | ||
| 1426 | 1426 | |
| 1427 | 1427 | removeOutOfViewArgs(VoxelSystem* voxelSystem) : |
| 1428 | 1428 | thisVoxelSystem(voxelSystem), |
| 1429 | − thisViewFrustum(voxelSystem->getViewFrustum()), | |
| 1429 | + thisViewFrustum(*voxelSystem->getViewFrustum()), | |
| 1430 | 1430 | dontRecurseBag(), |
| 1431 | 1431 | nodesScanned(0), |
| 1432 | 1432 | nodesRemoved(0), |
| 1433 | 1433 | nodesInside(0), |
| 1434 | 1434 | nodesIntersect(0), |
| 1435 | 1435 | nodesOutside(0) |
| 1436 | − { } | |
| 1436 | + { | |
| 1437 | + // Widen the FOV for trimming | |
| 1438 | + float originalFOV = thisViewFrustum.getFieldOfView(); | |
| 1439 | + float wideFOV = originalFOV + VIEW_FRUSTUM_FOV_OVERSEND; | |
| 1440 | + thisViewFrustum.setFieldOfView(wideFOV); // hack | |
| 1441 | + thisViewFrustum.calculate(); | |
| 1442 | + } | |
| 1437 | 1443 | }; |
| 1438 | 1444 | |
| 1439 | 1445 | void VoxelSystem::cancelImport() { |
| @@ -1459,7 +1465,7 @@ bool VoxelSystem::removeOutOfViewOperation(VoxelNode* node, void* extraData) { · 19 unmodified lines | ||
| 1459 | 1465 | for (int i = 0; i < NUMBER_OF_CHILDREN; i++) { |
| 1460 | 1466 | VoxelNode* childNode = node->getChildAtIndex(i); |
| 1461 | 1467 | if (childNode) { |
| 1462 | − ViewFrustum::location inFrustum = childNode->inFrustum(*args->thisViewFrustum); | |
| 1468 | + ViewFrustum::location inFrustum = childNode->inFrustum(args->thisViewFrustum); | |
| 1463 | 1469 | switch (inFrustum) { |
| 1464 | 1470 | case ViewFrustum::OUTSIDE: { |
| 1465 | 1471 | args->nodesOutside++; |