Showing the changes to interface/src/VoxelSystem.cpp (1 of 1 file). Show all
Unified · Split
| @@ -122,138 +122,8 @@ int VoxelSystem::parseData(unsigned char* sourceBuffer, int numBytes) { · 121 unmodified lines | |||
| 122 | 122 | ||
| 123 | switch(command) { | 123 | switch(command) { |
| 124 | case PACKET_HEADER_VOXEL_DATA: | 124 | case PACKET_HEADER_VOXEL_DATA: |
| 125 | { | ||
| 126 | /***************** TEMPORARY CODE ********************************************************************************* | ||
| 127 | // YES! Stephen - I have intentionally placed this horrible UGLY LINE across your screen! I did it so you and I | ||
| 128 | // would make a point of removing this code when all this work is done. But in the mean time, I need it here for | ||
| 129 | // debugging purposes... When you do the code review... DO NOT tell me to remove it. :) Thank you! | ||
| 130 | // | ||
| 131 | unsigned char fakePacketA[18] = { 86,4,39,128,232,128,128,128,139,138,139,139,137,139,138,139,139,0 }; | ||
| 132 | unsigned char fakePacketB[13] = { 86, | ||
| 133 | 7,39,135,128, | ||
| 134 | 136, | ||
| 135 | 255,0,0, | ||
| 136 | 0,255,0, | ||
| 137 | 0 | ||
| 138 | }; | ||
| 139 | unsigned char fakePacketC[13] = { 86, | ||
| 140 | 7,39,135,64, | ||
| 141 | 136, | ||
| 142 | 0,0,255, | ||
| 143 | 0,255,255, | ||
| 144 | 0 | ||
| 145 | }; | ||
| 146 | |||
| 147 | unsigned char fakePacketD[25] = { 86, | ||
| 148 | 6,39,135,64, | ||
| 149 | 136, | ||
| 150 | 0,0,255, | ||
| 151 | 0,255,255, | ||
| 152 | 0, | ||
| 153 | 6,39,135,128, | ||
| 154 | 136, | ||
| 155 | 255,0,0, | ||
| 156 | 0,255,0, | ||
| 157 | 0 | ||
| 158 | }; | ||
| 159 | |||
| 160 | unsigned char fakePacketE[60] = { | ||
| 161 | 86 // V | ||
| 162 | |||
| 163 | ,6,39,135,64, | ||
| 164 | 136, | ||
| 165 | 0,0,255, | ||
| 166 | 0,255,255, | ||
| 167 | 0 | ||
| 168 | |||
| 169 | ,6,39,135,128, | ||
| 170 | 136, | ||
| 171 | 255,0,0, | ||
| 172 | 0,255,0, | ||
| 173 | 0 | ||
| 174 | |||
| 175 | // now some extra bits, what happens??? | ||
| 176 | ,2,252, // octcode for root | ||
| 177 | 7, // child color bits | ||
| 178 | 255,0,0, // child 1 color | ||
| 179 | 255,255,0, // child 1 color | ||
| 180 | 128,128,0, // child 1 color | ||
| 181 | 0 // child tree bits | ||
| 182 | |||
| 183 | ,3,0,0, // octcode for root | ||
| 184 | 3, // child color bits | ||
| 185 | 0,0,255, // child 128 color | ||
| 186 | 0,255,0, // child 8 color | ||
| 187 | 0 // child tree bits - none | ||
| 188 | |||
| 189 | ,3,0,0, // octcode for root | ||
| 190 | 136, // child color bits | ||
| 191 | 0,0,255, // child 128 color | ||
| 192 | 0,255,0, // child 8 color | ||
| 193 | 0 // child tree bits - none | ||
| 194 | }; | ||
| 195 | |||
| 196 | unsigned char fakeBuffer[18] = { | ||
| 197 | 86, // V | ||
| 198 | 2,0, // octcode for root | ||
| 199 | 136, // child color bits | ||
| 200 | 0,0,255, // child 128 color | ||
| 201 | 0,255,0, // child 8 color | ||
| 202 | 0, // child tree bits - none | ||
| 203 | |||
| 204 | // now some extra bits, what happens??? | ||
| 205 | 2,252, // octcode for root | ||
| 206 | 1, // child color bits | ||
| 207 | 255,0,0, // child 1 color | ||
| 208 | 0 // child tree bits | ||
| 209 | }; | ||
| 210 | |||
| 211 | //printf("loading fake data! fakeBuffer \n"); | ||
| 212 | tree->readBitstreamToTree((unsigned char*)&fakeBuffer[1], sizeof(fakeBuffer)-1); | ||
| 213 | |||
| 214 | unsigned char fakeBuffer[11] = { | ||
| 215 | 86, // V | ||
| 216 | 2,0, // octcode for root | ||
| 217 | 136, // child color bits | ||
| 218 | 0,0,255, // child 128 color | ||
| 219 | 0,255,0, // child 8 color | ||
| 220 | 0 // child tree bits - none | ||
| 221 | }; | ||
| 222 | |||
| 223 | printf("loading fake data! fakeBuffer \n"); | ||
| 224 | tree->readBitstreamToTree((unsigned char*)&fakeBuffer[1], sizeof(fakeBuffer)-1); | ||
| 225 | |||
| 226 | unsigned char fakeBufferA[11] = { | ||
| 227 | 86, // V | ||
| 228 | 0, // octcode for root | ||
| 229 | 0, // child color bits? | ||
| 230 | 128, // child exists bits | ||
| 231 | 0, // child color bits | ||
| 232 | 128, // child exists | ||
| 233 | 128, // child color bits | ||
| 234 | 0,0,255, // child color | ||
| 235 | 0 // child exists bits | ||
| 236 | }; | ||
| 237 | |||
| 238 | unsigned char fakeBufferB[11] = { | ||
| 239 | 86, // V | ||
| 240 | 0, // octcode for root | ||
| 241 | 0, // child color bits? | ||
| 242 | 128, // child exists bits | ||
| 243 | 0, // child color bits | ||
| 244 | 128, // child exists | ||
| 245 | 16, // child color bits | ||
| 246 | 0,255,0, // child color?? | ||
| 247 | 0 // child exists bits | ||
| 248 | }; | ||
| 249 | |||
| 250 | // trim off the "V" | ||
| 251 | |||
| 252 | ***** END OF TEMPORARY CODE ***************************************************************************************/ | ||
| 253 | |||
| 254 | // ask the VoxelTree to read the bitstream into the tree | 125 | // ask the VoxelTree to read the bitstream into the tree |
| 255 | tree->readBitstreamToTree(voxelData, numBytes - 1); | 126 | tree->readBitstreamToTree(voxelData, numBytes - 1); |
| 256 | } | ||
| 257 | break; | 127 | break; |
| 258 | case PACKET_HEADER_ERASE_VOXEL: | 128 | case PACKET_HEADER_ERASE_VOXEL: |
| 259 | // ask the tree to read the "remove" bitstream | 129 | // ask the tree to read the "remove" bitstream |
| @@ -342,17 +212,8 @@ int VoxelSystem::treeToArrays(VoxelNode* currentNode, const glm::vec3& nodePosi · 82 unmodified lines | |||
| 342 | } | 212 | } |
| 343 | } | 213 | } |
| 344 | 214 | ||
| 345 | // if we didn't get any voxels added then we're a leaf | 215 | // if we didn't get any voxels added then we're a leaf (XXXBHG - Stephen can you explain this to me????) |
| 346 | // add our vertex and color information to the interleaved array | 216 | // add our vertex and color information to the interleaved array |
| 347 | /****** XXXBHG ***** Stephen!!! ******************************************************************************************** | ||
| 348 | * What is this code about??? Why are we checking to see if voxelsAdded==0???? Shouldn't we always be writing arrays? | ||
| 349 | * Help me understand this? If I remove this check, then two things happen: | ||
| 350 | * 1) I get much more blinking... which is not desirable. | ||
| 351 | * 2) I seem to get large blocks of "average color" voxels... namely I see big voxels, where their should be smaller ones | ||
| 352 | * | ||
| 353 | * But with this check in here, the blinking stops... which kind of makes sense... and the average blocks go away??? not | ||
| 354 | * sure why, but updates seem to be slower... namely, we don't seem to see the new voxels even though the client got them. | ||
| 355 | ***************************************************************************************************************************/ | ||
| 356 | if (voxelsAdded == 0 && currentNode->isColored()) { | 217 | if (voxelsAdded == 0 && currentNode->isColored()) { |
| 357 | float startVertex[3]; | 218 | float startVertex[3]; |
| 358 | copyFirstVertexForCode(currentNode->octalCode,(float*)&startVertex); | 219 | copyFirstVertexForCode(currentNode->octalCode,(float*)&startVertex); |