Added flag to test if we are on a material boundary.
This commit is contained in:
parent
5ca6178e10
commit
10c0f794b1
@ -45,7 +45,7 @@ namespace PolyVox
|
|||||||
uint32_t getNoOfNonUniformTrianges(void) const;
|
uint32_t getNoOfNonUniformTrianges(void) const;
|
||||||
uint32_t getNoOfUniformTrianges(void) const;
|
uint32_t getNoOfUniformTrianges(void) const;
|
||||||
uint32_t getNoOfVertices(void) const;
|
uint32_t getNoOfVertices(void) const;
|
||||||
std::vector<SurfaceVertex>& getRawVertexData(void); //FIXME - this shoudl be removed
|
std::vector<SurfaceVertex>& getRawVertexData(void); //FIXME - this should be removed
|
||||||
const std::vector<SurfaceVertex>& getVertices(void) const;
|
const std::vector<SurfaceVertex>& getVertices(void) const;
|
||||||
|
|
||||||
void addTriangle(uint32_t index0, uint32_t index1, uint32_t index2);
|
void addTriangle(uint32_t index0, uint32_t index1, uint32_t index2);
|
||||||
|
@ -48,8 +48,9 @@ namespace PolyVox
|
|||||||
public:
|
public:
|
||||||
Vector3DFloat position;
|
Vector3DFloat position;
|
||||||
Vector3DFloat normal;
|
Vector3DFloat normal;
|
||||||
float material;
|
float material; //FIXME: This shouldn't be float on CPU?
|
||||||
bool m_bIsEdgeVertex;
|
bool m_bIsEdgeVertex;
|
||||||
|
bool m_bIsMaterialEdgeVertex;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -95,6 +95,13 @@ namespace PolyVox
|
|||||||
m_vecTriangleIndices.push_back(index0);
|
m_vecTriangleIndices.push_back(index0);
|
||||||
m_vecTriangleIndices.push_back(index1);
|
m_vecTriangleIndices.push_back(index1);
|
||||||
m_vecTriangleIndices.push_back(index2);
|
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)
|
uint32_t IndexedSurfacePatch::addVertex(const SurfaceVertex& vertex)
|
||||||
|
@ -32,6 +32,7 @@ namespace PolyVox
|
|||||||
SurfaceVertex::SurfaceVertex(Vector3DFloat positionToSet, float materialToSet)
|
SurfaceVertex::SurfaceVertex(Vector3DFloat positionToSet, float materialToSet)
|
||||||
:position(positionToSet)
|
:position(positionToSet)
|
||||||
,material(materialToSet)
|
,material(materialToSet)
|
||||||
|
,m_bIsMaterialEdgeVertex(false)
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -40,6 +41,7 @@ namespace PolyVox
|
|||||||
:position(positionToSet)
|
:position(positionToSet)
|
||||||
,normal(normalToSet)
|
,normal(normalToSet)
|
||||||
,material(materialToSet)
|
,material(materialToSet)
|
||||||
|
,m_bIsMaterialEdgeVertex(false)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user