diff options
author | Dmitry Zaporozhan <dzaporozhan@productengine.com> | 2009-11-23 15:53:19 +0200 |
---|---|---|
committer | Dmitry Zaporozhan <dzaporozhan@productengine.com> | 2009-11-23 15:53:19 +0200 |
commit | 25085a67f4baf341f1ebc26d7ba21e294ec56302 (patch) | |
tree | 296235a869f73af24b274dd42cc07fcf31d1ce19 /indra/newview/lltoolpie.cpp | |
parent | 9f0dbcf4c0c6c8621c377fd7f9e417aa76acd836 (diff) | |
parent | d2cee29e8a039e3cac5c851b4e770b9c7e1095f0 (diff) |
Merge
--HG--
branch : product-engine
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 |