Showing the changes to interface/src/VoxelSystem.cpp (1 of 5 files). Show all
Unified · Split
| @@ -2256,30 +2256,6 @@ bool VoxelSystem::hideOutOfViewOperation(OctreeElement* element, void* extraData · 2255 unmodified lines | |||
| 2256 | } | 2256 | } |
| 2257 | 2257 | ||
| 2258 | 2258 | ||
| 2259 | bool VoxelSystem::findRayIntersection(const glm::vec3& origin, const glm::vec3& direction, | ||
| 2260 | VoxelDetail& detail, float& distance, BoxFace& face) { | ||
| 2261 | |||
| 2262 | PerformanceWarning warn(Menu::getInstance()->isOptionChecked(MenuOption::PipelineWarnings), | ||
| 2263 | "VoxelSystem::findRayIntersection()"); | ||
| 2264 | bool result = false; // assume no intersection | ||
| 2265 | if (_tree->tryLockForRead()) { | ||
| 2266 | OctreeElement* element; | ||
| 2267 | result = _tree->findRayIntersection(origin, direction, element, distance, face); | ||
| 2268 | if (result) { | ||
| 2269 | VoxelTreeElement* voxel = (VoxelTreeElement*)element; | ||
| 2270 | detail.x = voxel->getCorner().x; | ||
| 2271 | detail.y = voxel->getCorner().y; | ||
| 2272 | detail.z = voxel->getCorner().z; | ||
| 2273 | detail.s = voxel->getScale(); | ||
| 2274 | detail.red = voxel->getColor()[0]; | ||
| 2275 | detail.green = voxel->getColor()[1]; | ||
| 2276 | detail.blue = voxel->getColor()[2]; | ||
| 2277 | } | ||
| 2278 | _tree->unlock(); | ||
| 2279 | } | ||
| 2280 | return result; | ||
| 2281 | } | ||
| 2282 | |||
| 2283 | void VoxelSystem::copySubTreeIntoNewTree(VoxelTreeElement* startNode, VoxelSystem* destination, bool rebaseToRoot) { | 2259 | void VoxelSystem::copySubTreeIntoNewTree(VoxelTreeElement* startNode, VoxelSystem* destination, bool rebaseToRoot) { |
| 2284 | _tree->copySubTreeIntoNewTree(startNode, destination->_tree, rebaseToRoot); | 2260 | _tree->copySubTreeIntoNewTree(startNode, destination->_tree, rebaseToRoot); |
| 2285 | destination->setupNewVoxelsForDrawing(); | 2261 | destination->setupNewVoxelsForDrawing(); |