From 424786d8d05093abd816a3decd86aace64816179 Mon Sep 17 00:00:00 2001
From: Andrew Meadows <andrew@lindenlab.com>
Date: Thu, 18 Nov 2010 15:55:53 -0800
Subject: Added viewer-side "object overlaps parcel" check encroachment
 returnabilty UI Reviewed with Falcon

---
 indra/llmath/llbbox.cpp | 23 +++++++++++++++++++++++
 indra/llmath/llbbox.h   |  5 +++++
 2 files changed, 28 insertions(+)

(limited to 'indra/llmath')

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);
 
-- 
cgit v1.2.3


From 64512b681e2f5582378d9943642a82c83cae30ac Mon Sep 17 00:00:00 2001
From: Andrew Meadows <andrew@lindenlab.com>
Date: Tue, 14 Dec 2010 08:52:33 -0800
Subject: ER-398 viewer's encroachment logic only uses bounding box of root
 prim Adding LLBBox::join() to allow us to compute the bounding box of a
 linked object

---
 indra/llmath/llbbox.cpp | 13 +++++++++++++
 indra/llmath/llbbox.h   |  5 ++++-
 2 files changed, 17 insertions(+), 1 deletion(-)

(limited to 'indra/llmath')

diff --git a/indra/llmath/llbbox.cpp b/indra/llmath/llbbox.cpp
index 72c906b5ca..67a305d269 100644
--- a/indra/llmath/llbbox.cpp
+++ b/indra/llmath/llbbox.cpp
@@ -102,6 +102,19 @@ LLBBox LLBBox::getAxisAligned() const
 
 	return aligned;
 }
+// Increases the size to contain other_box
+void LLBBox::join(const LLBBox& other_box)
+{
+	LLVector3 other_min = (other_box.mPosAgent - mPosAgent) - other_box.mMinLocal;
+	mMinLocal.mV[VX] = llmin( other_min.mV[VX], mMinLocal.mV[VX] );
+	mMinLocal.mV[VY] = llmin( other_min.mV[VY], mMinLocal.mV[VY] );
+	mMinLocal.mV[VZ] = llmin( other_min.mV[VZ], mMinLocal.mV[VZ] );
+
+	LLVector3 other_max = (other_box.mPosAgent - mPosAgent) + other_box.mMaxLocal;
+	mMaxLocal.mV[VX] = llmax( other_max.mV[VX], mMaxLocal.mV[VX] );
+	mMaxLocal.mV[VY] = llmax( other_max.mV[VY], mMaxLocal.mV[VY] );
+	mMaxLocal.mV[VZ] = llmax( other_max.mV[VZ], mMaxLocal.mV[VZ] );
+}
 
 
 void LLBBox::expand( F32 delta )
diff --git a/indra/llmath/llbbox.h b/indra/llmath/llbbox.h
index a0d434b051..8616320381 100644
--- a/indra/llmath/llbbox.h
+++ b/indra/llmath/llbbox.h
@@ -83,7 +83,10 @@ public:
 	LLVector3			agentToLocalBasis(const LLVector3& v) const;
 
 	// Get the smallest possible axis aligned bbox that contains this bbox
-	LLBBox               getAxisAligned() const;
+	LLBBox              getAxisAligned() const;
+
+	// Increases the size to contain other_box
+	void 				join(const LLBBox& other_box);
 
 
 //	friend LLBBox operator*(const LLBBox& a, const LLMatrix4& b);
-- 
cgit v1.2.3


From 3be87bb04685e971965ab5ac4166165c3785476f Mon Sep 17 00:00:00 2001
From: Andrew Meadows <andrew@lindenlab.com>
Date: Wed, 15 Dec 2010 11:23:00 -0800
Subject: ER-407 child bounding boxes not rotated properly for encroachment
 returnability Using the correct method for joining BBoxes in the agent frame
 ::addBBoxAgent()

---
 indra/llmath/llbbox.cpp | 14 --------------
 indra/llmath/llbbox.h   |  4 ----
 2 files changed, 18 deletions(-)

(limited to 'indra/llmath')

diff --git a/indra/llmath/llbbox.cpp b/indra/llmath/llbbox.cpp
index 67a305d269..d2208f604e 100644
--- a/indra/llmath/llbbox.cpp
+++ b/indra/llmath/llbbox.cpp
@@ -102,20 +102,6 @@ LLBBox LLBBox::getAxisAligned() const
 
 	return aligned;
 }
-// Increases the size to contain other_box
-void LLBBox::join(const LLBBox& other_box)
-{
-	LLVector3 other_min = (other_box.mPosAgent - mPosAgent) - other_box.mMinLocal;
-	mMinLocal.mV[VX] = llmin( other_min.mV[VX], mMinLocal.mV[VX] );
-	mMinLocal.mV[VY] = llmin( other_min.mV[VY], mMinLocal.mV[VY] );
-	mMinLocal.mV[VZ] = llmin( other_min.mV[VZ], mMinLocal.mV[VZ] );
-
-	LLVector3 other_max = (other_box.mPosAgent - mPosAgent) + other_box.mMaxLocal;
-	mMaxLocal.mV[VX] = llmax( other_max.mV[VX], mMaxLocal.mV[VX] );
-	mMaxLocal.mV[VY] = llmax( other_max.mV[VY], mMaxLocal.mV[VY] );
-	mMaxLocal.mV[VZ] = llmax( other_max.mV[VZ], mMaxLocal.mV[VZ] );
-}
-
 
 void LLBBox::expand( F32 delta )
 {
diff --git a/indra/llmath/llbbox.h b/indra/llmath/llbbox.h
index 8616320381..28e69b75e1 100644
--- a/indra/llmath/llbbox.h
+++ b/indra/llmath/llbbox.h
@@ -85,10 +85,6 @@ public:
 	// Get the smallest possible axis aligned bbox that contains this bbox
 	LLBBox              getAxisAligned() const;
 
-	// Increases the size to contain other_box
-	void 				join(const LLBBox& other_box);
-
-
 //	friend LLBBox operator*(const LLBBox& a, const LLMatrix4& b);
 
 private:
-- 
cgit v1.2.3


From c8457f266423370e6f8e84c1b23ef95ed69a2997 Mon Sep 17 00:00:00 2001
From: Merov Linden <merov@lindenlab.com>
Date: Mon, 10 Jan 2011 18:01:16 -0800
Subject: STORM-807 : Clean up code as discussed with Andrew

---
 indra/llmath/llbbox.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

(limited to 'indra/llmath')

diff --git a/indra/llmath/llbbox.cpp b/indra/llmath/llbbox.cpp
index d2208f604e..3e2c05a6e6 100644
--- a/indra/llmath/llbbox.cpp
+++ b/indra/llmath/llbbox.cpp
@@ -91,7 +91,7 @@ void LLBBox::addBBoxAgent(const LLBBox& b)
 
 LLBBox LLBBox::getAxisAligned() const
 {
-	// no rotiation = axis aligned rotation
+	// no rotation = axis aligned rotation
 	LLBBox aligned(mPosAgent, LLQuaternion(), LLVector3(), LLVector3());
 
 	// add the center point so that it's not empty
-- 
cgit v1.2.3