Fixed a bug which allowed duplicate vertices to get through.
This commit is contained in:
parent
19079e97d8
commit
f756f764bc
@ -259,12 +259,7 @@ namespace PolyVox
|
|||||||
int32_t iIndex = static_cast<int32_t>(rEntry.iIndex);
|
int32_t iIndex = static_cast<int32_t>(rEntry.iIndex);
|
||||||
uint8_t uMaterial = static_cast<uint8_t>(rEntry.uMaterial);
|
uint8_t uMaterial = static_cast<uint8_t>(rEntry.uMaterial);
|
||||||
|
|
||||||
//If we have an existing vertex and the material matches then we can return it.
|
if(iIndex == -1)
|
||||||
if((iIndex != -1) && (uMaterial == uMaterialIn))
|
|
||||||
{
|
|
||||||
return iIndex;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
{
|
||||||
//No vertices matched and we've now hit an empty space. Fill it by creating a vertex.
|
//No vertices matched and we've now hit an empty space. Fill it by creating a vertex.
|
||||||
uint32_t temp = m_meshCurrent->addVertex(PositionMaterial(Vector3DFloat(fX, fY, fZ), uMaterialIn));
|
uint32_t temp = m_meshCurrent->addVertex(PositionMaterial(Vector3DFloat(fX, fY, fZ), uMaterialIn));
|
||||||
@ -276,6 +271,12 @@ namespace PolyVox
|
|||||||
|
|
||||||
return temp;
|
return temp;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//If we have an existing vertex and the material matches then we can return it.
|
||||||
|
if(uMaterial == uMaterialIn)
|
||||||
|
{
|
||||||
|
return iIndex;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//If we exit the loop here then apparently all the slots were full but none of
|
//If we exit the loop here then apparently all the slots were full but none of
|
||||||
|
Loading…
x
Reference in New Issue
Block a user