Initial LOD working.
This commit is contained in:
@ -54,6 +54,7 @@ namespace PolyVox
|
||||
bool containsPoint(const Vector3DInt32& pos, uint16 boundary) const;
|
||||
BlockVolumeIterator<VoxelType> firstVoxel(void);
|
||||
void idle(uint32 uAmount);
|
||||
bool isRegionHomogenous(const Region& region);
|
||||
BlockVolumeIterator<VoxelType> lastVoxel(void);
|
||||
|
||||
private:
|
||||
|
@ -21,6 +21,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
|
||||
#pragma region Headers
|
||||
#include "Block.h"
|
||||
#include "BlockVolumeIterator.h"
|
||||
#include "Region.h"
|
||||
#include "Vector.h"
|
||||
|
||||
@ -204,6 +205,28 @@ namespace PolyVox
|
||||
{
|
||||
}
|
||||
|
||||
template <typename VoxelType>
|
||||
bool BlockVolume<VoxelType>::isRegionHomogenous(const Region& region)
|
||||
{
|
||||
BlockVolumeIterator<VoxelType> iter(*this);
|
||||
iter.setValidRegion(region);
|
||||
iter.setPosition(static_cast<Vector3DInt16>(region.getLowerCorner()));
|
||||
|
||||
VoxelType tFirst = iter.getVoxel();
|
||||
iter.moveForwardInRegionXYZ();
|
||||
|
||||
do
|
||||
{
|
||||
VoxelType tCurrent = iter.getVoxel();
|
||||
if(tCurrent != tFirst)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}while(iter.moveForwardInRegionXYZ());
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
template <typename VoxelType>
|
||||
BlockVolumeIterator<VoxelType> BlockVolume<VoxelType>::lastVoxel(void)
|
||||
{
|
||||
|
Reference in New Issue
Block a user