History

Kills local voxels if voxel server is removed from NodeList - added notification hooks to NodeList - implemented hooks in VoxelSystem to kill local voxels when voxel server is killed

ZappoMan committed 13 years ago

Commit 14b7f581 parent 92f6fe66 files · +88 −4Browse files

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

Unified · Split

interface/src/VoxelSystem.cpp+30−2
@@ -1553,10 +1553,38 @@ void VoxelSystem::falseColorizeOccludedV2() { · 1552 unmodified lines
1553 VoxelProjectedPolygon::intersects_calls1553 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
1560void 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
1567bool 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
1578void 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

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t