diff options
author | Andrew Meadows <andrew@lindenlab.com> | 2010-11-18 15:55:53 -0800 |
---|---|---|
committer | Andrew Meadows <andrew@lindenlab.com> | 2010-11-18 15:55:53 -0800 |
commit | 424786d8d05093abd816a3decd86aace64816179 (patch) | |
tree | 689b5bb532202c448fa9221d12aacfd482a0b14c /indra/llmath | |
parent | 807007649a32c5276f31c5f73d6fade7d059ce07 (diff) |
Added viewer-side "object overlaps parcel" check encroachment returnabilty UI
Reviewed with Falcon
Diffstat (limited to 'indra/llmath')
-rw-r--r-- | indra/llmath/llbbox.cpp | 23 | ||||
-rw-r--r-- | indra/llmath/llbbox.h | 5 |
2 files changed, 28 insertions, 0 deletions
diff --git a/indra/llmath/llbbox.cpp b/indra/llmath/llbbox.cpp index b46a6e03d2..72c906b5ca 100644 --- a/indra/llmath/llbbox.cpp +++ b/indra/llmath/llbbox.cpp @@ -89,6 +89,20 @@ void LLBBox::addBBoxAgent(const LLBBox& b) } } +LLBBox LLBBox::getAxisAligned() const +{ + // no rotiation = axis aligned rotation + LLBBox aligned(mPosAgent, LLQuaternion(), LLVector3(), LLVector3()); + + // add the center point so that it's not empty + aligned.addPointAgent(mPosAgent); + + // add our BBox + aligned.addBBoxAgent(*this); + + return aligned; +} + void LLBBox::expand( F32 delta ) { @@ -147,6 +161,15 @@ BOOL LLBBox::containsPointAgent(const LLVector3& p) const return containsPointLocal(point_local); } +LLVector3 LLBBox::getMinAgent() const +{ + return localToAgent(mMinLocal); +} + +LLVector3 LLBBox::getMaxAgent() const +{ + return localToAgent(mMaxLocal); +} /* LLBBox operator*(const LLBBox &a, const LLMatrix4 &b) diff --git a/indra/llmath/llbbox.h b/indra/llmath/llbbox.h index 5b911793f0..a0d434b051 100644 --- a/indra/llmath/llbbox.h +++ b/indra/llmath/llbbox.h @@ -51,9 +51,11 @@ public: const LLVector3& getPositionAgent() const { return mPosAgent; } const LLQuaternion& getRotation() const { return mRotation; } + LLVector3 getMinAgent() const; const LLVector3& getMinLocal() const { return mMinLocal; } void setMinLocal( const LLVector3& min ) { mMinLocal = min; } + LLVector3 getMaxAgent() const; const LLVector3& getMaxLocal() const { return mMaxLocal; } void setMaxLocal( const LLVector3& max ) { mMaxLocal = max; } @@ -80,6 +82,9 @@ public: LLVector3 localToAgentBasis(const LLVector3& v) const; LLVector3 agentToLocalBasis(const LLVector3& v) const; + // Get the smallest possible axis aligned bbox that contains this bbox + LLBBox getAxisAligned() const; + // friend LLBBox operator*(const LLBBox& a, const LLMatrix4& b); |