History

Added agentTypes to AgentList::broadcastToAgents() Make voxel server rebroadcast "remove voxel" messages to all it's connected heads Cleaned up processing of Remove voxel messages to live in VoxelTree

ZappoMan committed 13 years ago

Commit 9220ba31 parent 407fa957 files · +56 −30Browse files

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

Unified · Split

interface/src/VoxelSystem.cpp+12−3
@@ -84,11 +84,20 @@ void VoxelSystem::createSphere(float r,float xc, float yc, float zc, float s, bo · 83 unmodified lines
8484
8585
8686 void VoxelSystem::parseData(void *data, int size) {
87− // output the bits received from the voxel server
87+
88+ unsigned char command = *(unsigned char*)data;
8889 unsigned char *voxelData = (unsigned char *) data + 1;
8990
90− // ask the VoxelTree to read the bitstream into the tree
91− tree->readBitstreamToTree(voxelData, size - 1);
91+ switch(command) {
92+ case 'V':
93+ // ask the VoxelTree to read the bitstream into the tree
94+ tree->readBitstreamToTree(voxelData, size - 1);
95+ break;
96+ case 'R':
97+ // ask the tree to read the "remove" bitstream
98+ tree->processRemoveVoxelBitstream((unsigned char*)data,size);
99+ break;
100+ }
92101
93102 setupNewVoxelsForDrawing();
94103 }