diff options
Diffstat (limited to 'indra/newview/lltoolfocus.cpp')
| -rw-r--r-- | indra/newview/lltoolfocus.cpp | 42 |
1 files changed, 40 insertions, 2 deletions
diff --git a/indra/newview/lltoolfocus.cpp b/indra/newview/lltoolfocus.cpp index b8878b1e6f..a93f37e09a 100644 --- a/indra/newview/lltoolfocus.cpp +++ b/indra/newview/lltoolfocus.cpp @@ -62,6 +62,8 @@ bool gCameraBtnPan = false; const S32 SLOP_RANGE = 4; +extern bool agent_push_forward(const LLKeyPressState& s); + // // Camera - shared functionality // @@ -80,8 +82,10 @@ LLToolCamera::LLToolCamera() mMouseSteering(false), mMouseUpX(0), mMouseUpY(0), - mMouseUpMask(MASK_NONE) -{ } + mMouseUpMask(MASK_NONE), + mKeyState(LLKeyPressState(false,false,false,1.0)) +{ +} LLToolCamera::~LLToolCamera() @@ -337,6 +341,12 @@ bool LLToolCamera::handleMouseUp(S32 x, S32 y, MASK mask) bool LLToolCamera::handleHover(S32 x, S32 y, MASK mask) { + if (gViewerWindow->getRightMouseDown()) + { + mKeyState.mState = KEYSTATE_LEVEL; + agent_push_forward(mKeyState); + } + S32 dx = gViewerWindow->getCurrentMouseDX(); S32 dy = gViewerWindow->getCurrentMouseDY(); @@ -471,8 +481,36 @@ bool LLToolCamera::handleHover(S32 x, S32 y, MASK mask) return true; } +bool LLToolCamera::handleRightMouseDown(S32 x, S32 y, MASK mask) +{ + if(mMouseSteering) + { + mKeyState.mState = KEYSTATE_DOWN; + agent_push_forward(mKeyState); + return true; + } + else + { + return false; + } +} + +bool LLToolCamera::handleRightMouseUp(S32 x, S32 y, MASK mask) +{ + if (mMouseSteering) + { + mKeyState.mState = KEYSTATE_UP; + agent_push_forward(mKeyState); + return true; + } + else + { + return false; + } +} void LLToolCamera::onMouseCaptureLost() { releaseMouse(); + handleRightMouseUp(0, 0, 0); } |
