History

Merge branch 'master' of https://github.com/worklist/hifi

Andrzej Kapolka committed 13 years ago

Commit 63aeb4d2 parents bd3c235 426abbb26 files · +680 −146Browse files

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

Unified · Split

interface/src/VoxelSystem.cpp+30−2
@@ -1530,10 +1530,38 @@ void VoxelSystem::falseColorizeOccludedV2() { · 1529 unmodified lines
15301530 VoxelProjectedPolygon::intersects_calls
15311531 );
15321532 //myCoverageMapV2.erase();
1533−
1534−
15351533 _tree->setDirtyBit();
15361534 setupNewVoxelsForDrawing();
15371535 }
15381536
1537+void VoxelSystem::nodeAdded(Node* node) {
1538+ if (node->getType() == NODE_TYPE_VOXEL_SERVER) {
1539+ uint16_t nodeID = node->getNodeID();
1540+ printf("VoxelSystem... voxel server %u added...\n", nodeID);
1541+ }
1542+}
1543+
1544+bool VoxelSystem::killSourceVoxelsOperation(VoxelNode* node, void* extraData) {
1545+ uint16_t killedNodeID = *(uint16_t*)extraData;
1546+ for (int i = 0; i < NUMBER_OF_CHILDREN; i++) {
1547+ VoxelNode* childNode = node->getChildAtIndex(i);
1548+ if (childNode && childNode->getSourceID()== killedNodeID) {
1549+ node->safeDeepDeleteChildAtIndex(i);
1550+ }
1551+ }
1552+ return true;
1553+}
1554+
1555+void VoxelSystem::nodeKilled(Node* node) {
1556+ if (node->getType() == NODE_TYPE_VOXEL_SERVER) {
1557+ uint16_t nodeID = node->getNodeID();
1558+ printf("VoxelSystem... voxel server %u removed...\n", nodeID);
1559+
1560+ // Kill any voxels from the local tree
1561+ _tree->recurseTreeWithOperation(killSourceVoxelsOperation, &nodeID);
1562+ _tree->setDirtyBit();
1563+ setupNewVoxelsForDrawing();
1564+ }
1565+}
1566+
15391567