From 424786d8d05093abd816a3decd86aace64816179 Mon Sep 17 00:00:00 2001 From: Andrew Meadows Date: Thu, 18 Nov 2010 15:55:53 -0800 Subject: Added viewer-side "object overlaps parcel" check encroachment returnabilty UI Reviewed with Falcon --- indra/newview/llviewerobject.cpp | 18 +++++------------- 1 file changed, 5 insertions(+), 13 deletions(-) (limited to 'indra/newview/llviewerobject.cpp') diff --git a/indra/newview/llviewerobject.cpp b/indra/newview/llviewerobject.cpp index 1804fac1b3..64892c7ee1 100644 --- a/indra/newview/llviewerobject.cpp +++ b/indra/newview/llviewerobject.cpp @@ -516,20 +516,12 @@ void LLViewerObject::setNameValueList(const std::string& name_value_list) // This method returns true if the object is over land owned by the // agent. -BOOL LLViewerObject::isOverAgentOwnedLand() const +bool LLViewerObject::isReturnable() { - return mRegionp - && mRegionp->getParcelOverlay() - && mRegionp->getParcelOverlay()->isOwnedSelf(getPositionRegion()); -} - -// This method returns true if the object is over land owned by the -// agent. -BOOL LLViewerObject::isOverGroupOwnedLand() const -{ - return mRegionp - && mRegionp->getParcelOverlay() - && mRegionp->getParcelOverlay()->isOwnedGroup(getPositionRegion()); + LLBBox(getPositionRegion(), getRotationRegion(), getScale() * -0.5f, getScale() * 0.5f); + return !isAttachment() + && mRegionp + && mRegionp->objectIsReturnable(getPositionRegion(), getBoundingBoxRegion()); } BOOL LLViewerObject::setParent(LLViewerObject* parent) -- cgit v1.2.3 From c320b2cef916cc8f0e42f041c29c04bf55d40d77 Mon Sep 17 00:00:00 2001 From: Andrew Meadows Date: Fri, 19 Nov 2010 08:36:53 -0800 Subject: Fixing a typo that broke the build. --- indra/newview/llviewerobject.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'indra/newview/llviewerobject.cpp') diff --git a/indra/newview/llviewerobject.cpp b/indra/newview/llviewerobject.cpp index 64892c7ee1..df89e6759d 100644 --- a/indra/newview/llviewerobject.cpp +++ b/indra/newview/llviewerobject.cpp @@ -518,10 +518,10 @@ void LLViewerObject::setNameValueList(const std::string& name_value_list) // agent. bool LLViewerObject::isReturnable() { - LLBBox(getPositionRegion(), getRotationRegion(), getScale() * -0.5f, getScale() * 0.5f); + LLBBox box_in_region_frame(getPositionRegion(), getRotationRegion(), getScale() * -0.5f, getScale() * 0.5f); return !isAttachment() && mRegionp - && mRegionp->objectIsReturnable(getPositionRegion(), getBoundingBoxRegion()); + && mRegionp->objectIsReturnable(getPositionRegion(), box_in_region_frame); } BOOL LLViewerObject::setParent(LLViewerObject* parent) -- cgit v1.2.3 From 64512b681e2f5582378d9943642a82c83cae30ac Mon Sep 17 00:00:00 2001 From: Andrew Meadows 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/newview/llviewerobject.cpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'indra/newview/llviewerobject.cpp') diff --git a/indra/newview/llviewerobject.cpp b/indra/newview/llviewerobject.cpp index df89e6759d..15207e7346 100644 --- a/indra/newview/llviewerobject.cpp +++ b/indra/newview/llviewerobject.cpp @@ -518,10 +518,18 @@ void LLViewerObject::setNameValueList(const std::string& name_value_list) // agent. bool LLViewerObject::isReturnable() { - LLBBox box_in_region_frame(getPositionRegion(), getRotationRegion(), getScale() * -0.5f, getScale() * 0.5f); + LLBBox bounding_box(getPositionRegion(), getRotationRegion(), getScale() * -0.5f, getScale() * 0.5f); + for (child_list_t::iterator iter = mChildList.begin(); + iter != mChildList.end(); iter++) + { + LLViewerObject* child = *iter; + LLBBox child_box(child->getPositionRegion(), child->getRotationRegion(), child->getScale() * -0.5f, child->getScale() * 0.5f); + bounding_box.join(child_box); + } + return !isAttachment() && mRegionp - && mRegionp->objectIsReturnable(getPositionRegion(), box_in_region_frame); + && mRegionp->objectIsReturnable(getPositionRegion(), bounding_box); } BOOL LLViewerObject::setParent(LLViewerObject* parent) -- cgit v1.2.3 From 3be87bb04685e971965ab5ac4166165c3785476f Mon Sep 17 00:00:00 2001 From: Andrew Meadows 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/newview/llviewerobject.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview/llviewerobject.cpp') diff --git a/indra/newview/llviewerobject.cpp b/indra/newview/llviewerobject.cpp index 15207e7346..ae2154d63b 100644 --- a/indra/newview/llviewerobject.cpp +++ b/indra/newview/llviewerobject.cpp @@ -524,7 +524,7 @@ bool LLViewerObject::isReturnable() { LLViewerObject* child = *iter; LLBBox child_box(child->getPositionRegion(), child->getRotationRegion(), child->getScale() * -0.5f, child->getScale() * 0.5f); - bounding_box.join(child_box); + bounding_box.addBBoxAgent(child_box); } return !isAttachment() -- cgit v1.2.3 From 14e402cf5e8274caddaf1c763c2e044c53514b1e Mon Sep 17 00:00:00 2001 From: Don Kjer Date: Thu, 16 Dec 2010 22:09:49 -0800 Subject: ER-414: Add object update type debug rendering view --- indra/newview/llviewerobject.cpp | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) (limited to 'indra/newview/llviewerobject.cpp') diff --git a/indra/newview/llviewerobject.cpp b/indra/newview/llviewerobject.cpp index 1804fac1b3..3c12cb66b2 100644 --- a/indra/newview/llviewerobject.cpp +++ b/indra/newview/llviewerobject.cpp @@ -234,7 +234,9 @@ LLViewerObject::LLViewerObject(const LLUUID &id, const LLPCode pcode, LLViewerRe mState(0), mMedia(NULL), mClickAction(0), - mAttachmentItemID(LLUUID::null) + mAttachmentItemID(LLUUID::null), + mLastUpdateType(OUT_UNKNOWN), + mLastUpdateCached(FALSE) { if (!is_global) { @@ -5400,6 +5402,26 @@ void LLViewerObject::setAttachmentItemID(const LLUUID &id) mAttachmentItemID = id; } +EObjectUpdateType LLViewerObject::getLastUpdateType() +{ + return mLastUpdateType; +} + +void LLViewerObject::setLastUpdateType(EObjectUpdateType last_update_type) +{ + mLastUpdateType = last_update_type; +} + +BOOL LLViewerObject::getLastUpdateCached() +{ + return mLastUpdateCached; +} + +void LLViewerObject::setLastUpdateCached(BOOL last_update_cached) +{ + mLastUpdateCached = last_update_cached; +} + const LLUUID &LLViewerObject::extractAttachmentItemID() { LLUUID item_id = LLUUID::null; -- cgit v1.2.3 From 7fc9d701190a75c8f96a0a808d793dbc34860916 Mon Sep 17 00:00:00 2001 From: Andrew Meadows Date: Fri, 17 Dec 2010 19:52:45 -0800 Subject: For object-vs-parcel overlap we now use list of axis aligned boxes one box for each prim, for less slop on queries --- indra/newview/llviewerobject.cpp | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) (limited to 'indra/newview/llviewerobject.cpp') diff --git a/indra/newview/llviewerobject.cpp b/indra/newview/llviewerobject.cpp index ae2154d63b..18d6e4c8c8 100644 --- a/indra/newview/llviewerobject.cpp +++ b/indra/newview/llviewerobject.cpp @@ -518,18 +518,21 @@ void LLViewerObject::setNameValueList(const std::string& name_value_list) // agent. bool LLViewerObject::isReturnable() { - LLBBox bounding_box(getPositionRegion(), getRotationRegion(), getScale() * -0.5f, getScale() * 0.5f); + if (isAttachment()) + { + return false; + } + std::vector boxes; + boxes.push_back(LLBBox(getPositionRegion(), getRotationRegion(), getScale() * -0.5f, getScale() * 0.5f).getAxisAligned()); for (child_list_t::iterator iter = mChildList.begin(); iter != mChildList.end(); iter++) { LLViewerObject* child = *iter; - LLBBox child_box(child->getPositionRegion(), child->getRotationRegion(), child->getScale() * -0.5f, child->getScale() * 0.5f); - bounding_box.addBBoxAgent(child_box); + boxes.push_back(LLBBox(child->getPositionRegion(), child->getRotationRegion(), child->getScale() * -0.5f, child->getScale() * 0.5f).getAxisAligned()); } - return !isAttachment() - && mRegionp - && mRegionp->objectIsReturnable(getPositionRegion(), bounding_box); + return mRegionp + && mRegionp->objectIsReturnable(getPositionRegion(), boxes); } BOOL LLViewerObject::setParent(LLViewerObject* parent) -- cgit v1.2.3 From 649dd6eb74023d48379ebaadd2ff000801306f17 Mon Sep 17 00:00:00 2001 From: Don Kjer Date: Wed, 22 Dec 2010 14:23:35 -0800 Subject: Cleanup from review with Andrew and Merov --- indra/newview/llviewerobject.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'indra/newview/llviewerobject.cpp') diff --git a/indra/newview/llviewerobject.cpp b/indra/newview/llviewerobject.cpp index 3c12cb66b2..4b7e518af3 100644 --- a/indra/newview/llviewerobject.cpp +++ b/indra/newview/llviewerobject.cpp @@ -5402,7 +5402,7 @@ void LLViewerObject::setAttachmentItemID(const LLUUID &id) mAttachmentItemID = id; } -EObjectUpdateType LLViewerObject::getLastUpdateType() +EObjectUpdateType LLViewerObject::getLastUpdateType() const { return mLastUpdateType; } @@ -5412,7 +5412,7 @@ void LLViewerObject::setLastUpdateType(EObjectUpdateType last_update_type) mLastUpdateType = last_update_type; } -BOOL LLViewerObject::getLastUpdateCached() +BOOL LLViewerObject::getLastUpdateCached() const { return mLastUpdateCached; } -- cgit v1.2.3 From 5364bb5a11aaae33127db3866f7a9bba6404773d Mon Sep 17 00:00:00 2001 From: Loren Shih Date: Fri, 14 Jan 2011 15:16:17 -0500 Subject: Mesh-development work in progress --- indra/newview/llviewerobject.cpp | 30 ++++++++++++++++++++---------- 1 file changed, 20 insertions(+), 10 deletions(-) (limited to 'indra/newview/llviewerobject.cpp') diff --git a/indra/newview/llviewerobject.cpp b/indra/newview/llviewerobject.cpp index f380d4b183..bf550e9c70 100644 --- a/indra/newview/llviewerobject.cpp +++ b/indra/newview/llviewerobject.cpp @@ -5600,6 +5600,26 @@ void LLViewerObject::setAttachmentItemID(const LLUUID &id) mAttachmentItemID = id; } +EObjectUpdateType LLViewerObject::getLastUpdateType() const +{ + return mLastUpdateType; +} + +void LLViewerObject::setLastUpdateType(EObjectUpdateType last_update_type) +{ + mLastUpdateType = last_update_type; +} + +BOOL LLViewerObject::getLastUpdateCached() const +{ + return mLastUpdateCached; +} + +void LLViewerObject::setLastUpdateCached(BOOL last_update_cached) +{ + mLastUpdateCached = last_update_cached; +} + const LLUUID &LLViewerObject::extractAttachmentItemID() { LLUUID item_id = LLUUID::null; @@ -5616,16 +5636,6 @@ const LLUUID &LLViewerObject::extractAttachmentItemID() return getAttachmentItemID(); } -EObjectUpdateType LLViewerObject::getLastUpdateType() const -{ - return mLastUpdateType; -} - -void LLViewerObject::setLastUpdateType(EObjectUpdateType last_update_type) -{ - mLastUpdateType = last_update_type; -} - //virtual LLVOAvatar* LLViewerObject::getAvatar() const { -- cgit v1.2.3