Commit f531b58e authored by Jan Möbius's avatar Jan Möbius
Browse files

Merge branch 'MCIsoFix' into 'master'

fix detection of isolated vertices in meshcompiler

proper branch now without the triangulator

See merge request !6
parents 4f9506f6 af3f051a
......@@ -1058,7 +1058,7 @@ MeshCompiler::VertexSplitter::VertexSplitter(int _numAttribs,
int _numVerts,
int _numWorstCase,
float _estBufferIncrease)
: numAttribs(_numAttribs), numVerts(_numVerts)
: numAttribs(_numAttribs), numVerts(_numVerts), numBaseVerts(_numVerts)
{
if (_numWorstCase <= 0)
_numWorstCase = int(float(_numVerts) * (_estBufferIncrease + 1.0f));
......@@ -1192,7 +1192,7 @@ void MeshCompiler::VertexSplitter::setAttribs( const int id, int* attr )
bool MeshCompiler::VertexSplitter::isIsolated( const int vertexPosID )
{
return getNext(vertexPosID) < 0;
return (vertexPosID < numBaseVerts) && (getNext(vertexPosID) < 0);
}
......
......@@ -911,6 +911,9 @@ private:
/// number of vertex combinations currently in use
int numVerts;
/// number of input vertex positions
const int numBaseVerts;
/** split list format:
for each vertex: [next split, attribute ids]
next split: -1 -> not split yet
......@@ -1020,6 +1023,8 @@ private:
// create face mapping: input id <-> final tri id
void createFaceMap();
public:
/** \brief Multi-threaded version of getIndexAdjBuffer
*
* Uses a multi-threaded method based on the vertex-triangle adjacency list to compute the index buffer with adjacency.
......@@ -1029,7 +1034,6 @@ private:
*/
void getIndexAdjBuffer_MT(void* _dst, const int _borderIndex = -1);
public:
// debugging tools
/// dump mesh info to text file
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment