Some tidying up of the LOD work.

This commit is contained in:
David Williams
2010-02-07 23:48:33 +00:00
parent 1448f95b0a
commit d3ad3d985b
3 changed files with 53 additions and 48 deletions

View File

@ -70,14 +70,14 @@ namespace PolyVox
POLYVOX_SHARED_PTR<IndexedSurfacePatch> extractSubset(std::set<uint8_t> setMaterials);
void generateAveragedFaceNormals(bool bNormalise, bool bIncludeEdgeVertices = false);
void generateMaterialWeightedNormals();
//Vector3DInt32 m_v3dRegionPosition; //FIXME - remove this?
/*void growMaterialBoundary(void);
int countMaterialBoundary(void);*/
bool isSubset(std::bitset<7> a, std::bitset<7> b);
bool isSubset(std::bitset<VF_NO_OF_FLAGS> a, std::bitset<VF_NO_OF_FLAGS> b);
void decimate(float fMinDotProductForCollapse = 0.999f);
@ -103,6 +103,12 @@ namespace PolyVox
//which cover a whole triangle are counted. Materials which only
//exist on a material boundary do not count.
std::set<uint8_t> m_mapUsedMaterials;
private:
void countNoOfNeighboursUsingMaterial(void);
//Data structures used during decimation
std::vector<uint8_t> m_vecNoOfNeighboursUsingMaterial;
};
}

View File

@ -36,13 +36,14 @@ namespace PolyVox
{
enum POLYVOXCORE_API VertexFlags
{
VF_ON_MATERIAL_EDGE = 0x00,
VF_ON_GEOMETRY_EDGE_NEG_X = 0x01,
VF_ON_GEOMETRY_EDGE_POS_X = 0x02,
VF_ON_GEOMETRY_EDGE_NEG_Y = 0x03,
VF_ON_GEOMETRY_EDGE_POS_Y = 0x04,
VF_ON_GEOMETRY_EDGE_NEG_Z = 0x05,
VF_ON_GEOMETRY_EDGE_POS_Z = 0x06,
VF_ON_MATERIAL_EDGE,
VF_ON_GEOMETRY_EDGE_NEG_X,
VF_ON_GEOMETRY_EDGE_POS_X ,
VF_ON_GEOMETRY_EDGE_NEG_Y ,
VF_ON_GEOMETRY_EDGE_POS_Y ,
VF_ON_GEOMETRY_EDGE_NEG_Z ,
VF_ON_GEOMETRY_EDGE_POS_Z,
VF_NO_OF_FLAGS
};
class POLYVOXCORE_API SurfaceVertex
@ -81,11 +82,8 @@ namespace PolyVox
public:
Vector3DFloat position;
Vector3DFloat normal;
Vector3DFloat materialNormal;
int noOfMatchingNeighbours;
std::vector<uint8_t> neighbourMaterials;
float material; //FIXME: This shouldn't be float on CPU?
std::bitset<7> m_bFlags;
std::bitset<VF_NO_OF_FLAGS> m_bFlags;
};