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
15531553 VoxelProjectedPolygon::intersects_calls
15541554 );
15551555 //myCoverageMapV2.erase();
1556−
1557−
15581556 _tree->setDirtyBit();
15591557 setupNewVoxelsForDrawing();
15601558 }
15611559
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+
15621590

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