From 0e10a83b6bc11d0a40f09e6ba59b30c0e1e343bd Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Mon, 14 Mar 2011 16:46:10 -0700 Subject: SOCIAL-695 FIX Selecting UI and then clicking on world to give focus back to viewer moves you to that location made this work when clicking on SL with another app in foreground visual feedback of ClickToWalk behavior --- indra/newview/llhudeffectblob.cpp | 34 +++++++++++++++++++++++++++++++++- indra/newview/llhudeffectblob.h | 5 ++++- indra/newview/llhudobject.cpp | 1 + indra/newview/lltoolpie.cpp | 26 ++++++++++++++++++-------- indra/newview/lltoolpie.h | 5 +++-- 5 files changed, 59 insertions(+), 12 deletions(-) diff --git a/indra/newview/llhudeffectblob.cpp b/indra/newview/llhudeffectblob.cpp index 6ef8fab4a6..f976a320ee 100644 --- a/indra/newview/llhudeffectblob.cpp +++ b/indra/newview/llhudeffectblob.cpp @@ -28,8 +28,15 @@ #include "llhudeffectblob.h" -LLHUDEffectBlob::LLHUDEffectBlob(const U8 type) : LLHUDEffect(type) +#include "llagent.h" +#include "llviewercamera.h" +#include "llrendersphere.h" + +LLHUDEffectBlob::LLHUDEffectBlob(const U8 type) +: LLHUDEffect(type), + mPixelSize(10) { + mTimer.start(); } LLHUDEffectBlob::~LLHUDEffectBlob() @@ -38,6 +45,31 @@ LLHUDEffectBlob::~LLHUDEffectBlob() void LLHUDEffectBlob::render() { + F32 time = mTimer.getElapsedTimeF32(); + if (mDuration < time) + { + markDead(); + } + + LLVector3 pos_agent = gAgent.getPosAgentFromGlobal(mPositionGlobal); + + LLVector3 pixel_up, pixel_right; + + LLViewerCamera::instance().getPixelVectors(pos_agent, pixel_up, pixel_right); + + LLGLSPipelineAlpha gls_pipeline_alpha; + gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE); + + LLColor4U color = mColor; + color.mV[VALPHA] = clamp_rescale(time, 0.f, mDuration, 255.f, 0.f); + glColor4ubv(color.mV); + + glPushMatrix(); + glTranslatef(pos_agent.mV[0], pos_agent.mV[1], pos_agent.mV[2]); + F32 scale = pixel_up.magVec() * (F32)mPixelSize; + glScalef(scale, scale, scale); + gSphere.render(0); + glPopMatrix(); } void LLHUDEffectBlob::renderForTimer() diff --git a/indra/newview/llhudeffectblob.h b/indra/newview/llhudeffectblob.h index 7757dc787c..5b0703cdaa 100644 --- a/indra/newview/llhudeffectblob.h +++ b/indra/newview/llhudeffectblob.h @@ -34,6 +34,8 @@ class LLHUDEffectBlob : public LLHUDEffect public: friend class LLHUDObject; + void setPixelSize(S32 pixels) { mPixelSize = pixels; } + protected: LLHUDEffectBlob(const U8 type); ~LLHUDEffectBlob(); @@ -41,7 +43,8 @@ protected: /*virtual*/ void render(); /*virtual*/ void renderForTimer(); private: - + S32 mPixelSize; + LLFrameTimer mTimer; }; #endif // LL_LLHUDEFFECTBLOB_H diff --git a/indra/newview/llhudobject.cpp b/indra/newview/llhudobject.cpp index 3efb8d287d..95d57d08d8 100644 --- a/indra/newview/llhudobject.cpp +++ b/indra/newview/llhudobject.cpp @@ -240,6 +240,7 @@ LLHUDEffect *LLHUDObject::addHUDEffect(const U8 type) break; case LL_HUD_EFFECT_BLOB: hud_objectp = new LLHUDEffectBlob(type); + break; default: llwarns << "Unknown type of hud effect:" << (U32) type << llendl; } diff --git a/indra/newview/lltoolpie.cpp b/indra/newview/lltoolpie.cpp index ef9f5a855c..f258b5d875 100644 --- a/indra/newview/lltoolpie.cpp +++ b/indra/newview/lltoolpie.cpp @@ -112,7 +112,6 @@ BOOL LLToolPie::handleMouseDown(S32 x, S32 y, MASK mask) mPick.mKeyMask = mask; mMouseButtonDown = true; - mAbortClickToWalk = false; handleLeftClickPick(); @@ -656,12 +655,16 @@ BOOL LLToolPie::handleMouseUp(S32 x, S32 y, MASK mask) mPick.mPosGlobal = gAgent.getPositionGlobal() + LLVector3d(LLViewerCamera::instance().getAtAxis()) * SELF_CLICK_WALK_DISTANCE; } gAgentCamera.setFocusOnAvatar(TRUE, TRUE); + if(mAutoPilotDestination) { mAutoPilotDestination->markDead(); } mAutoPilotDestination = (LLHUDEffectBlob *)LLHUDManager::getInstance()->createViewerEffect(LLHUDObject::LL_HUD_EFFECT_BLOB, FALSE); mAutoPilotDestination->setPositionGlobal(mPick.mPosGlobal); - mAutoPilotDestination->setColor(LLColor4U::white); - mAutoPilotDestination->setDuration(5.f); + mAutoPilotDestination->setPixelSize(5); + mAutoPilotDestination->setColor(LLColor4U(50, 50, 200)); + mAutoPilotDestination->setDuration(3.f); handle_go_to(); + mAbortClickToWalk = false; + return TRUE; } gViewerWindow->setCursor(UI_CURSOR_ARROW); @@ -672,6 +675,8 @@ BOOL LLToolPie::handleMouseUp(S32 x, S32 y, MASK mask) LLToolMgr::getInstance()->clearTransientTool(); gAgentCamera.setLookAt(LOOKAT_TARGET_CONVERSATION, obj); // maybe look at object/person clicked on + + mAbortClickToWalk = false; return LLTool::handleMouseUp(x, y, mask); } @@ -1292,6 +1297,10 @@ void LLToolPie::VisitHomePage(const LLPickInfo& info) } } +void LLToolPie::handleSelect() +{ + mAbortClickToWalk = true; +} void LLToolPie::handleDeselect() { @@ -1338,7 +1347,6 @@ void LLToolPie::onMouseCaptureLost() void LLToolPie::stopCameraSteering() { mMouseOutsideSlop = false; - mMouseSteerGrabPoint = NULL; } bool LLToolPie::inCameraSteerMode() @@ -1767,10 +1775,12 @@ void LLToolPie::startCameraSteering() 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); - mMouseSteerGrabPoint->setPositionGlobal(mPick.mPosGlobal); - mMouseSteerGrabPoint->setColor(LLColor4U::white); - mMouseSteerGrabPoint->setDuration(1000.f); + if (mMouseSteerGrabPoint) { mMouseSteerGrabPoint->markDead(); } + mMouseSteerGrabPoint = (LLHUDEffectBlob *)LLHUDManager::getInstance()->createViewerEffect(LLHUDObject::LL_HUD_EFFECT_BLOB, FALSE); + mMouseSteerGrabPoint->setPositionGlobal(mSteerPick.mPosGlobal); + mMouseSteerGrabPoint->setColor(LLColor4U(50, 50, 200)); + mMouseSteerGrabPoint->setPixelSize(5); + mMouseSteerGrabPoint->setDuration(2.f); } } diff --git a/indra/newview/lltoolpie.h b/indra/newview/lltoolpie.h index 01e74a20d7..c324b50c65 100644 --- a/indra/newview/lltoolpie.h +++ b/indra/newview/lltoolpie.h @@ -57,6 +57,7 @@ public: virtual void stopEditing(); virtual void onMouseCaptureLost(); + virtual void handleSelect(); virtual void handleDeselect(); virtual LLTool* getOverrideTool(MASK mask); @@ -101,8 +102,8 @@ private: S32 mMouseDownY; S32 mMouseSteerX; S32 mMouseSteerY; - LLHUDEffectBlob* mAutoPilotDestination; - LLHUDEffectBlob* mMouseSteerGrabPoint; + LLPointer mAutoPilotDestination; + LLPointer mMouseSteerGrabPoint; bool mClockwise; bool mAbortClickToWalk; LLUUID mMediaMouseCaptureID; -- cgit v1.2.3