diff options
author | McCabe Maxsted | 2010-05-31 22:59:47 -0700 |
---|---|---|
committer | Jacek Antonelli | 2010-06-22 04:44:26 -0500 |
commit | 64390436e0c46877bd61aa2965f405c9bc705e6e (patch) | |
tree | d65cc9fd6bc9d80852dd87bb8c77a616a4fd8487 /linden/indra/newview | |
parent | Added 'Notifications' to logcontrol.xml to reduce notification saving log spam (diff) | |
download | meta-impy-64390436e0c46877bd61aa2965f405c9bc705e6e.zip meta-impy-64390436e0c46877bd61aa2965f405c9bc705e6e.tar.gz meta-impy-64390436e0c46877bd61aa2965f405c9bc705e6e.tar.bz2 meta-impy-64390436e0c46877bd61aa2965f405c9bc705e6e.tar.xz |
Updated llselectmgr.cpp to snowglobe 1.4
Diffstat (limited to 'linden/indra/newview')
-rw-r--r-- | linden/indra/newview/llselectmgr.cpp | 169 | ||||
-rw-r--r-- | linden/indra/newview/llselectmgr.h | 7 |
2 files changed, 88 insertions, 88 deletions
diff --git a/linden/indra/newview/llselectmgr.cpp b/linden/indra/newview/llselectmgr.cpp index e4f914f..01f41ef 100644 --- a/linden/indra/newview/llselectmgr.cpp +++ b/linden/indra/newview/llselectmgr.cpp | |||
@@ -770,7 +770,7 @@ void LLSelectMgr::addAsIndividual(LLViewerObject *objectp, S32 face, BOOL undoab | |||
770 | } | 770 | } |
771 | 771 | ||
772 | 772 | ||
773 | LLObjectSelectionHandle LLSelectMgr::setHoverObject(LLViewerObject *objectp) | 773 | LLObjectSelectionHandle LLSelectMgr::setHoverObject(LLViewerObject *objectp, S32 face) |
774 | { | 774 | { |
775 | // Always blitz hover list when setting | 775 | // Always blitz hover list when setting |
776 | mHoverObjects->deleteAllNodes(); | 776 | mHoverObjects->deleteAllNodes(); |
@@ -802,6 +802,7 @@ LLObjectSelectionHandle LLSelectMgr::setHoverObject(LLViewerObject *objectp) | |||
802 | { | 802 | { |
803 | LLViewerObject* cur_objectp = *iter; | 803 | LLViewerObject* cur_objectp = *iter; |
804 | LLSelectNode* nodep = new LLSelectNode(cur_objectp, FALSE); | 804 | LLSelectNode* nodep = new LLSelectNode(cur_objectp, FALSE); |
805 | nodep->selectTE(face, TRUE); | ||
805 | mHoverObjects->addNodeAtEnd(nodep); | 806 | mHoverObjects->addNodeAtEnd(nodep); |
806 | } | 807 | } |
807 | 808 | ||
@@ -3437,20 +3438,12 @@ void LLSelectMgr::deselectAllIfTooFar() | |||
3437 | } | 3438 | } |
3438 | 3439 | ||
3439 | LLVector3d selectionCenter = getSelectionCenterGlobal(); | 3440 | LLVector3d selectionCenter = getSelectionCenterGlobal(); |
3440 | 3441 | if (gSavedSettings.getBOOL("LimitSelectDistance") | |
3441 | // if (gSavedSettings.getBOOL("LimitSelectDistance") | ||
3442 | // [RLVa:KB] - Checked: 2009-07-10 (RLVa-1.0.0g) | Modified: RLVa-0.2.0f | ||
3443 | BOOL fRlvFartouch = gRlvHandler.hasBehaviour(RLV_BHVR_FARTOUCH) && gFloaterTools->getVisible(); | ||
3444 | if ( (gSavedSettings.getBOOL("LimitSelectDistance") || (fRlvFartouch) ) | ||
3445 | // [/RLVa:KB] | ||
3446 | && (!mSelectedObjects->getPrimaryObject() || !mSelectedObjects->getPrimaryObject()->isAvatar()) | 3442 | && (!mSelectedObjects->getPrimaryObject() || !mSelectedObjects->getPrimaryObject()->isAvatar()) |
3447 | && !mSelectedObjects->isAttachment() | 3443 | && !mSelectedObjects->isAttachment() |
3448 | && !selectionCenter.isExactlyZero()) | 3444 | && !selectionCenter.isExactlyZero()) |
3449 | { | 3445 | { |
3450 | // F32 deselect_dist = gSavedSettings.getF32("MaxSelectDistance"); | 3446 | F32 deselect_dist = gSavedSettings.getF32("MaxSelectDistance"); |
3451 | // [RLVa:KB] - Checked: 2009-07-10 (RLVa-1.0.0g) | Modified: RLVa-0.2.0f | ||
3452 | F32 deselect_dist = (!fRlvFartouch) ? gSavedSettings.getF32("MaxSelectDistance") : 1.5f; | ||
3453 | // [/RLVa:KB] | ||
3454 | F32 deselect_dist_sq = deselect_dist * deselect_dist; | 3447 | F32 deselect_dist_sq = deselect_dist * deselect_dist; |
3455 | 3448 | ||
3456 | LLVector3d select_delta = gAgent.getPositionGlobal() - selectionCenter; | 3449 | LLVector3d select_delta = gAgent.getPositionGlobal() - selectionCenter; |
@@ -4580,54 +4573,7 @@ void LLSelectMgr::updateSilhouettes() | |||
4580 | 4573 | ||
4581 | std::vector<LLViewerObject*> changed_objects; | 4574 | std::vector<LLViewerObject*> changed_objects; |
4582 | 4575 | ||
4583 | if (mSelectedObjects->getNumNodes()) | 4576 | updateSelectionSilhouette(mSelectedObjects, num_sils_genned, changed_objects); |
4584 | { | ||
4585 | //gGLSPipelineSelection.set(); | ||
4586 | |||
4587 | //mSilhouetteImagep->bindTexture(); | ||
4588 | //glAlphaFunc(GL_GREATER, sHighlightAlphaTest); | ||
4589 | |||
4590 | for (S32 pass = 0; pass < 2; pass++) | ||
4591 | { | ||
4592 | for (LLObjectSelection::iterator iter = mSelectedObjects->begin(); | ||
4593 | iter != mSelectedObjects->end(); iter++) | ||
4594 | { | ||
4595 | LLSelectNode* node = *iter; | ||
4596 | LLViewerObject* objectp = node->getObject(); | ||
4597 | if (!objectp) | ||
4598 | continue; | ||
4599 | // do roots first, then children so that root flags are cleared ASAP | ||
4600 | BOOL roots_only = (pass == 0); | ||
4601 | BOOL is_root = (objectp->isRootEdit()); | ||
4602 | if (roots_only != is_root || objectp->mDrawable.isNull()) | ||
4603 | { | ||
4604 | continue; | ||
4605 | } | ||
4606 | |||
4607 | if (!node->mSilhouetteExists | ||
4608 | || objectp->isChanged(LLXform::SILHOUETTE) | ||
4609 | || (objectp->getParent() && objectp->getParent()->isChanged(LLXform::SILHOUETTE))) | ||
4610 | { | ||
4611 | if (num_sils_genned++ < MAX_SILS_PER_FRAME)// && objectp->mDrawable->isVisible()) | ||
4612 | { | ||
4613 | generateSilhouette(node, LLViewerCamera::getInstance()->getOrigin()); | ||
4614 | changed_objects.push_back(objectp); | ||
4615 | } | ||
4616 | else if (objectp->isAttachment()) | ||
4617 | { | ||
4618 | //RN: hack for orthogonal projection of HUD attachments | ||
4619 | LLViewerJointAttachment* attachment_pt = (LLViewerJointAttachment*)objectp->getRootEdit()->mDrawable->getParent(); | ||
4620 | if (attachment_pt && attachment_pt->getIsHUDAttachment()) | ||
4621 | { | ||
4622 | LLVector3 camera_pos = LLVector3(-10000.f, 0.f, 0.f); | ||
4623 | generateSilhouette(node, camera_pos); | ||
4624 | } | ||
4625 | } | ||
4626 | } | ||
4627 | } | ||
4628 | } | ||
4629 | } | ||
4630 | |||
4631 | if (mRectSelectedObjects.size() > 0) | 4577 | if (mRectSelectedObjects.size() > 0) |
4632 | { | 4578 | { |
4633 | //gGLSPipelineSelection.set(); | 4579 | //gGLSPipelineSelection.set(); |
@@ -4821,6 +4767,56 @@ void LLSelectMgr::updateSilhouettes() | |||
4821 | //gGL.setAlphaRejectSettings(LLRender::CF_DEFAULT); | 4767 | //gGL.setAlphaRejectSettings(LLRender::CF_DEFAULT); |
4822 | } | 4768 | } |
4823 | 4769 | ||
4770 | void LLSelectMgr::updateSelectionSilhouette(LLObjectSelectionHandle object_handle, S32& num_sils_genned, std::vector<LLViewerObject*>& changed_objects) | ||
4771 | { | ||
4772 | if (object_handle->getNumNodes()) | ||
4773 | { | ||
4774 | //gGLSPipelineSelection.set(); | ||
4775 | |||
4776 | //mSilhouetteImagep->bindTexture(); | ||
4777 | //glAlphaFunc(GL_GREATER, sHighlightAlphaTest); | ||
4778 | |||
4779 | for (S32 pass = 0; pass < 2; pass++) | ||
4780 | { | ||
4781 | for (LLObjectSelection::iterator iter = object_handle->begin(); | ||
4782 | iter != object_handle->end(); iter++) | ||
4783 | { | ||
4784 | LLSelectNode* node = *iter; | ||
4785 | LLViewerObject* objectp = node->getObject(); | ||
4786 | if (!objectp) | ||
4787 | continue; | ||
4788 | // do roots first, then children so that root flags are cleared ASAP | ||
4789 | BOOL roots_only = (pass == 0); | ||
4790 | BOOL is_root = (objectp->isRootEdit()); | ||
4791 | if (roots_only != is_root || objectp->mDrawable.isNull()) | ||
4792 | { | ||
4793 | continue; | ||
4794 | } | ||
4795 | |||
4796 | if (!node->mSilhouetteExists | ||
4797 | || objectp->isChanged(LLXform::SILHOUETTE) | ||
4798 | || (objectp->getParent() && objectp->getParent()->isChanged(LLXform::SILHOUETTE))) | ||
4799 | { | ||
4800 | if (num_sils_genned++ < MAX_SILS_PER_FRAME)// && objectp->mDrawable->isVisible()) | ||
4801 | { | ||
4802 | generateSilhouette(node, LLViewerCamera::getInstance()->getOrigin()); | ||
4803 | changed_objects.push_back(objectp); | ||
4804 | } | ||
4805 | else if (objectp->isAttachment()) | ||
4806 | { | ||
4807 | //RN: hack for orthogonal projection of HUD attachments | ||
4808 | LLViewerJointAttachment* attachment_pt = (LLViewerJointAttachment*)objectp->getRootEdit()->mDrawable->getParent(); | ||
4809 | if (attachment_pt && attachment_pt->getIsHUDAttachment()) | ||
4810 | { | ||
4811 | LLVector3 camera_pos = LLVector3(-10000.f, 0.f, 0.f); | ||
4812 | generateSilhouette(node, camera_pos); | ||
4813 | } | ||
4814 | } | ||
4815 | } | ||
4816 | } | ||
4817 | } | ||
4818 | } | ||
4819 | } | ||
4824 | void LLSelectMgr::renderSilhouettes(BOOL for_hud) | 4820 | void LLSelectMgr::renderSilhouettes(BOOL for_hud) |
4825 | { | 4821 | { |
4826 | if (!mRenderSilhouettes || !LLSelectMgr::sRenderSelectionHighlights) | 4822 | if (!mRenderSilhouettes || !LLSelectMgr::sRenderSelectionHighlights) |
@@ -4954,32 +4950,29 @@ void LLSelectMgr::generateSilhouette(LLSelectNode* nodep, const LLVector3& view_ | |||
4954 | // Utility classes | 4950 | // Utility classes |
4955 | // | 4951 | // |
4956 | LLSelectNode::LLSelectNode(LLViewerObject* object, BOOL glow) | 4952 | LLSelectNode::LLSelectNode(LLViewerObject* object, BOOL glow) |
4953 | : mObject(object), | ||
4954 | mIndividualSelection(FALSE), | ||
4955 | mTransient(FALSE), | ||
4956 | mValid(FALSE), | ||
4957 | mPermissions(new LLPermissions()), | ||
4958 | mInventorySerial(0), | ||
4959 | mSilhouetteExists(FALSE), | ||
4960 | mDuplicated(FALSE), | ||
4961 | mTESelectMask(0), | ||
4962 | mLastTESelected(0), | ||
4963 | mName(LLStringUtil::null), | ||
4964 | mDescription(LLStringUtil::null), | ||
4965 | mTouchName(LLStringUtil::null), | ||
4966 | mSitName(LLStringUtil::null), | ||
4967 | mCreationDate(0) | ||
4957 | { | 4968 | { |
4958 | mObject = object; | ||
4959 | selectAllTEs(FALSE); | 4969 | selectAllTEs(FALSE); |
4960 | mIndividualSelection = FALSE; | ||
4961 | mTransient = FALSE; | ||
4962 | mValid = FALSE; | ||
4963 | mPermissions = new LLPermissions(); | ||
4964 | mInventorySerial = 0; | ||
4965 | mName = LLStringUtil::null; | ||
4966 | mDescription = LLStringUtil::null; | ||
4967 | mTouchName = LLStringUtil::null; | ||
4968 | mSitName = LLStringUtil::null; | ||
4969 | mSilhouetteExists = FALSE; | ||
4970 | mDuplicated = FALSE; | ||
4971 | mCreationDate = 0; | ||
4972 | |||
4973 | saveColors(); | 4970 | saveColors(); |
4974 | } | 4971 | } |
4975 | 4972 | ||
4976 | LLSelectNode::LLSelectNode(const LLSelectNode& nodep) | 4973 | LLSelectNode::LLSelectNode(const LLSelectNode& nodep) |
4977 | { | 4974 | { |
4978 | S32 i; | 4975 | mTESelectMask = nodep.mTESelectMask; |
4979 | for (i = 0; i < SELECT_MAX_TES; i++) | ||
4980 | { | ||
4981 | mTESelected[i] = nodep.mTESelected[i]; | ||
4982 | } | ||
4983 | mLastTESelected = nodep.mLastTESelected; | 4976 | mLastTESelected = nodep.mLastTESelected; |
4984 | 4977 | ||
4985 | mIndividualSelection = nodep.mIndividualSelection; | 4978 | mIndividualSelection = nodep.mIndividualSelection; |
@@ -5032,10 +5025,7 @@ LLSelectNode::~LLSelectNode() | |||
5032 | 5025 | ||
5033 | void LLSelectNode::selectAllTEs(BOOL b) | 5026 | void LLSelectNode::selectAllTEs(BOOL b) |
5034 | { | 5027 | { |
5035 | for (S32 i = 0; i < SELECT_MAX_TES; i++) | 5028 | mTESelectMask = b ? 0xFFFFFFFF : 0x0; |
5036 | { | ||
5037 | mTESelected[i] = b; | ||
5038 | } | ||
5039 | mLastTESelected = 0; | 5029 | mLastTESelected = 0; |
5040 | } | 5030 | } |
5041 | 5031 | ||
@@ -5045,7 +5035,14 @@ void LLSelectNode::selectTE(S32 te_index, BOOL selected) | |||
5045 | { | 5035 | { |
5046 | return; | 5036 | return; |
5047 | } | 5037 | } |
5048 | mTESelected[te_index] = selected; | 5038 | if (selected) |
5039 | { | ||
5040 | mTESelectMask |= (0x1 << te_index); | ||
5041 | } | ||
5042 | else | ||
5043 | { | ||
5044 | mTESelectMask &= ~(0x1 << te_index); | ||
5045 | } | ||
5049 | mLastTESelected = te_index; | 5046 | mLastTESelected = te_index; |
5050 | } | 5047 | } |
5051 | 5048 | ||
@@ -5055,7 +5052,7 @@ BOOL LLSelectNode::isTESelected(S32 te_index) | |||
5055 | { | 5052 | { |
5056 | return FALSE; | 5053 | return FALSE; |
5057 | } | 5054 | } |
5058 | return mTESelected[te_index]; | 5055 | return (mTESelectMask & (0x1 << te_index)) != 0; |
5059 | } | 5056 | } |
5060 | 5057 | ||
5061 | S32 LLSelectNode::getLastSelectedTE() | 5058 | S32 LLSelectNode::getLastSelectedTE() |
@@ -5504,11 +5501,11 @@ void LLSelectMgr::updateSelectionCenter() | |||
5504 | LLVector3d select_center; | 5501 | LLVector3d select_center; |
5505 | // keep a list of jointed objects for showing the joint HUDEffects | 5502 | // keep a list of jointed objects for showing the joint HUDEffects |
5506 | 5503 | ||
5507 | std::vector < LLViewerObject *> jointed_objects; | ||
5508 | |||
5509 | // Initialize the bounding box to the root prim, so the BBox orientation | 5504 | // Initialize the bounding box to the root prim, so the BBox orientation |
5510 | // matches the root prim's (affecting the orientation of the manipulators). | 5505 | // matches the root prim's (affecting the orientation of the manipulators). |
5511 | bbox.addBBoxAgent( (mSelectedObjects->getFirstRootObject(TRUE))->getBoundingBoxAgent() ); | 5506 | bbox.addBBoxAgent( (mSelectedObjects->getFirstRootObject(TRUE))->getBoundingBoxAgent() ); |
5507 | |||
5508 | std::vector < LLViewerObject *> jointed_objects; | ||
5512 | 5509 | ||
5513 | for (LLObjectSelection::iterator iter = mSelectedObjects->begin(); | 5510 | for (LLObjectSelection::iterator iter = mSelectedObjects->begin(); |
5514 | iter != mSelectedObjects->end(); iter++) | 5511 | iter != mSelectedObjects->end(); iter++) |
diff --git a/linden/indra/newview/llselectmgr.h b/linden/indra/newview/llselectmgr.h index 1e49afe..8165394 100644 --- a/linden/indra/newview/llselectmgr.h +++ b/linden/indra/newview/llselectmgr.h | |||
@@ -138,6 +138,7 @@ public: | |||
138 | void selectTE(S32 te_index, BOOL selected); | 138 | void selectTE(S32 te_index, BOOL selected); |
139 | BOOL isTESelected(S32 te_index); | 139 | BOOL isTESelected(S32 te_index); |
140 | S32 getLastSelectedTE(); | 140 | S32 getLastSelectedTE(); |
141 | S32 getTESelectMask() { return mTESelectMask; } | ||
141 | void renderOneSilhouette(const LLColor4 &color); | 142 | void renderOneSilhouette(const LLColor4 &color); |
142 | void setTransient(BOOL transient) { mTransient = transient; } | 143 | void setTransient(BOOL transient) { mTransient = transient; } |
143 | BOOL isTransient() { return mTransient; } | 144 | BOOL isTransient() { return mTransient; } |
@@ -190,7 +191,7 @@ public: | |||
190 | 191 | ||
191 | protected: | 192 | protected: |
192 | LLPointer<LLViewerObject> mObject; | 193 | LLPointer<LLViewerObject> mObject; |
193 | BOOL mTESelected[SELECT_MAX_TES]; | 194 | S32 mTESelectMask; |
194 | S32 mLastTESelected; | 195 | S32 mLastTESelected; |
195 | }; | 196 | }; |
196 | 197 | ||
@@ -406,7 +407,7 @@ public: | |||
406 | // converts all objects currently highlighted to a selection, and returns it | 407 | // converts all objects currently highlighted to a selection, and returns it |
407 | LLObjectSelectionHandle selectHighlightedObjects(); | 408 | LLObjectSelectionHandle selectHighlightedObjects(); |
408 | 409 | ||
409 | LLObjectSelectionHandle setHoverObject(LLViewerObject *objectp); | 410 | LLObjectSelectionHandle setHoverObject(LLViewerObject *objectp, S32 face = -1); |
410 | 411 | ||
411 | void highlightObjectOnly(LLViewerObject *objectp); | 412 | void highlightObjectOnly(LLViewerObject *objectp); |
412 | void highlightObjectAndFamily(LLViewerObject *objectp); | 413 | void highlightObjectAndFamily(LLViewerObject *objectp); |
@@ -647,6 +648,7 @@ private: | |||
647 | ESelectType getSelectTypeForObject(LLViewerObject* object); | 648 | ESelectType getSelectTypeForObject(LLViewerObject* object); |
648 | void addAsFamily(std::vector<LLViewerObject*>& objects, BOOL add_to_end = FALSE); | 649 | void addAsFamily(std::vector<LLViewerObject*>& objects, BOOL add_to_end = FALSE); |
649 | void generateSilhouette(LLSelectNode *nodep, const LLVector3& view_point); | 650 | void generateSilhouette(LLSelectNode *nodep, const LLVector3& view_point); |
651 | void updateSelectionSilhouette(LLObjectSelectionHandle object_handle, S32& num_sils_genned, std::vector<LLViewerObject*>& changed_objects); | ||
650 | // Send one message to each region containing an object on selection list. | 652 | // Send one message to each region containing an object on selection list. |
651 | void sendListToRegions( const std::string& message_name, | 653 | void sendListToRegions( const std::string& message_name, |
652 | void (*pack_header)(void *user_data), | 654 | void (*pack_header)(void *user_data), |
@@ -654,6 +656,7 @@ private: | |||
654 | void *user_data, | 656 | void *user_data, |
655 | ESendType send_type); | 657 | ESendType send_type); |
656 | 658 | ||
659 | |||
657 | static void packAgentID( void *); | 660 | static void packAgentID( void *); |
658 | static void packAgentAndSessionID(void* user_data); | 661 | static void packAgentAndSessionID(void* user_data); |
659 | static void packAgentAndGroupID(void* user_data); | 662 | static void packAgentAndGroupID(void* user_data); |