diff options
author | Monroe Williams <monroe@lindenlab.com> | 2007-08-02 01:18:34 +0000 |
---|---|---|
committer | Monroe Williams <monroe@lindenlab.com> | 2007-08-02 01:18:34 +0000 |
commit | 7138fb673ac3df46b9cb5f23d0d74e70fdd2b6b3 (patch) | |
tree | 3c34a3a180b5275bd4166b0056765c5868f56447 /indra/llmath | |
parent | f6a10b3214d79df4e8f5768acaa68edbd2de5620 (diff) |
Merge down from Branch_1-18-1:
svn merge --ignore-ancestry svn+ssh://svn.lindenlab.com/svn/linden/release@66449 svn+ssh://svn.lindenlab.com/svn/linden/branches/Branch_1-18-1@67131
Diffstat (limited to 'indra/llmath')
-rw-r--r-- | indra/llmath/llrect.h | 47 |
1 files changed, 14 insertions, 33 deletions
diff --git a/indra/llmath/llrect.h b/indra/llmath/llrect.h index 92e415155b..12f702a197 100644 --- a/indra/llmath/llrect.h +++ b/indra/llmath/llrect.h @@ -193,47 +193,28 @@ public: mBottom = llmin(mBottom, mTop); } - friend const LLRectBase& operator|=(LLRectBase &a, const LLRectBase &b) // Return rect including a & b + void unionWith(const LLRectBase &other) { - a.mLeft = llmin(a.mLeft, b.mLeft); - a.mRight = llmax(a.mRight, b.mRight); - a.mBottom = llmin(a.mBottom, b.mBottom); - a.mTop = llmax(a.mTop, b.mTop); - return a; + mLeft = llmin(mLeft, other.mLeft); + mRight = llmax(mRight, other.mRight); + mBottom = llmin(mBottom, other.mBottom); + mTop = llmax(mTop, other.mTop); } - friend LLRectBase operator|(const LLRectBase &a, const LLRectBase &b) // Return rect including a & b + void intersectWith(const LLRectBase &other) { - LLRectBase<Type> result; - result.mLeft = llmin(a.mLeft, b.mLeft); - result.mRight = llmax(a.mRight, b.mRight); - result.mBottom = llmin(a.mBottom, b.mBottom); - result.mTop = llmax(a.mTop, b.mTop); - return result; - } - - friend const LLRectBase& operator&=(LLRectBase &a, const LLRectBase &b) // set a to rect where a intersects b - { - a.mLeft = llmax(a.mLeft, b.mLeft); - a.mRight = llmin(a.mRight, b.mRight); - a.mBottom = llmax(a.mBottom, b.mBottom); - a.mTop = llmin(a.mTop, b.mTop); - if (a.mLeft > a.mRight) + mLeft = llmax(mLeft, other.mLeft); + mRight = llmin(mRight, other.mRight); + mBottom = llmax(mBottom, other.mBottom); + mTop = llmin(mTop, other.mTop); + if (mLeft > mRight) { - a.mLeft = a.mRight; + mLeft = mRight; } - if (a.mBottom > a.mTop) + if (mBottom > mTop) { - a.mBottom = a.mTop; + mBottom = mTop; } - return a; - } - - friend LLRectBase operator&(const LLRectBase &a, const LLRectBase &b) // Return rect where a intersects b - { - LLRectBase result = a; - result &= b; - return result; } friend std::ostream &operator<<(std::ostream &s, const LLRectBase &rect) |