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
680680 }
681681 }
682682
683−bool VoxelSystem::findRayIntersection(const glm::vec3& origin, const glm::vec3& direction, VoxelDetail& detail, float& distance) {
683+bool VoxelSystem::findRayIntersection(const glm::vec3& origin, const glm::vec3& direction,
684+ VoxelDetail& detail, float& distance, BoxFace& face) {
684685 VoxelNode* node;
685− if (!_tree->findRayIntersection(origin, direction, node, distance)) {
686+ if (!_tree->findRayIntersection(origin, direction, node, distance, face)) {
686687 return false;
687688 }
688689 detail.x = node->getCorner().x;