mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-07-22 19:49:19 +02:00
limit vertex deduplication search to 1000 vertices, it was too slow
This commit is contained in:
@@ -202,7 +202,7 @@ void calculate_indices( index_array &Indices, vertex_array &Vertices, float tole
|
|||||||
// if found, remap these to use our current vertex instead
|
// if found, remap these to use our current vertex instead
|
||||||
auto vertex { Vertices[ idx ] };
|
auto vertex { Vertices[ idx ] };
|
||||||
auto matchiter { std::cbegin( Vertices ) + idx };
|
auto matchiter { std::cbegin( Vertices ) + idx };
|
||||||
for( auto matchidx = idx + 1; matchidx < Indices.size(); ++matchidx ) {
|
for( auto matchidx = idx + 1; matchidx < Indices.size() && matchidx < idx + 1000; ++matchidx ) {
|
||||||
++matchiter;
|
++matchiter;
|
||||||
if( ( glm::all( glm::epsilonEqual( vertex.position, matchiter->position, matchtolerance ) ) )
|
if( ( glm::all( glm::epsilonEqual( vertex.position, matchiter->position, matchtolerance ) ) )
|
||||||
&& ( glm::all( glm::epsilonEqual( vertex.normal, matchiter->normal, matchtolerance ) ) )
|
&& ( glm::all( glm::epsilonEqual( vertex.normal, matchiter->normal, matchtolerance ) ) )
|
||||||
|
|||||||
Reference in New Issue
Block a user