From c650b9cf8202ffc63d58bbcbf05f7eddf9ae6c3c Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Mon, 14 Mar 2011 13:18:15 -0700 Subject: clicking on sky or on own avatar to steer now works --- indra/newview/lltoolpie.cpp | 31 ++++++++++++++++++++++++++++--- indra/newview/lltoolpie.h | 2 +- 2 files changed, 29 insertions(+), 4 deletions(-) (limited to 'indra') diff --git a/indra/newview/lltoolpie.cpp b/indra/newview/lltoolpie.cpp index 65c9f2b8f6..c0b5c8de70 100644 --- a/indra/newview/lltoolpie.cpp +++ b/indra/newview/lltoolpie.cpp @@ -111,7 +111,6 @@ BOOL LLToolPie::handleMouseDown(S32 x, S32 y, MASK mask) mPick = gViewerWindow->pickImmediate(x, y, TRUE); mPick.mKeyMask = mask; - mDragPick = mPick; mMouseButtonDown = true; mAbortClickToWalk = false; @@ -1714,6 +1713,32 @@ bool intersect_ray_with_sphere( const LLVector3& ray_pt, const LLVector3& ray_di void LLToolPie::startCameraSteering() { + mSteerPick = mPick; + + LLPointer pick_object = mSteerPick.getObject(); + // handle special cases of steering picks + if (pick_object) + { + LLViewerObject* avatar_object = pick_object; + + // get pointer to avatar + while (avatar_object && !avatar_object->isAvatar()) + { + avatar_object = (LLViewerObject*)avatar_object->getParent(); + } + + if (avatar_object && ((LLVOAvatar*)avatar_object)->isSelf()) + { + // project pick point a few meters in front of avatar + mSteerPick.mPosGlobal = gAgent.getPositionGlobal() + LLVector3d(LLViewerCamera::instance().getAtAxis()) * 3.0; + } + } + else if (!mSteerPick.isValid()) + { + mSteerPick.mPosGlobal = gAgent.getPosGlobalFromAgent( + LLViewerCamera::instance().getOrigin() + gViewerWindow->mouseDirectionGlobal(mSteerPick.mMousePt.mX, mSteerPick.mMousePt.mY) * 100.f); + } + mMouseOutsideSlop = true; mAbortClickToWalk = true; setMouseCapture(TRUE); @@ -1721,7 +1746,7 @@ void LLToolPie::startCameraSteering() mMouseSteerX = mMouseDownX; mMouseSteerY = mMouseDownY; const LLVector3 camera_to_rotation_center = gAgent.getFrameAgent().getOrigin() - LLViewerCamera::instance().getOrigin(); - const LLVector3 rotation_center_to_pick = gAgent.getPosAgentFromGlobal(mDragPick.mPosGlobal) - gAgent.getFrameAgent().getOrigin(); + const LLVector3 rotation_center_to_pick = gAgent.getPosAgentFromGlobal(mSteerPick.mPosGlobal) - gAgent.getFrameAgent().getOrigin(); mClockwise = camera_to_rotation_center * rotation_center_to_pick < 0.f; mMouseSteerGrabPoint= (LLHUDEffectBlob *)LLHUDManager::getInstance()->createViewerEffect(LLHUDObject::LL_HUD_EFFECT_BLOB, FALSE); @@ -1734,7 +1759,7 @@ void LLToolPie::steerCameraWithMouse(S32 x, S32 y) { const F32 MIN_ROTATION_RADIUS_FRACTION = 0.2f; - const LLVector3 pick_pos = gAgent.getPosAgentFromGlobal(mDragPick.mPosGlobal); + const LLVector3 pick_pos = gAgent.getPosAgentFromGlobal(mSteerPick.mPosGlobal); const LLVector3 rotation_center = gAgent.getFrameAgent().getOrigin(); // FIXME: get this to work with camera tilt (i.e. sitting on a rotating object) const LLVector3 rotation_up_axis(LLVector3::z_axis); diff --git a/indra/newview/lltoolpie.h b/indra/newview/lltoolpie.h index dca661d26d..01e74a20d7 100644 --- a/indra/newview/lltoolpie.h +++ b/indra/newview/lltoolpie.h @@ -108,7 +108,7 @@ private: LLUUID mMediaMouseCaptureID; LLPickInfo mPick; LLPickInfo mHoverPick; - LLPickInfo mDragPick; + LLPickInfo mSteerPick; LLPointer mClickActionObject; U8 mClickAction; LLSafeHandle mLeftClickSelection; -- cgit v1.2.3 From 731037245f5ad7a85c223b5e4a5f56e570bb42fe Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Mon, 14 Mar 2011 13:35:04 -0700 Subject: SOCIAL-715 FIX clicking on own nametag or head causes avatar to walk backward --- indra/newview/lltoolpie.cpp | 43 ++++++++++++++++++++++++++++--------------- 1 file changed, 28 insertions(+), 15 deletions(-) (limited to 'indra') diff --git a/indra/newview/lltoolpie.cpp b/indra/newview/lltoolpie.cpp index c0b5c8de70..959535d224 100644 --- a/indra/newview/lltoolpie.cpp +++ b/indra/newview/lltoolpie.cpp @@ -638,6 +638,21 @@ BOOL LLToolPie::handleMouseUp(S32 x, S32 y, MASK mask) && (mPick.mPickType == LLPickInfo::PICK_LAND // we clicked on land || mPick.mObjectID.notNull())) // or on an object { + // handle special cases of steering picks + LLViewerObject* avatar_object = mPick.getObject(); + + // get pointer to avatar + while (avatar_object && !avatar_object->isAvatar()) + { + avatar_object = (LLViewerObject*)avatar_object->getParent(); + } + + if (avatar_object && ((LLVOAvatar*)avatar_object)->isSelf()) + { + const F64 SELF_CLICK_WALK_DISTANCE = 3.0; + // pretend we picked some point a bit in front of avatar + mPick.mPosGlobal = gAgent.getPositionGlobal() + LLVector3d(LLViewerCamera::instance().getAtAxis()) * SELF_CLICK_WALK_DISTANCE; + } gAgentCamera.setFocusOnAvatar(TRUE, TRUE); mAutoPilotDestination = (LLHUDEffectBlob *)LLHUDManager::getInstance()->createViewerEffect(LLHUDObject::LL_HUD_EFFECT_BLOB, FALSE); mAutoPilotDestination->setPositionGlobal(mPick.mPosGlobal); @@ -1715,25 +1730,23 @@ void LLToolPie::startCameraSteering() { mSteerPick = mPick; - LLPointer pick_object = mSteerPick.getObject(); // handle special cases of steering picks - if (pick_object) - { - LLViewerObject* avatar_object = pick_object; + LLViewerObject* avatar_object = mSteerPick.getObject(); - // get pointer to avatar - while (avatar_object && !avatar_object->isAvatar()) - { - avatar_object = (LLViewerObject*)avatar_object->getParent(); - } + // get pointer to avatar + while (avatar_object && !avatar_object->isAvatar()) + { + avatar_object = (LLViewerObject*)avatar_object->getParent(); + } - if (avatar_object && ((LLVOAvatar*)avatar_object)->isSelf()) - { - // project pick point a few meters in front of avatar - mSteerPick.mPosGlobal = gAgent.getPositionGlobal() + LLVector3d(LLViewerCamera::instance().getAtAxis()) * 3.0; - } + // if clicking on own avatar... + if (avatar_object && ((LLVOAvatar*)avatar_object)->isSelf()) + { + // ...project pick point a few meters in front of avatar + mSteerPick.mPosGlobal = gAgent.getPositionGlobal() + LLVector3d(LLViewerCamera::instance().getAtAxis()) * 3.0; } - else if (!mSteerPick.isValid()) + + if (!mSteerPick.isValid()) { mSteerPick.mPosGlobal = gAgent.getPosGlobalFromAgent( LLViewerCamera::instance().getOrigin() + gViewerWindow->mouseDirectionGlobal(mSteerPick.mMousePt.mX, mSteerPick.mMousePt.mY) * 100.f); -- cgit v1.2.3 From efc1d76aeb4dfd55131e503e70d883b79c528446 Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Mon, 14 Mar 2011 13:37:10 -0700 Subject: SOCIAL-651 FIX Remove text from login screen Mode selector --- indra/newview/skins/default/xui/en/panel_login.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra') diff --git a/indra/newview/skins/default/xui/en/panel_login.xml b/indra/newview/skins/default/xui/en/panel_login.xml index cec04b0b58..4c2faddfe4 100644 --- a/indra/newview/skins/default/xui/en/panel_login.xml +++ b/indra/newview/skins/default/xui/en/panel_login.xml @@ -137,7 +137,7 @@ label="Remember password" name="mode_combo" width="110">