diff --git a/WFObj.cc b/WFObj.cc index 690aa09..1ec8c8f 100644 --- a/WFObj.cc +++ b/WFObj.cc @@ -326,3 +326,12 @@ bool WFObj::loadfile(const char *path, Buffer *buff) { /* TODO */ } + +bool WFObj::VertexRef::operator<(const VertexRef & other) +{ + if (vertex != other.vertex) + return vertex < other.vertex; + if (texture != other.texture) + return texture < other.texture; + return normal < other.normal; +} diff --git a/WFObj.h b/WFObj.h index 02375d5..c1c4b32 100644 --- a/WFObj.h +++ b/WFObj.h @@ -51,6 +51,7 @@ protected: int vertex; int texture; int normal; + bool operator<(const VertexRef & other); }; class Face