summaryrefslogtreecommitdiff
path: root/indra/llmath/llvolume.cpp
diff options
context:
space:
mode:
authorDave Parks <davep@lindenlab.com>2010-08-06 11:57:03 -0500
committerDave Parks <davep@lindenlab.com>2010-08-06 11:57:03 -0500
commit129e31373eaef9cbd74451bfeb4ad62b64d17250 (patch)
treec5ca92d1118a8918a293375720b0c39fc3146c6d /indra/llmath/llvolume.cpp
parenta919bda24dfc6fb7fc031546e69ed7f531d828e8 (diff)
Better < operator for LLVolumeFace::VertexData
Diffstat (limited to 'indra/llmath/llvolume.cpp')
-rw-r--r--indra/llmath/llvolume.cpp40
1 files changed, 33 insertions, 7 deletions
diff --git a/indra/llmath/llvolume.cpp b/indra/llmath/llvolume.cpp
index 0976487cbd..bba0a6d089 100644
--- a/indra/llmath/llvolume.cpp
+++ b/indra/llmath/llvolume.cpp
@@ -2055,22 +2055,48 @@ void LLVolumeFace::VertexData::setNormal(const LLVector4a& norm)
bool LLVolumeFace::VertexData::operator<(const LLVolumeFace::VertexData& rhs)const
{
- if (mData[POSITION].notEqual3(rhs.getPosition()))
+ const F32* lp = this->getPosition().getF32();
+ const F32* rp = rhs.getPosition().getF32();
+
+ if (lp[0] != rp[0])
+ {
+ return lp[0] < rp[0];
+ }
+
+ if (rp[1] != lp[1])
+ {
+ return lp[1] < rp[1];
+ }
+
+ if (rp[2] != lp[2])
+ {
+ return lp[2] < rp[2];
+ }
+
+ lp = getNormal().getF32();
+ rp = rhs.getNormal().getF32();
+
+ if (lp[0] != rp[0])
+ {
+ return lp[0] < rp[0];
+ }
+
+ if (rp[1] != lp[1])
{
- return mData[POSITION].less3(rhs.getPosition());
+ return lp[1] < rp[1];
}
- if (mData[NORMAL].notEqual3(rhs.getNormal()))
+ if (rp[2] != lp[2])
{
- return mData[NORMAL].less3(rhs.getNormal());
+ return lp[2] < rp[2];
}
- if (mTexCoord != rhs.mTexCoord)
+ if (mTexCoord.mV[0] != rhs.mTexCoord.mV[0])
{
- return mTexCoord < rhs.mTexCoord;
+ return mTexCoord.mV[0] < rhs.mTexCoord.mV[0];
}
- return false;
+ return mTexCoord.mV[1] < rhs.mTexCoord.mV[1];
}
bool LLVolumeFace::VertexData::operator==(const LLVolumeFace::VertexData& rhs)const