History

Working on voxel editing.

Andrzej Kapolka committed 13 years ago

Commit 785e55e1 parent 4e789dc3 files · +58 −1Browse files

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

Unified · Split

interface/src/VoxelSystem.cpp+15−0
@@ -613,3 +613,18 @@ void VoxelSystem::removeOutOfView() { · 612 unmodified lines
613613 _nodeCount = 0;
614614 _tree->recurseTreeWithOperation(removeOutOfViewOperation,(void*)this);
615615 }
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+}