Showing the changes to interface/src/VoxelSystem.cpp (1 of 6 files). Show all
Unified · Split
| @@ -1553,10 +1553,38 @@ void VoxelSystem::falseColorizeOccludedV2() { · 1552 unmodified lines | |||
| 1553 | VoxelProjectedPolygon::intersects_calls | 1553 | VoxelProjectedPolygon::intersects_calls |
| 1554 | ); | 1554 | ); |
| 1555 | //myCoverageMapV2.erase(); | 1555 | //myCoverageMapV2.erase(); |
| 1556 | |||
| 1557 | |||
| 1558 | _tree->setDirtyBit(); | 1556 | _tree->setDirtyBit(); |
| 1559 | setupNewVoxelsForDrawing(); | 1557 | setupNewVoxelsForDrawing(); |
| 1560 | } | 1558 | } |
| 1561 | 1559 | ||
| 1560 | void VoxelSystem::nodeAdded(Node* node) { | ||
| 1561 | if (node->getType() == NODE_TYPE_VOXEL_SERVER) { | ||
| 1562 | uint16_t nodeID = node->getNodeID(); | ||
| 1563 | //printf("VoxelSystem... voxel server %u added...\n", nodeID); | ||
| 1564 | } | ||
| 1565 | } | ||
| 1566 | |||
| 1567 | bool VoxelSystem::killSourceVoxelsOperation(VoxelNode* node, void* extraData) { | ||
| 1568 | uint16_t killedNodeID = *(uint16_t*)extraData; | ||
| 1569 | for (int i = 0; i < NUMBER_OF_CHILDREN; i++) { | ||
| 1570 | VoxelNode* childNode = node->getChildAtIndex(i); | ||
| 1571 | if (childNode && childNode->getSourceID()== killedNodeID) { | ||
| 1572 | node->safeDeepDeleteChildAtIndex(i); | ||
| 1573 | } | ||
| 1574 | } | ||
| 1575 | return true; | ||
| 1576 | } | ||
| 1577 | |||
| 1578 | void VoxelSystem::nodeKilled(Node* node) { | ||
| 1579 | if (node->getType() == NODE_TYPE_VOXEL_SERVER) { | ||
| 1580 | uint16_t nodeID = node->getNodeID(); | ||
| 1581 | //printf("VoxelSystem... voxel server %u removed...\n", nodeID); | ||
| 1582 | |||
| 1583 | // Kill any voxels from the local tree | ||
| 1584 | _tree->recurseTreeWithOperation(killSourceVoxelsOperation, &nodeID); | ||
| 1585 | _tree->setDirtyBit(); | ||
| 1586 | setupNewVoxelsForDrawing(); | ||
| 1587 | } | ||
| 1588 | } | ||
| 1589 | |||
| 1562 | 1590 | ||