History

clean up application access to deleteVoxelAt()/createVoxel()/getVoxelAt() to access VoxelTree directly

ZappoMan committed 12 years ago

Commit ded73281 parent f09521f6 files · +13 −53Browse files

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

Unified · Split

interface/src/VoxelSystem.cpp+0−28
@@ -2302,34 +2302,6 @@ bool VoxelSystem::findCapsulePenetration(const glm::vec3& start, const glm::vec3 · 2301 unmodified lines
2302 return result;2302 return result;
2303}2303}
2304 2304
2305void VoxelSystem::deleteVoxelAt(float x, float y, float z, float s) {
2306 PerformanceWarning warn(Menu::getInstance()->isOptionChecked(MenuOption::PipelineWarnings),
2307 "VoxelSystem::deleteVoxelAt()");
2308 _tree->lockForWrite();
2309 _tree->deleteVoxelAt(x, y, z, s);
2310 _tree->unlock();
2311
2312 // redraw!
2313 setupNewVoxelsForDrawing(); // do we even need to do this? Or will the next network receive kick in?
2314};
2315
2316VoxelTreeElement* VoxelSystem::getVoxelAt(float x, float y, float z, float s) const {
2317 return _tree->getVoxelAt(x, y, z, s);
2318};
2319
2320void VoxelSystem::createVoxel(float x, float y, float z, float s,
2321 unsigned char red, unsigned char green, unsigned char blue, bool destructive) {
2322
2323 PerformanceWarning warn(Menu::getInstance()->isOptionChecked(MenuOption::PipelineWarnings),
2324 "VoxelSystem::createVoxel()");
2325
2326 _tree->lockForWrite();
2327 _tree->createVoxel(x, y, z, s, red, green, blue, destructive);
2328 _tree->unlock();
2329
2330 setupNewVoxelsForDrawing();
2331};
2332
2333void VoxelSystem::copySubTreeIntoNewTree(VoxelTreeElement* startNode, VoxelSystem* destination, bool rebaseToRoot) {2305void VoxelSystem::copySubTreeIntoNewTree(VoxelTreeElement* startNode, VoxelSystem* destination, bool rebaseToRoot) {
2334 _tree->copySubTreeIntoNewTree(startNode, destination->_tree, rebaseToRoot);2306 _tree->copySubTreeIntoNewTree(startNode, destination->_tree, rebaseToRoot);
2335 destination->setupNewVoxelsForDrawing();2307 destination->setupNewVoxelsForDrawing();