Skip to content

Instantly share code, notes, and snippets.

@jose-villegas
Last active August 29, 2015 14:13
Show Gist options
  • Save jose-villegas/3aa7f4b95019a3f95a39 to your computer and use it in GitHub Desktop.
Save jose-villegas/3aa7f4b95019a3f95a39 to your computer and use it in GitHub Desktop.
auto it = std::find_if(progVertices.begin(), progVertices.end(),
[&minCostVertex](const std::pair<unsigned int, Vertex *> &index) {
// found smaller cost so swap vertex candidate
if (index.second->collapseCost < minCostVertex->collapseCost) {
minCostVertex = index.second;
// early loop break if the collapse cost is zero or really close to zero
if (minCostVertex->collapseCost > -glm::epsilon<float>() && minCostVertex->collapseCost < glm::epsilon<float>()) {
return true;
}
}
return false;
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment