diff options
author | Andrey Kleshchev <andreykproductengine@lindenlab.com> | 2020-06-18 20:50:54 +0300 |
---|---|---|
committer | Andrey Kleshchev <andreykproductengine@lindenlab.com> | 2020-06-23 14:51:30 +0300 |
commit | f08c8ef2082e193cf3822d76357b60f133130afc (patch) | |
tree | 052e8eb67abf5606a9d0f417637e1f28654bbb41 | |
parent | f6662ffb26208a40f7c823c67e53f36b0267b71c (diff) |
SL-13481 Fixed mouselook teleport not having up to date data
-rw-r--r-- | indra/newview/lltoolpie.cpp | 31 |
1 files changed, 27 insertions, 4 deletions
diff --git a/indra/newview/lltoolpie.cpp b/indra/newview/lltoolpie.cpp index dd429d4ccf..0839ea6cf5 100644 --- a/indra/newview/lltoolpie.cpp +++ b/indra/newview/lltoolpie.cpp @@ -547,10 +547,23 @@ bool LLToolPie::walkToClickedLocation() } LLPickInfo saved_pick = mPick; - mPick = gViewerWindow->pickImmediate(mHoverPick.mMousePt.mX, mHoverPick.mMousePt.mY, - FALSE /* ignore transparent */, - FALSE /* ignore rigged */, - FALSE /* ignore particles */); + if (gAgentCamera.getCameraMode() != CAMERA_MODE_MOUSELOOK) + { + mPick = gViewerWindow->pickImmediate(mHoverPick.mMousePt.mX, mHoverPick.mMousePt.mY, + FALSE /* ignore transparent */, + FALSE /* ignore rigged */, + FALSE /* ignore particles */); + } + else + { + // We do not handle hover in mouselook as we do in other modes, so + // use croshair's position to do a pick + mPick = gViewerWindow->pickImmediate(gViewerWindow->getWorldViewRectScaled().getWidth() / 2, + gViewerWindow->getWorldViewRectScaled().getHeight() / 2, + FALSE /* ignore transparent */, + FALSE /* ignore rigged */, + FALSE /* ignore particles */); + } if (mPick.mPickType == LLPickInfo::PICK_OBJECT) { @@ -609,6 +622,16 @@ bool LLToolPie::walkToClickedLocation() bool LLToolPie::teleportToClickedLocation() { + if (gAgentCamera.getCameraMode() == CAMERA_MODE_MOUSELOOK) + { + // We do not handle hover in mouselook as we do in other modes, so + // use croshair's position to do a pick + BOOL pick_rigged = false; + mHoverPick = gViewerWindow->pickImmediate(gViewerWindow->getWorldViewRectScaled().getWidth() / 2, + gViewerWindow->getWorldViewRectScaled().getHeight() / 2, + FALSE, + pick_rigged); + } LLViewerObject* objp = mHoverPick.getObject(); LLViewerObject* parentp = objp ? objp->getRootEdit() : NULL; |