Improvements to CubicSurfaceExtractor. Now faster and eliminates duplicated vertices.

This commit is contained in:
David Williams
2010-10-20 20:29:09 +00:00
parent 8df28b87fa
commit 0ca8a334f2
2 changed files with 123 additions and 69 deletions

View File

@ -31,6 +31,12 @@ freely, subject to the following restrictions:
namespace PolyVox
{
struct IndexAndMaterial
{
int32_t iIndex;
uint8_t uMaterial;
};
template <typename VoxelType>
class CubicSurfaceExtractor
{
@ -39,6 +45,8 @@ namespace PolyVox
void execute();
int32_t addVertex(float fX, float fY, float fZ, uint8_t uMaterial);
private:
//The volume data and a sampler to access it.
Volume<VoxelType>* m_volData;
@ -50,6 +58,8 @@ namespace PolyVox
//Information about the region we are currently processing
Region m_regSizeInVoxels;
Region m_regSizeInCells;
Array<4, IndexAndMaterial> m_vertices;
};
}