History

Return the box face, as well as the distance, from the ray intersection test. Use it to determine which voxel neighbor we create when adding.

Andrzej Kapolka committed 13 years ago

Commit 7ff8b841 parent 2b9c2ca7 files · +68 −19Browse files

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

Unified · Split

interface/src/VoxelSystem.cpp+3−2
@@ -680,9 +680,10 @@ void VoxelSystem::removeOutOfView() { · 679 unmodified lines
680 }680 }
681}681}
682 682
683bool VoxelSystem::findRayIntersection(const glm::vec3& origin, const glm::vec3& direction, VoxelDetail& detail, float& distance) {683bool VoxelSystem::findRayIntersection(const glm::vec3& origin, const glm::vec3& direction,
684 VoxelDetail& detail, float& distance, BoxFace& face) {
684 VoxelNode* node;685 VoxelNode* node;
685 if (!_tree->findRayIntersection(origin, direction, node, distance)) {686 if (!_tree->findRayIntersection(origin, direction, node, distance, face)) {
686 return false;687 return false;
687 }688 }
688 detail.x = node->getCorner().x;689 detail.x = node->getCorner().x;