diff options
author | James Cook <james@lindenlab.com> | 2009-11-20 09:46:23 -0800 |
---|---|---|
committer | James Cook <james@lindenlab.com> | 2009-11-20 09:46:23 -0800 |
commit | fc04d5bbb8b51b9ca39d1a3a1de0991de09cdb58 (patch) | |
tree | 0cc35255caa59f0f616ccb328bd42824505bfffc /indra/newview/lltoolpie.cpp | |
parent | ba3f7965e35e4eb0d7fcecc7267ec3af5f2d8d87 (diff) | |
parent | 644ee3f5ded17513e09de8c62a2bafe69ceb03d6 (diff) |
merge
Diffstat (limited to 'indra/newview/lltoolpie.cpp')
-rw-r--r-- | indra/newview/lltoolpie.cpp | 32 |
1 files changed, 31 insertions, 1 deletions
diff --git a/indra/newview/lltoolpie.cpp b/indra/newview/lltoolpie.cpp index 9c8fca3552..5ed8dc5fb9 100644 --- a/indra/newview/lltoolpie.cpp +++ b/indra/newview/lltoolpie.cpp @@ -209,6 +209,7 @@ BOOL LLToolPie::pickLeftMouseDownCallback() // touch behavior down below... break; case CLICK_ACTION_SIT: + if ((gAgent.getAvatarObject() != NULL) && (!gAgent.getAvatarObject()->isSitting())) // agent not already sitting { handle_object_sit_or_stand(); @@ -252,7 +253,7 @@ BOOL LLToolPie::pickLeftMouseDownCallback() selectionPropertiesReceived(); } } - return TRUE; + return TRUE; case CLICK_ACTION_PLAY: handle_click_action_play(); return TRUE; @@ -260,6 +261,29 @@ BOOL LLToolPie::pickLeftMouseDownCallback() // mClickActionObject = object; handle_click_action_open_media(object); return TRUE; + case CLICK_ACTION_ZOOM: + { + const F32 PADDING_FACTOR = 2.f; + LLViewerObject* object = gObjectList.findObject(mPick.mObjectID); + + if (object) + { + gAgent.setFocusOnAvatar(FALSE, ANIMATE); + + LLBBox bbox = object->getBoundingBoxAgent() ; + F32 angle_of_view = llmax(0.1f, LLViewerCamera::getInstance()->getAspect() > 1.f ? LLViewerCamera::getInstance()->getView() * LLViewerCamera::getInstance()->getAspect() : LLViewerCamera::getInstance()->getView()); + F32 distance = bbox.getExtentLocal().magVec() * PADDING_FACTOR / atan(angle_of_view); + + LLVector3 obj_to_cam = LLViewerCamera::getInstance()->getOrigin() - bbox.getCenterAgent(); + obj_to_cam.normVec(); + + LLVector3d object_center_global = gAgent.getPosGlobalFromAgent(bbox.getCenterAgent()); + gAgent.setCameraPosAndFocusGlobal(object_center_global + LLVector3d(obj_to_cam * distance), + object_center_global, + mPick.mObjectID ); + } + } + return TRUE; default: // nothing break; @@ -413,6 +437,9 @@ ECursorType cursor_from_object(LLViewerObject* object) cursor = UI_CURSOR_HAND; } break; + case CLICK_ACTION_ZOOM: + cursor = UI_CURSOR_TOOLZOOMIN; + break; case CLICK_ACTION_PLAY: case CLICK_ACTION_OPEN_MEDIA: cursor = cursor_from_parcel_media(click_action); @@ -551,6 +578,9 @@ BOOL LLToolPie::handleMouseUp(S32 x, S32 y, MASK mask) case CLICK_ACTION_BUY: case CLICK_ACTION_PAY: case CLICK_ACTION_OPEN: + case CLICK_ACTION_ZOOM: + case CLICK_ACTION_PLAY: + case CLICK_ACTION_OPEN_MEDIA: // Because these actions open UI dialogs, we won't change // the cursor again until the next hover and GL pick over // the world. Keep the cursor an arrow, assuming that |