summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--indra/newview/CMakeLists.txt2
-rw-r--r--indra/newview/llhudeffectblob.cpp42
-rw-r--r--indra/newview/llhudeffectblob.h47
-rw-r--r--indra/newview/llhudobject.cpp3
-rw-r--r--indra/newview/llhudobject.h3
-rw-r--r--indra/newview/lltoolpie.cpp59
-rw-r--r--indra/newview/lltoolpie.h5
7 files changed, 145 insertions, 16 deletions
diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt
index 4ed59f039e..66869288b6 100644
--- a/indra/newview/CMakeLists.txt
+++ b/indra/newview/CMakeLists.txt
@@ -246,6 +246,7 @@ set(viewer_SOURCE_FILES
llhudeffectlookat.cpp
llhudeffectpointat.cpp
llhudeffecttrail.cpp
+ llhudeffectblob.cpp
llhudicon.cpp
llhudmanager.cpp
llhudnametag.cpp
@@ -786,6 +787,7 @@ set(viewer_HEADER_FILES
llhudeffectlookat.h
llhudeffectpointat.h
llhudeffecttrail.h
+ llhudeffectblob.h
llhudicon.h
llhudmanager.h
llhudnametag.h
diff --git a/indra/newview/llhudeffectblob.cpp b/indra/newview/llhudeffectblob.cpp
new file mode 100644
index 0000000000..e790c954b0
--- /dev/null
+++ b/indra/newview/llhudeffectblob.cpp
@@ -0,0 +1,42 @@
+/**
+ * @file llhudeffecttrail.cpp
+ * @brief LLHUDEffectSpiral class implementation
+ *
+ * $LicenseInfo:firstyear=2002&license=viewerlgpl$
+ * Second Life Viewer Source Code
+ * Copyright (C) 2010, Linden Research, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation;
+ * version 2.1 of the License only.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ *
+ * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
+ * $/LicenseInfo$
+ */
+
+#include "llviewerprecompiledheaders.h"
+
+#include "llhudeffectblob.h"
+
+LLHUDEffectBlob::LLHUDEffectBlob(const U8 type) : LLHUDEffect(type)
+{
+}
+
+LLHUDEffectBlob::~LLHUDEffectBlob()
+{
+}
+
+void LLHUDEffectBlob::render()
+{
+}
+
diff --git a/indra/newview/llhudeffectblob.h b/indra/newview/llhudeffectblob.h
new file mode 100644
index 0000000000..7757dc787c
--- /dev/null
+++ b/indra/newview/llhudeffectblob.h
@@ -0,0 +1,47 @@
+/**
+ * @file llhudeffectblob.h
+ * @brief LLHUDEffectBlob class definition
+ *
+ * $LicenseInfo:firstyear=2002&license=viewerlgpl$
+ * Second Life Viewer Source Code
+ * Copyright (C) 2010, Linden Research, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation;
+ * version 2.1 of the License only.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ *
+ * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
+ * $/LicenseInfo$
+ */
+
+#ifndef LL_LLHUDEFFECTBLOB_H
+#define LL_LLHUDEFFECTBLOB_H
+
+#include "llhudeffect.h"
+
+class LLHUDEffectBlob : public LLHUDEffect
+{
+public:
+ friend class LLHUDObject;
+
+protected:
+ LLHUDEffectBlob(const U8 type);
+ ~LLHUDEffectBlob();
+
+ /*virtual*/ void render();
+ /*virtual*/ void renderForTimer();
+private:
+
+};
+
+#endif // LL_LLHUDEFFECTBLOB_H
diff --git a/indra/newview/llhudobject.cpp b/indra/newview/llhudobject.cpp
index 5e762ee037..3efb8d287d 100644
--- a/indra/newview/llhudobject.cpp
+++ b/indra/newview/llhudobject.cpp
@@ -32,6 +32,7 @@
#include "llhudtext.h"
#include "llhudicon.h"
#include "llhudeffectbeam.h"
+#include "llhudeffectblob.h"
#include "llhudeffecttrail.h"
#include "llhudeffectlookat.h"
#include "llhudeffectpointat.h"
@@ -237,6 +238,8 @@ LLHUDEffect *LLHUDObject::addHUDEffect(const U8 type)
case LL_HUD_EFFECT_POINTAT:
hud_objectp = new LLHUDEffectPointAt(type);
break;
+ case LL_HUD_EFFECT_BLOB:
+ hud_objectp = new LLHUDEffectBlob(type);
default:
llwarns << "Unknown type of hud effect:" << (U32) type << llendl;
}
diff --git a/indra/newview/llhudobject.h b/indra/newview/llhudobject.h
index 33e6394445..2f7a98c86c 100644
--- a/indra/newview/llhudobject.h
+++ b/indra/newview/llhudobject.h
@@ -95,7 +95,8 @@ public:
LL_HUD_EFFECT_LOOKAT,
LL_HUD_EFFECT_POINTAT,
LL_HUD_EFFECT_VOICE_VISUALIZER, // Ventrella
- LL_HUD_NAME_TAG
+ LL_HUD_NAME_TAG,
+ LL_HUD_EFFECT_BLOB
};
protected:
static void sortObjects();
diff --git a/indra/newview/lltoolpie.cpp b/indra/newview/lltoolpie.cpp
index c98feca91c..5bfc69016b 100644
--- a/indra/newview/lltoolpie.cpp
+++ b/indra/newview/lltoolpie.cpp
@@ -42,6 +42,7 @@
#include "llfloaterreg.h"
#include "llfloaterscriptdebug.h"
#include "lltooltip.h"
+#include "llhudeffectblob.h"
#include "llhudeffecttrail.h"
#include "llhudmanager.h"
#include "llkeyboard.h"
@@ -79,8 +80,10 @@ static ECursorType cursor_from_parcel_media(U8 click_action);
LLToolPie::LLToolPie()
: LLTool(std::string("Pie")),
- mMouseButtonDown( FALSE ),
- mMouseOutsideSlop( FALSE ),
+ mMouseButtonDown( false ),
+ mMouseOutsideSlop( false ),
+ mMouseSteerX(-1),
+ mMouseSteerY(-1),
mClickAction(0),
mClickActionBuyEnabled( gSavedSettings.getBOOL("ClickActionBuyEnabled") ),
mClickActionPayEnabled( gSavedSettings.getBOOL("ClickActionPayEnabled") )
@@ -108,7 +111,7 @@ BOOL LLToolPie::handleMouseDown(S32 x, S32 y, MASK mask)
mPick.mKeyMask = mask;
mDragPick = mPick;
- mMouseButtonDown = TRUE;
+ mMouseButtonDown = true;
handleLeftClickPick();
@@ -310,6 +313,7 @@ BOOL LLToolPie::handleLeftClickPick()
)
{
gGrabTransientTool = this;
+ mMouseButtonDown = false;
LLToolMgr::getInstance()->getCurrentToolset()->selectTool( LLToolGrab::getInstance() );
return LLToolGrab::getInstance()->handleObjectHit( mPick );
}
@@ -327,7 +331,7 @@ BOOL LLToolPie::handleLeftClickPick()
// mouse already released
if (!mMouseButtonDown)
{
- return TRUE;
+ return true;
}
while( object && object->isAttachment() && !object->flagHandleTouch())
@@ -339,9 +343,10 @@ BOOL LLToolPie::handleLeftClickPick()
}
object = (LLViewerObject*)object->getParent();
}
- if (object && object == gAgentAvatarp)
+ if (object && object == gAgentAvatarp && !gSavedSettings.getBOOL("ClickToWalk"))
{
// we left clicked on avatar, switch to focus mode
+ mMouseButtonDown = false;
LLToolMgr::getInstance()->setTransientTool(LLToolCamera::getInstance());
gViewerWindow->hideCursor();
LLToolCamera::getInstance()->setMouseCapture(TRUE);
@@ -527,16 +532,15 @@ BOOL LLToolPie::handleHover(S32 x, S32 y, MASK mask)
if (delta_x * delta_x + delta_y * delta_y > threshold * threshold)
{
startCameraSteering();
- mMouseOutsideSlop = TRUE;
- setMouseCapture(TRUE);
}
}
mHoverPick = gViewerWindow->pickImmediate(x, y, FALSE);
- if (mMouseOutsideSlop)
+ if (inCameraSteerMode())
{
steerCameraWithMouse(x, y);
+ gViewerWindow->setCursor(UI_CURSOR_TOOLGRAB);
return TRUE;
}
@@ -614,16 +618,23 @@ BOOL LLToolPie::handleMouseUp(S32 x, S32 y, MASK mask)
bool media_handled_click = handleMediaMouseUp() || LLViewerMediaFocus::getInstance()->getFocus();
bool mouse_moved = mMouseOutsideSlop;
- mMouseOutsideSlop = FALSE;
- mMouseButtonDown = FALSE;
+ stopCameraSteering();
+ mMouseButtonDown = false;
if (!media_handled_click && click_action == CLICK_ACTION_NONE && !mouse_moved)
{
if (gSavedSettings.getBOOL("ClickToWalk") // click to walk enabled
+ && !gFocusMgr.getKeyboardFocus() // focus is on world
&& !mPick.mPosGlobal.isExactlyZero() // valid coordinates for pick
&& (mPick.mPickType == LLPickInfo::PICK_LAND // we clicked on land
|| mPick.mObjectID.notNull())) // or on an object
{
+ gAgentCamera.setFocusOnAvatar(TRUE, TRUE);
+ mAutoPilotDestination = (LLHUDEffectBlob *)LLHUDManager::getInstance()->createViewerEffect(LLHUDObject::LL_HUD_EFFECT_BLOB, FALSE);
+ mAutoPilotDestination->setPositionGlobal(mPick.mPosGlobal);
+ mAutoPilotDestination->setColor(LLColor4U::white);
+ mAutoPilotDestination->setDuration(5.f);
+
handle_go_to();
return TRUE;
}
@@ -1294,11 +1305,21 @@ void LLToolPie::stopEditing()
void LLToolPie::onMouseCaptureLost()
{
- mMouseOutsideSlop = FALSE;
- mMouseButtonDown = FALSE;
+ stopCameraSteering();
+ mMouseButtonDown = false;
handleMediaMouseUp();
}
+void LLToolPie::stopCameraSteering()
+{
+ mMouseOutsideSlop = false;
+ mMouseSteerGrabPoint = NULL;
+}
+
+bool LLToolPie::inCameraSteerMode()
+{
+ return mMouseButtonDown && mMouseOutsideSlop;
+}
// true if x,y outside small box around start_x,start_y
BOOL LLToolPie::outsideSlop(S32 x, S32 y, S32 start_x, S32 start_y)
@@ -1684,12 +1705,19 @@ bool intersect_ray_with_sphere( const LLVector3& ray_pt, const LLVector3& ray_di
void LLToolPie::startCameraSteering()
{
+ mMouseOutsideSlop = true;
+ setMouseCapture(TRUE);
+
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 camera_to_rotation_center = gAgent.getFrameAgent().getOrigin() - LLViewerCamera::instance().getOrigin();
+ const LLVector3 rotation_center_to_pick = gAgent.getPosAgentFromGlobal(mDragPick.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);
}
void LLToolPie::steerCameraWithMouse(S32 x, S32 y)
@@ -1698,7 +1726,8 @@ void LLToolPie::steerCameraWithMouse(S32 x, S32 y)
const LLVector3 pick_pos = gAgent.getPosAgentFromGlobal(mDragPick.mPosGlobal);
const LLVector3 rotation_center = gAgent.getFrameAgent().getOrigin();
- const LLVector3 rotation_up_axis(gAgent.getReferenceUpVector());
+ // FIXME: get this to work with camera tilt (i.e. sitting on a rotating object)
+ const LLVector3 rotation_up_axis(LLVector3::z_axis);
LLVector3 pick_offset = pick_pos - rotation_center;
F32 up_distance = pick_offset * rotation_up_axis;
diff --git a/indra/newview/lltoolpie.h b/indra/newview/lltoolpie.h
index 26dcbd35e6..1ac1c35bcc 100644
--- a/indra/newview/lltoolpie.h
+++ b/indra/newview/lltoolpie.h
@@ -33,6 +33,7 @@
class LLViewerObject;
class LLObjectSelection;
+class LLHUDEffectBlob;
class LLToolPie : public LLTool, public LLSingleton<LLToolPie>
{
@@ -90,6 +91,8 @@ private:
void steerCameraWithMouse(S32 x, S32 y);
void startCameraSteering();
+ void stopCameraSteering();
+ bool inCameraSteerMode();
private:
bool mMouseButtonDown;
@@ -98,6 +101,8 @@ private:
S32 mMouseDownY;
S32 mMouseSteerX;
S32 mMouseSteerY;
+ LLHUDEffectBlob* mAutoPilotDestination;
+ LLHUDEffectBlob* mMouseSteerGrabPoint;
bool mClockwise;
LLUUID mMediaMouseCaptureID;
LLPickInfo mPick;