| 451 | |
| 452 | |
| 453 | unsigned int OcTreeDrawer::setCubeColorHeightmap(const octomap::OcTreeVolume& v, |
| 454 | const unsigned int& current_array_idx, |
| 455 | GLfloat** glColorArray) { |
| 456 | |
| 457 | if (glColorArray == NULL) return current_array_idx; |
| 458 | |
| 459 | unsigned int colorIdx = current_array_idx; |
| 460 | // color for all 4 vertices (same height) |
| 461 | for (int k = 0; k < 4; ++k) { |
| 462 | if (m_colorMode == CM_GRAY_HEIGHT) |
| 463 | SceneObject::heightMapGray(v.first.z(), *glColorArray + colorIdx); // sets r,g,b |
| 464 | else |
| 465 | SceneObject::heightMapColor(v.first.z(), *glColorArray + colorIdx); // sets r,g,b |
| 466 | // set Alpha value: |
| 467 | (*glColorArray)[colorIdx + 3] = m_alphaOccupied; |
| 468 | colorIdx += 4; |
| 469 | } |
| 470 | return colorIdx; |
| 471 | } |
| 472 | |
| 473 | unsigned int OcTreeDrawer::setCubeColorRGBA(const unsigned char& r, |
| 474 | const unsigned char& g, |