Showing the changes to interface/src/VoxelSystem.cpp (1 of 2 files). Show all
Unified · Split
| @@ -23,25 +23,27 @@ · 22 unmodified lines | ||
| 23 | 23 | |
| 24 | 24 | const int MAX_VOXELS_PER_SYSTEM = 250000; |
| 25 | 25 | |
| 26 | −const int VERTICES_PER_VOXEL = 8; | |
| 26 | +const int VERTICES_PER_VOXEL = 24; | |
| 27 | 27 | const int VERTEX_POINTS_PER_VOXEL = 3 * VERTICES_PER_VOXEL; |
| 28 | 28 | const int INDICES_PER_VOXEL = 3 * 12; |
| 29 | 29 | |
| 30 | −float identityVertices[] = { 0, 0, 0, | |
| 31 | − 1, 0, 0, | |
| 32 | − 1, 1, 0, | |
| 33 | − 0, 1, 0, | |
| 34 | − 0, 0, 1, | |
| 35 | − 1, 0, 1, | |
| 36 | − 1, 1, 1, | |
| 37 | − 0, 1, 1 }; | |
| 38 | − | |
| 39 | −GLubyte identityIndices[] = { 0,1,2, 0,2,3, | |
| 40 | − 0,1,5, 0,4,5, | |
| 41 | − 0,3,7, 0,4,7, | |
| 42 | − 1,2,6, 1,5,6, | |
| 43 | − 2,3,7, 2,6,7, | |
| 44 | − 4,5,6, 4,6,7 }; | |
| 30 | +float identityVertices[] = { 0,0,0, 1,0,0, 1,1,0, 0,1,0, 0,0,1, 1,0,1, 1,1,1, 0,1,1, | |
| 31 | + 0,0,0, 1,0,0, 1,1,0, 0,1,0, 0,0,1, 1,0,1, 1,1,1, 0,1,1, | |
| 32 | + 0,0,0, 1,0,0, 1,1,0, 0,1,0, 0,0,1, 1,0,1, 1,1,1, 0,1,1 }; | |
| 33 | + | |
| 34 | +GLfloat identityNormals[] = { 0,0,-1, 0,0,-1, 0,0,-1, 0,0,-1, | |
| 35 | + 0,0,+1, 0,0,+1, 0,0,+1, 0,0,+1, | |
| 36 | + 0,-1,0, 0,-1,0, 0,+1,0, 0,+1,0, | |
| 37 | + 0,-1,0, 0,-1,0, 0,+1,0, 0,+1,0, | |
| 38 | + -1,0,0, +1,0,0, +1,0,0, -1,0,0, | |
| 39 | + -1,0,0, +1,0,0, +1,0,0, -1,0,0 }; | |
| 40 | + | |
| 41 | +GLubyte identityIndices[] = { 0,2,1, 0,3,2, // Z- . | |
| 42 | + 8,9,13, 8,13,12, // Y- | |
| 43 | + 16,23,19, 16,20,23, // X- | |
| 44 | + 17,18,22, 17,22,21, // X+ | |
| 45 | + 10,11,15, 10,15,14, // Y+ | |
| 46 | + 4,5,6, 4,6,7 }; // Z+ . | |
| 45 | 47 | |
| 46 | 48 | VoxelSystem::VoxelSystem() { |
| 47 | 49 | voxelsRendered = 0; |
| @@ -49,7 +51,7 @@ VoxelSystem::VoxelSystem() { · 1 unmodified line | ||
| 49 | 51 | pthread_mutex_init(&bufferWriteLock, NULL); |
| 50 | 52 | } |
| 51 | 53 | |
| 52 | −VoxelSystem::~VoxelSystem() { | |
| 54 | +VoxelSystem::~VoxelSystem() { | |
| 53 | 55 | delete[] readVerticesArray; |
| 54 | 56 | delete[] writeVerticesArray; |
| 55 | 57 | delete[] readColorsArray; |
| @@ -70,9 +72,9 @@ void VoxelSystem::setViewerHead(Head *newViewerHead) { · 14 unmodified lines | ||
| 70 | 72 | // Complaints: Brad :) |
| 71 | 73 | // To Do: Need to add color data to the file. |
| 72 | 74 | void VoxelSystem::loadVoxelsFile(const char* fileName, bool wantColorRandomizer) { |
| 73 | − | |
| 75 | + | |
| 74 | 76 | tree->loadVoxelsFile(fileName,wantColorRandomizer); |
| 75 | − | |
| 77 | + | |
| 76 | 78 | copyWrittenDataToReadArrays(); |
| 77 | 79 | } |
| 78 | 80 | |
| @@ -118,7 +120,7 @@ int VoxelSystem::parseData(unsigned char* sourceBuffer, int numBytes) { · 39 unmodified lines | ||
| 118 | 120 | |
| 119 | 121 | unsigned char command = *sourceBuffer; |
| 120 | 122 | unsigned char *voxelData = sourceBuffer + 1; |
| 121 | − | |
| 123 | + | |
| 122 | 124 | switch(command) { |
| 123 | 125 | case PACKET_HEADER_VOXEL_DATA: |
| 124 | 126 | // ask the VoxelTree to read the bitstream into the tree |
| @@ -131,7 +133,7 @@ int VoxelSystem::parseData(unsigned char* sourceBuffer, int numBytes) { · 6 unmodified lines | ||
| 131 | 133 | case PACKET_HEADER_Z_COMMAND: |
| 132 | 134 | |
| 133 | 135 | // the Z command is a special command that allows the sender to send high level semantic |
| 134 | − // requests, like erase all, or add sphere scene, different receivers may handle these | |
| 136 | + // requests, like erase all, or add sphere scene, different receivers may handle these | |
| 135 | 137 | // messages differently |
| 136 | 138 | char* packetData = (char *)sourceBuffer; |
| 137 | 139 | char* command = &packetData[1]; // start of the command |
| @@ -152,7 +154,7 @@ int VoxelSystem::parseData(unsigned char* sourceBuffer, int numBytes) { · 14 unmodified lines | ||
| 152 | 154 | } |
| 153 | 155 | break; |
| 154 | 156 | } |
| 155 | − | |
| 157 | + | |
| 156 | 158 | setupNewVoxelsForDrawing(); |
| 157 | 159 | return numBytes; |
| 158 | 160 | } |
| @@ -212,11 +214,11 @@ int VoxelSystem::treeToArrays(VoxelNode *currentNode, const glm::vec3& nodePosi · 53 unmodified lines | ||
| 212 | 214 | for (int i = 0; i < 8; i++) { |
| 213 | 215 | // check if there is a child here |
| 214 | 216 | if (currentNode->children[i] != NULL) { |
| 215 | − | |
| 217 | + | |
| 216 | 218 | glm::vec3 childNodePosition; |
| 217 | 219 | copyFirstVertexForCode(currentNode->children[i]->octalCode,(float*)&childNodePosition); |
| 218 | 220 | childNodePosition *= (float)TREE_SCALE; // scale it up |
| 219 | − | |
| 221 | + | |
| 220 | 222 | /**** disabled ************************************************************************************************ |
| 221 | 223 | // Note: Stephen, I intentionally left this in so you would talk to me about it. Here's the deal, this code |
| 222 | 224 | // doesn't seem to work correctly. It returns X and Z flipped and the values are negative. Since we use the |
| @@ -226,7 +228,7 @@ int VoxelSystem::treeToArrays(VoxelNode *currentNode, const glm::vec3& nodePosi · 3 unmodified lines | ||
| 226 | 228 | // calculate the child's position based on the parent position |
| 227 | 229 | for (int j = 0; j < 3; j++) { |
| 228 | 230 | childNodePosition[j] = nodePosition[j]; |
| 229 | − | |
| 231 | + | |
| 230 | 232 | if (oneAtBit(branchIndexWithDescendant(currentNode->octalCode,currentNode->children[i]->octalCode),(7 - j))) { |
| 231 | 233 | childNodePosition[j] -= (powf(0.5, *currentNode->children[i]->octalCode) * TREE_SCALE); |
| 232 | 234 | } |
| @@ -243,13 +245,13 @@ int VoxelSystem::treeToArrays(VoxelNode *currentNode, const glm::vec3& nodePosi · 10 unmodified lines | ||
| 243 | 245 | float startVertex[3]; |
| 244 | 246 | copyFirstVertexForCode(currentNode->octalCode,(float*)&startVertex); |
| 245 | 247 | float voxelScale = 1 / powf(2, *currentNode->octalCode); |
| 246 | − | |
| 248 | + | |
| 247 | 249 | // populate the array with points for the 8 vertices |
| 248 | 250 | // and RGB color for each added vertex |
| 249 | 251 | for (int j = 0; j < VERTEX_POINTS_PER_VOXEL; j++ ) { |
| 250 | 252 | *writeVerticesEndPointer = startVertex[j % 3] + (identityVertices[j] * voxelScale); |
| 251 | 253 | *(writeColorsArray + (writeVerticesEndPointer - writeVerticesArray)) = currentNode->getColor()[j % 3]; |
| 252 | − | |
| 254 | + | |
| 253 | 255 | writeVerticesEndPointer++; |
| 254 | 256 | } |
| 255 | 257 | voxelsAdded++; |
| @@ -271,7 +273,7 @@ void VoxelSystem::init() { · 15 unmodified lines | ||
| 271 | 273 | readColorsArray = new GLubyte[VERTEX_POINTS_PER_VOXEL * MAX_VOXELS_PER_SYSTEM]; |
| 272 | 274 | |
| 273 | 275 | GLuint *indicesArray = new GLuint[INDICES_PER_VOXEL * MAX_VOXELS_PER_SYSTEM]; |
| 274 | − | |
| 276 | + | |
| 275 | 277 | // populate the indicesArray |
| 276 | 278 | // this will not change given new voxels, so we can set it all up now |
| 277 | 279 | for (int n = 0; n < MAX_VOXELS_PER_SYSTEM; n++) { |
| @@ -279,84 +281,107 @@ void VoxelSystem::init() { · 1 unmodified line | ||
| 279 | 281 | int voxelIndexOffset = n * INDICES_PER_VOXEL; |
| 280 | 282 | GLuint *currentIndicesPos = indicesArray + voxelIndexOffset; |
| 281 | 283 | int startIndex = (n * VERTICES_PER_VOXEL); |
| 282 | − | |
| 284 | + | |
| 283 | 285 | for (int i = 0; i < INDICES_PER_VOXEL; i++) { |
| 284 | 286 | // add indices for this side of the cube |
| 285 | 287 | currentIndicesPos[i] = startIndex + identityIndices[i]; |
| 286 | 288 | } |
| 287 | 289 | } |
| 288 | − | |
| 290 | + | |
| 291 | + GLfloat *normalsArray = new GLfloat[VERTEX_POINTS_PER_VOXEL * MAX_VOXELS_PER_SYSTEM]; | |
| 292 | + GLfloat *normalsArrayEndPointer = normalsArray; | |
| 293 | + | |
| 294 | + // populate the normalsArray | |
| 295 | + for (int n = 0; n < MAX_VOXELS_PER_SYSTEM; n++) { | |
| 296 | + for (int i = 0; i < VERTEX_POINTS_PER_VOXEL; i++) { | |
| 297 | + *(normalsArrayEndPointer++) = identityNormals[i]; | |
| 298 | + } | |
| 299 | + } | |
| 300 | + | |
| 289 | 301 | // VBO for the verticesArray |
| 290 | 302 | glGenBuffers(1, &vboVerticesID); |
| 291 | 303 | glBindBuffer(GL_ARRAY_BUFFER, vboVerticesID); |
| 292 | 304 | glBufferData(GL_ARRAY_BUFFER, VERTEX_POINTS_PER_VOXEL * sizeof(GLfloat) * MAX_VOXELS_PER_SYSTEM, NULL, GL_DYNAMIC_DRAW); |
| 293 | − | |
| 305 | + | |
| 306 | + // VBO for the normalsArray | |
| 307 | + glGenBuffers(1, &vboNormalsID); | |
| 308 | + glBindBuffer(GL_ARRAY_BUFFER, vboNormalsID); | |
| 309 | + glBufferData(GL_ARRAY_BUFFER, | |
| 310 | + VERTEX_POINTS_PER_VOXEL * sizeof(GLfloat) * MAX_VOXELS_PER_SYSTEM, | |
| 311 | + normalsArray, GL_STATIC_DRAW); | |
| 312 | + | |
| 294 | 313 | // VBO for colorsArray |
| 295 | 314 | glGenBuffers(1, &vboColorsID); |
| 296 | 315 | glBindBuffer(GL_ARRAY_BUFFER, vboColorsID); |
| 297 | 316 | glBufferData(GL_ARRAY_BUFFER, VERTEX_POINTS_PER_VOXEL * sizeof(GLubyte) * MAX_VOXELS_PER_SYSTEM, NULL, GL_DYNAMIC_DRAW); |
| 298 | − | |
| 317 | + | |
| 299 | 318 | // VBO for the indicesArray |
| 300 | 319 | glGenBuffers(1, &vboIndicesID); |
| 301 | 320 | glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, vboIndicesID); |
| 302 | 321 | glBufferData(GL_ELEMENT_ARRAY_BUFFER, |
| 303 | 322 | INDICES_PER_VOXEL * sizeof(GLuint) * MAX_VOXELS_PER_SYSTEM, |
| 304 | 323 | indicesArray, GL_STATIC_DRAW); |
| 305 | − | |
| 306 | − // delete the indices array that is no longer needed | |
| 324 | + | |
| 325 | + // delete the indices and normals arrays that are no longer needed | |
| 307 | 326 | delete[] indicesArray; |
| 327 | + delete[] normalsArray; | |
| 308 | 328 | } |
| 309 | 329 | |
| 310 | 330 | void VoxelSystem::render() { |
| 311 | 331 | |
| 312 | 332 | glPushMatrix(); |
| 313 | − | |
| 333 | + | |
| 314 | 334 | if (readVerticesEndPointer != readVerticesArray) { |
| 315 | 335 | // try to lock on the buffer write |
| 316 | 336 | // just avoid pulling new data if it is currently being written |
| 317 | 337 | if (pthread_mutex_trylock(&bufferWriteLock) == 0) { |
| 318 | − | |
| 338 | + | |
| 319 | 339 | glBindBuffer(GL_ARRAY_BUFFER, vboVerticesID); |
| 320 | 340 | glBufferSubData(GL_ARRAY_BUFFER, 0, (readVerticesEndPointer - readVerticesArray) * sizeof(GLfloat), readVerticesArray); |
| 321 | − | |
| 341 | + | |
| 322 | 342 | glBindBuffer(GL_ARRAY_BUFFER, vboColorsID); |
| 323 | 343 | glBufferSubData(GL_ARRAY_BUFFER, 0, (readVerticesEndPointer - readVerticesArray) * sizeof(GLubyte), readColorsArray); |
| 324 | − | |
| 344 | + | |
| 325 | 345 | readVerticesEndPointer = readVerticesArray; |
| 326 | − | |
| 346 | + | |
| 327 | 347 | pthread_mutex_unlock(&bufferWriteLock); |
| 328 | 348 | } |
| 329 | 349 | } |
| 330 | 350 | |
| 331 | 351 | // tell OpenGL where to find vertex and color information |
| 332 | 352 | glEnableClientState(GL_VERTEX_ARRAY); |
| 353 | + glEnableClientState(GL_NORMAL_ARRAY); | |
| 333 | 354 | glEnableClientState(GL_COLOR_ARRAY); |
| 334 | − | |
| 355 | + | |
| 335 | 356 | glBindBuffer(GL_ARRAY_BUFFER, vboVerticesID); |
| 336 | 357 | glVertexPointer(3, GL_FLOAT, 0, 0); |
| 337 | − | |
| 358 | + | |
| 359 | + glBindBuffer(GL_ARRAY_BUFFER, vboNormalsID); | |
| 360 | + glNormalPointer(GL_FLOAT, 0, 0); | |
| 361 | + | |
| 338 | 362 | glBindBuffer(GL_ARRAY_BUFFER, vboColorsID); |
| 339 | 363 | glColorPointer(3, GL_UNSIGNED_BYTE, 0, 0); |
| 340 | − | |
| 364 | + | |
| 341 | 365 | // draw the number of voxels we have |
| 342 | 366 | glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, vboIndicesID); |
| 343 | 367 | glScalef(10, 10, 10); |
| 344 | 368 | glDrawElements(GL_TRIANGLES, 36 * voxelsRendered, GL_UNSIGNED_INT, 0); |
| 345 | − | |
| 369 | + | |
| 346 | 370 | // deactivate vertex and color arrays after drawing |
| 347 | 371 | glDisableClientState(GL_VERTEX_ARRAY); |
| 372 | + glDisableClientState(GL_NORMAL_ARRAY); | |
| 348 | 373 | glDisableClientState(GL_COLOR_ARRAY); |
| 349 | − | |
| 374 | + | |
| 350 | 375 | // bind with 0 to switch back to normal operation |
| 351 | 376 | glBindBuffer(GL_ARRAY_BUFFER, 0); |
| 352 | 377 | glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, 0); |
| 353 | − | |
| 378 | + | |
| 354 | 379 | // scale back down to 1 so heads aren't massive |
| 355 | 380 | glPopMatrix(); |
| 356 | 381 | } |
| 357 | 382 | |
| 358 | 383 | void VoxelSystem::simulate(float deltaTime) { |
| 359 | − | |
| 384 | + | |
| 360 | 385 | } |
| 361 | 386 | |
| 362 | 387 | int VoxelSystem::_nodeCount = 0; |
| @@ -367,7 +392,7 @@ bool VoxelSystem::randomColorOperation(VoxelNode* node, bool down, void* extraDa · 4 unmodified lines | ||
| 367 | 392 | if (down) { |
| 368 | 393 | return true; |
| 369 | 394 | } |
| 370 | − | |
| 395 | + | |
| 371 | 396 | _nodeCount++; |
| 372 | 397 | if (node->isColored()) { |
| 373 | 398 | nodeColor newColor = { 0,0,0,1 }; |
| @@ -398,9 +423,9 @@ bool VoxelSystem::falseColorizeRandomOperation(VoxelNode* node, bool down, void* · 24 unmodified lines | ||
| 398 | 423 | if (down) { |
| 399 | 424 | return true; |
| 400 | 425 | } |
| 401 | − | |
| 426 | + | |
| 402 | 427 | _nodeCount++; |
| 403 | − | |
| 428 | + | |
| 404 | 429 | // always false colorize |
| 405 | 430 | unsigned char newR = randomColorValue(150); |
| 406 | 431 | unsigned char newG = randomColorValue(150); |
| @@ -427,7 +452,7 @@ bool VoxelSystem::trueColorizeOperation(VoxelNode* node, bool down, void* extraD · 20 unmodified lines | ||
| 427 | 452 | if (down) { |
| 428 | 453 | return true; |
| 429 | 454 | } |
| 430 | − | |
| 455 | + | |
| 431 | 456 | _nodeCount++; |
| 432 | 457 | node->setFalseColored(false); |
| 433 | 458 | //printf("setting true color for node %d\n",_nodeCount); |
| @@ -448,23 +473,23 @@ bool VoxelSystem::falseColorizeInViewOperation(VoxelNode* node, bool down, void* · 14 unmodified lines | ||
| 448 | 473 | if (down) { |
| 449 | 474 | return true; |
| 450 | 475 | } |
| 451 | − | |
| 476 | + | |
| 452 | 477 | ViewFrustum* viewFrustum = (ViewFrustum*) extraData; |
| 453 | − | |
| 478 | + | |
| 454 | 479 | _nodeCount++; |
| 455 | − | |
| 480 | + | |
| 456 | 481 | // only do this for truely colored voxels... |
| 457 | 482 | if (node->isColored()) { |
| 458 | 483 | // first calculate the AAbox for the voxel |
| 459 | 484 | AABox voxelBox; |
| 460 | 485 | node->getAABox(voxelBox); |
| 461 | − | |
| 486 | + | |
| 462 | 487 | voxelBox.scale(TREE_SCALE); |
| 463 | − | |
| 488 | + | |
| 464 | 489 | printf("voxelBox corner=(%f,%f,%f) x=%f\n", |
| 465 | 490 | voxelBox.getCorner().x, voxelBox.getCorner().y, voxelBox.getCorner().z, |
| 466 | 491 | voxelBox.getSize().x); |
| 467 | − | |
| 492 | + | |
| 468 | 493 | // If the voxel is outside of the view frustum, then false color it red |
| 469 | 494 | if (ViewFrustum::OUTSIDE == viewFrustum->boxInFrustum(voxelBox)) { |
| 470 | 495 | // Out of view voxels are colored RED |
| @@ -481,7 +506,7 @@ bool VoxelSystem::falseColorizeInViewOperation(VoxelNode* node, bool down, void* · 10 unmodified lines | ||
| 481 | 506 | } else { |
| 482 | 507 | printf("voxel not colored, don't consider it\n"); |
| 483 | 508 | } |
| 484 | − | |
| 509 | + | |
| 485 | 510 | return true; // keep going! |
| 486 | 511 | } |
| 487 | 512 | |
| @@ -503,7 +528,7 @@ bool VoxelSystem::falseColorizeDistanceFromViewOperation(VoxelNode* node, bool d · 15 unmodified lines | ||
| 503 | 528 | } |
| 504 | 529 | |
| 505 | 530 | ViewFrustum* viewFrustum = (ViewFrustum*) extraData; |
| 506 | − | |
| 531 | + | |
| 507 | 532 | // only do this for truly colored voxels... |
| 508 | 533 | if (node->isColored()) { |
| 509 | 534 | |
| @@ -517,10 +542,10 @@ bool VoxelSystem::falseColorizeDistanceFromViewOperation(VoxelNode* node, bool d · 7 unmodified lines | ||
| 517 | 542 | |
| 518 | 543 | // scale up the node position |
| 519 | 544 | nodePosition = nodePosition*(float)TREE_SCALE; |
| 520 | − | |
| 545 | + | |
| 521 | 546 | float halfUnitForVoxel = powf(0.5, *node->octalCode) * (0.5 * TREE_SCALE); |
| 522 | 547 | glm::vec3 viewerPosition = viewFrustum->getPosition(); |
| 523 | − | |
| 548 | + | |
| 524 | 549 | //printf("halfUnitForVoxel=%f\n",halfUnitForVoxel); |
| 525 | 550 | //printf("viewer.x=%f y=%f z=%f \n", viewerPosition.x, viewerPosition.y, viewerPosition.z); |
| 526 | 551 | //printf("node.x=%f y=%f z=%f \n", nodePosition.x, nodePosition.y, nodePosition.z); |
| @@ -533,7 +558,7 @@ bool VoxelSystem::falseColorizeDistanceFromViewOperation(VoxelNode* node, bool d · 6 unmodified lines | ||
| 533 | 558 | _nodeCount++; |
| 534 | 559 | |
| 535 | 560 | float distanceRatio = (_minDistance==_maxDistance) ? 1 : (distance - _minDistance)/(_maxDistance - _minDistance); |
| 536 | − | |
| 561 | + | |
| 537 | 562 | // We want to colorize this in 16 bug chunks of color |
| 538 | 563 | const unsigned char maxColor = 255; |
| 539 | 564 | const unsigned char colorBands = 16; |
| @@ -542,7 +567,7 @@ bool VoxelSystem::falseColorizeDistanceFromViewOperation(VoxelNode* node, bool d · 2 unmodified lines | ||
| 542 | 567 | unsigned char newR = (colorBand*(gradientOver/colorBands))+(maxColor-gradientOver); |
| 543 | 568 | unsigned char newG = 0; |
| 544 | 569 | unsigned char newB = 0; |
| 545 | − //printf("Setting color down=%s distance=%f min=%f max=%f distanceRatio=%f color=%d \n", | |
| 570 | + //printf("Setting color down=%s distance=%f min=%f max=%f distanceRatio=%f color=%d \n", | |
| 546 | 571 | // (down ? "TRUE" : "FALSE"), distance, _minDistance, _maxDistance, distanceRatio, (int)newR); |
| 547 | 572 | |
| 548 | 573 | node->setFalseColor(newR,newG,newB); |
| @@ -568,7 +593,7 @@ bool VoxelSystem::getDistanceFromViewRangeOperation(VoxelNode* node, bool down, · 19 unmodified lines | ||
| 568 | 593 | //printf("getDistanceFromViewRangeOperation() down=%s\n",(down ? "TRUE" : "FALSE")); |
| 569 | 594 | |
| 570 | 595 | ViewFrustum* viewFrustum = (ViewFrustum*) extraData; |
| 571 | − | |
| 596 | + | |
| 572 | 597 | // only do this for truly colored voxels... |
| 573 | 598 | if (node->isColored()) { |
| 574 | 599 | |
| @@ -614,7 +639,7 @@ void VoxelSystem::falseColorizeDistanceFromView(ViewFrustum* viewFrustum) { · 39 unmodified lines | ||
| 614 | 639 | printf("determining distance range for %d nodes\n",_nodeCount); |
| 615 | 640 | |
| 616 | 641 | _nodeCount = 0; |
| 617 | − | |
| 642 | + | |
| 618 | 643 | tree->recurseTreeWithOperation(falseColorizeDistanceFromViewOperation,(void*)viewFrustum); |
| 619 | 644 | printf("setting in distance false color for %d nodes\n",_nodeCount); |
| 620 | 645 | setupNewVoxelsForDrawing(); |