diff options
| author | Oz Linden <oz@lindenlab.com> | 2011-01-17 10:30:36 -0500 |
|---|---|---|
| committer | Oz Linden <oz@lindenlab.com> | 2011-01-17 10:30:36 -0500 |
| commit | 74fdba829574e5132fec6633b0ddcd2feb9fe51e (patch) | |
| tree | bf17dba56b38a3b228f6174f950e3d405b6329af /indra/llmath | |
| parent | fe28f89e7e79b9de5a455b9c9833d243d8039774 (diff) | |
| parent | 1d7b46e2c32c6bdf2e6cf5a8b9dcb0c8cb767b1b (diff) | |
merge changes for vwr-24420
Diffstat (limited to 'indra/llmath')
| -rw-r--r-- | indra/llmath/llbbox.cpp | 22 | ||||
| -rw-r--r-- | indra/llmath/llbbox.h | 4 |
2 files changed, 26 insertions, 0 deletions
diff --git a/indra/llmath/llbbox.cpp b/indra/llmath/llbbox.cpp index b46a6e03d2..3e2c05a6e6 100644 --- a/indra/llmath/llbbox.cpp +++ b/indra/llmath/llbbox.cpp @@ -89,6 +89,19 @@ void LLBBox::addBBoxAgent(const LLBBox& b) } } +LLBBox LLBBox::getAxisAligned() const +{ + // no rotation = 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 +160,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..28e69b75e1 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,8 @@ 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); |
