Added code to determine how much memory a volume is using.
Also map of homogenous regions is no longer static.
This commit is contained in:
@ -51,6 +51,7 @@ namespace PolyVox
|
||||
|
||||
void fill(VoxelType tValue);
|
||||
bool isHomogeneous(void);
|
||||
uint32_t sizeInChars(void);
|
||||
|
||||
private:
|
||||
uint16_t m_uSideLength;
|
||||
|
@ -169,5 +169,19 @@ namespace PolyVox
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
template <typename VoxelType>
|
||||
uint32_t Block<VoxelType>::sizeInChars(void)
|
||||
{
|
||||
uint32_t uSizeInChars = sizeof(Block<VoxelType>);
|
||||
|
||||
if(m_tData != 0)
|
||||
{
|
||||
const uint32_t uNoOfVoxels = m_uSideLength * m_uSideLength * m_uSideLength;
|
||||
uSizeInChars += uNoOfVoxels * sizeof(VoxelType);
|
||||
}
|
||||
|
||||
return uSizeInChars;
|
||||
}
|
||||
#pragma endregion
|
||||
}
|
||||
|
Reference in New Issue
Block a user