Showing the changes to interface/src/VoxelSystem.cpp (1 of 3 files). Show all
Unified · Split
| @@ -613,3 +613,18 @@ void VoxelSystem::removeOutOfView() { · 612 unmodified lines | |||
| 613 | _nodeCount = 0; | 613 | _nodeCount = 0; |
| 614 | _tree->recurseTreeWithOperation(removeOutOfViewOperation,(void*)this); | 614 | _tree->recurseTreeWithOperation(removeOutOfViewOperation,(void*)this); |
| 615 | } | 615 | } |
| 616 | |||
| 617 | bool VoxelSystem::findRayIntersection(const glm::vec3& origin, const glm::vec3& direction, VoxelDetail& detail, float& distance) { | ||
| 618 | VoxelNode* node; | ||
| 619 | if (!_tree->findRayIntersection(origin, direction, node, distance)) { | ||
| 620 | return false; | ||
| 621 | } | ||
| 622 | detail.x = node->getCorner().x; | ||
| 623 | detail.y = node->getCorner().y; | ||
| 624 | detail.z = node->getCorner().z; | ||
| 625 | detail.s = node->getScale(); | ||
| 626 | detail.red = node->getColor()[0]; | ||
| 627 | detail.green = node->getColor()[1]; | ||
| 628 | detail.blue = node->getColor()[2]; | ||
| 629 | return true; | ||
| 630 | } | ||