Restore merging of near-identical vertices for JoinIdenticalVertices (#6278)

* Restore merging of near-identical vertices for JoinIdenticalVertices

---------

Co-authored-by: Kim Kulling <kimkulling@users.noreply.github.com>
This commit is contained in:
Matt Penny
2025-09-21 04:57:17 -04:00
committed by GitHub
parent 0581ed5f11
commit 489c8d565b
2 changed files with 60 additions and 24 deletions

View File

@@ -183,29 +183,6 @@ struct Vertex {
return *this;
}
bool operator < (const Vertex & o) const {
if (position < o.position) return true;
if (position != o.position) return false;
if (normal < o.normal) return true;
if (normal != o.normal) return false;
for (uint32_t i = 0; i < AI_MAX_NUMBER_OF_TEXTURECOORDS; i ++) {
if (texcoords[i] < o.texcoords[i]) return true;
if (texcoords[i] != o.texcoords[i]) return false;
}
// note that tangent/bitangent are not checked since they are optional
for (uint32_t i = 0; i < AI_MAX_NUMBER_OF_COLOR_SETS; i ++) {
if (colors[i] < o.colors[i]) return true;
if (colors[i] != o.colors[i]) return false;
}
// if reached this point, they are equal
return false;
}
// ----------------------------------------------------------------------------
/// Convert back to non-interleaved storage
void SortBack(aiMesh* out, unsigned int idx) const {