Showing the changes to interface/src/VoxelSystem.cpp (1 of 5 files). Show all
Unified · Split
| @@ -109,6 +109,7 @@ VoxelSystem::VoxelSystem(float treeScale, int maxVoxels) · 108 unmodified lines | ||
| 109 | 109 | _useFastVoxelPipeline = false; |
| 110 | 110 | |
| 111 | 111 | _culledOnce = false; |
| 112 | + _inhideOutOfView = false; | |
| 112 | 113 | } |
| 113 | 114 | |
| 114 | 115 | void VoxelSystem::voxelDeleted(VoxelNode* node) { |
| @@ -1848,6 +1849,14 @@ public: · 1733 unmodified lines | ||
| 1848 | 1849 | }; |
| 1849 | 1850 | |
| 1850 | 1851 | void VoxelSystem::hideOutOfView(bool forceFullFrustum) { |
| 1852 | + | |
| 1853 | + // don't re-enter... | |
| 1854 | + if (_inhideOutOfView) { | |
| 1855 | + return; | |
| 1856 | + } | |
| 1857 | + | |
| 1858 | + _inhideOutOfView = true; | |
| 1859 | + | |
| 1851 | 1860 | bool showDebugDetails = Menu::getInstance()->isOptionChecked(MenuOption::PipelineWarnings); |
| 1852 | 1861 | PerformanceWarning warn(showDebugDetails, "hideOutOfView()", showDebugDetails); |
| 1853 | 1862 | bool widenFrustum = true; |
| @@ -1879,10 +1888,13 @@ void VoxelSystem::hideOutOfView(bool forceFullFrustum) { · 25 unmodified lines | ||
| 1879 | 1888 | |
| 1880 | 1889 | if (!forceFullFrustum && _culledOnce && args.lastViewFrustum.isVerySimilar(args.thisViewFrustum)) { |
| 1881 | 1890 | //printf("view frustum hasn't changed BAIL!!!\n"); |
| 1891 | + _inhideOutOfView = false; | |
| 1882 | 1892 | return; |
| 1883 | 1893 | } |
| 1884 | − | |
| 1894 | + | |
| 1895 | + pthread_mutex_lock(&_treeLock); | |
| 1885 | 1896 | _tree->recurseTreeWithOperation(hideOutOfViewOperation,(void*)&args); |
| 1897 | + pthread_mutex_unlock(&_treeLock); | |
| 1886 | 1898 | _lastCulledViewFrustum = args.thisViewFrustum; // save last stable |
| 1887 | 1899 | _culledOnce = true; |
| 1888 | 1900 | |
| @@ -1900,6 +1912,7 @@ void VoxelSystem::hideOutOfView(bool forceFullFrustum) { · 11 unmodified lines | ||
| 1900 | 1912 | args.nodesInsideInside, args.nodesIntersectInside, args.nodesOutsideOutside |
| 1901 | 1913 | ); |
| 1902 | 1914 | } |
| 1915 | + _inhideOutOfView = false; | |
| 1903 | 1916 | } |
| 1904 | 1917 | |
| 1905 | 1918 | bool VoxelSystem::hideAllSubTreeOperation(VoxelNode* node, void* extraData) { |