Added flag to test if we are on a material boundary.

This commit is contained in:
David Williams
2009-09-01 17:24:00 +00:00
parent 5ca6178e10
commit 10c0f794b1
4 changed files with 12 additions and 2 deletions

View File

@ -95,6 +95,13 @@ namespace PolyVox
m_vecTriangleIndices.push_back(index0);
m_vecTriangleIndices.push_back(index1);
m_vecTriangleIndices.push_back(index2);
if((m_vecVertices[index0].material != m_vecVertices[index1].material) || (m_vecVertices[index0].material != m_vecVertices[index2].material))
{
m_vecVertices[index0].m_bIsMaterialEdgeVertex = true;
m_vecVertices[index1].m_bIsMaterialEdgeVertex = true;
m_vecVertices[index2].m_bIsMaterialEdgeVertex = true;
}
}
uint32_t IndexedSurfacePatch::addVertex(const SurfaceVertex& vertex)

View File

@ -32,6 +32,7 @@ namespace PolyVox
SurfaceVertex::SurfaceVertex(Vector3DFloat positionToSet, float materialToSet)
:position(positionToSet)
,material(materialToSet)
,m_bIsMaterialEdgeVertex(false)
{
}
@ -40,6 +41,7 @@ namespace PolyVox
:position(positionToSet)
,normal(normalToSet)
,material(materialToSet)
,m_bIsMaterialEdgeVertex(false)
{
}