aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/newview/llselectmgr.cpp
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--linden/indra/newview/llselectmgr.cpp40
1 files changed, 32 insertions, 8 deletions
diff --git a/linden/indra/newview/llselectmgr.cpp b/linden/indra/newview/llselectmgr.cpp
index 0cf8b00..ec01d54 100644
--- a/linden/indra/newview/llselectmgr.cpp
+++ b/linden/indra/newview/llselectmgr.cpp
@@ -547,7 +547,7 @@ BOOL LLSelectMgr::removeObjectFromSelections(const LLUUID &id)
547 return object_found; 547 return object_found;
548} 548}
549 549
550void LLSelectMgr::deselectObjectAndFamily(LLViewerObject* object, BOOL send_to_sim) 550void LLSelectMgr::deselectObjectAndFamily(LLViewerObject* object, BOOL send_to_sim, BOOL include_entire_object)
551{ 551{
552 // bail if nothing selected or if object wasn't selected in the first place 552 // bail if nothing selected or if object wasn't selected in the first place
553 if(!object) return; 553 if(!object) return;
@@ -555,7 +555,30 @@ void LLSelectMgr::deselectObjectAndFamily(LLViewerObject* object, BOOL send_to_s
555 555
556 // Collect all of the objects, and remove them 556 // Collect all of the objects, and remove them
557 LLDynamicArray<LLViewerObject*> objects; 557 LLDynamicArray<LLViewerObject*> objects;
558 object = (LLViewerObject*)object->getRoot(); 558
559 if (include_entire_object)
560 {
561 // Since we're selecting a family, start at the root, but
562 // don't include an avatar.
563 LLViewerObject* root = object;
564
565 while(!root->isAvatar() && root->getParent() && !root->isJointChild())
566 {
567 LLViewerObject* parent = (LLViewerObject*)root->getParent();
568 if (parent->isAvatar())
569 {
570 break;
571 }
572 root = parent;
573 }
574
575 object = root;
576 }
577 else
578 {
579 object = (LLViewerObject*)object->getRoot();
580 }
581
559 object->addThisAndAllChildren(objects); 582 object->addThisAndAllChildren(objects);
560 remove(objects); 583 remove(objects);
561 584
@@ -3457,7 +3480,6 @@ void LLSelectMgr::deselectAll()
3457 mLastSentSelectionCenterGlobal.clearVec(); 3480 mLastSentSelectionCenterGlobal.clearVec();
3458 3481
3459 updatePointAt(); 3482 updatePointAt();
3460 gHUDManager->clearJoints();
3461 updateSelectionCenter(); 3483 updateSelectionCenter();
3462} 3484}
3463 3485
@@ -5494,7 +5516,7 @@ void LLSelectMgr::updateSelectionCenter()
5494 // have stuff selected 5516 // have stuff selected
5495 LLVector3d select_center; 5517 LLVector3d select_center;
5496 // keep a list of jointed objects for showing the joint HUDEffects 5518 // keep a list of jointed objects for showing the joint HUDEffects
5497 gHUDManager->clearJoints(); 5519
5498 LLDynamicArray < LLViewerObject *> jointed_objects; 5520 LLDynamicArray < LLViewerObject *> jointed_objects;
5499 5521
5500 for (object = mSelectedObjects->getFirstObject(); object; object = mSelectedObjects->getNextObject() ) 5522 for (object = mSelectedObjects->getFirstObject(); object; object = mSelectedObjects->getNextObject() )
@@ -5520,10 +5542,6 @@ void LLSelectMgr::updateSelectionCenter()
5520 mSelectionCenterGlobal = gAgent.getPosGlobalFromAgent(bbox_center_agent); 5542 mSelectionCenterGlobal = gAgent.getPosGlobalFromAgent(bbox_center_agent);
5521 mSelectionBBox = bbox; 5543 mSelectionBBox = bbox;
5522 5544
5523 if (jointed_objects.count())
5524 {
5525 gHUDManager->showJoints(&jointed_objects);
5526 }
5527 } 5545 }
5528 5546
5529 if ( !(gAgentID == LLUUID::null) && gToolMgr) 5547 if ( !(gAgentID == LLUUID::null) && gToolMgr)
@@ -5754,6 +5772,12 @@ BOOL LLSelectMgr::canSelectObject(LLViewerObject* object)
5754 return TRUE; 5772 return TRUE;
5755} 5773}
5756 5774
5775BOOL LLSelectMgr::setForceSelection(BOOL force)
5776{
5777 std::swap(mForceSelection,force);
5778 return force;
5779}
5780
5757LLObjectSelection::LLObjectSelection() : 5781LLObjectSelection::LLObjectSelection() :
5758 std::list<LLSelectNode*>(), 5782 std::list<LLSelectNode*>(),
5759 LLRefCount(), 5783 LLRefCount(),