summaryrefslogtreecommitdiff
path: root/indra/newview/llviewerkeyboard.cpp
diff options
context:
space:
mode:
authorTofu Linden <tofu.linden@lindenlab.com>2010-03-30 13:15:36 +0100
committerTofu Linden <tofu.linden@lindenlab.com>2010-03-30 13:15:36 +0100
commit61774546f0b260c18c5308143a9c3d02a5e5245e (patch)
tree4566b4f91c2e02956143647067ae642570bb907a /indra/newview/llviewerkeyboard.cpp
parentccd5b9e2f3f1139814a63d9db03c3671c249930c (diff)
parente1517318c58d6796b5566d5cf96c02474fd7376e (diff)
HUGE merge from viewer-trunk. Many conflicts resolved.
Diffstat (limited to 'indra/newview/llviewerkeyboard.cpp')
-rw-r--r--indra/newview/llviewerkeyboard.cpp97
1 files changed, 49 insertions, 48 deletions
diff --git a/indra/newview/llviewerkeyboard.cpp b/indra/newview/llviewerkeyboard.cpp
index f757155b94..dd7390a907 100644
--- a/indra/newview/llviewerkeyboard.cpp
+++ b/indra/newview/llviewerkeyboard.cpp
@@ -36,6 +36,7 @@
#include "llviewerkeyboard.h"
#include "llmath.h"
#include "llagent.h"
+#include "llagentcamera.h"
#include "llnearbychatbar.h"
#include "llviewercontrol.h"
#include "llfocusmgr.h"
@@ -279,22 +280,22 @@ F32 get_orbit_rate()
void camera_spin_around_ccw( EKeystate s )
{
if( KEYSTATE_UP == s ) return;
- gAgent.unlockView();
- gAgent.setOrbitLeftKey( get_orbit_rate() );
+ gAgentCamera.unlockView();
+ gAgentCamera.setOrbitLeftKey( get_orbit_rate() );
}
void camera_spin_around_cw( EKeystate s )
{
if( KEYSTATE_UP == s ) return;
- gAgent.unlockView();
- gAgent.setOrbitRightKey( get_orbit_rate() );
+ gAgentCamera.unlockView();
+ gAgentCamera.setOrbitRightKey( get_orbit_rate() );
}
void camera_spin_around_ccw_sitting( EKeystate s )
{
if( KEYSTATE_UP == s ) return;
- if (gAgent.rotateGrabbed() || gAgent.sitCameraEnabled())
+ if (gAgent.rotateGrabbed() || gAgentCamera.sitCameraEnabled())
{
//send keystrokes, but do not change camera
agent_turn_right(s);
@@ -302,7 +303,7 @@ void camera_spin_around_ccw_sitting( EKeystate s )
else
{
//change camera but do not send keystrokes
- gAgent.setOrbitLeftKey( get_orbit_rate() );
+ gAgentCamera.setOrbitLeftKey( get_orbit_rate() );
}
}
@@ -310,7 +311,7 @@ void camera_spin_around_ccw_sitting( EKeystate s )
void camera_spin_around_cw_sitting( EKeystate s )
{
if( KEYSTATE_UP == s ) return;
- if (gAgent.rotateGrabbed() || gAgent.sitCameraEnabled())
+ if (gAgent.rotateGrabbed() || gAgentCamera.sitCameraEnabled())
{
//send keystrokes, but do not change camera
agent_turn_left(s);
@@ -318,7 +319,7 @@ void camera_spin_around_cw_sitting( EKeystate s )
else
{
//change camera but do not send keystrokes
- gAgent.setOrbitRightKey( get_orbit_rate() );
+ gAgentCamera.setOrbitRightKey( get_orbit_rate() );
}
}
@@ -326,22 +327,22 @@ void camera_spin_around_cw_sitting( EKeystate s )
void camera_spin_over( EKeystate s )
{
if( KEYSTATE_UP == s ) return;
- gAgent.unlockView();
- gAgent.setOrbitUpKey( get_orbit_rate() );
+ gAgentCamera.unlockView();
+ gAgentCamera.setOrbitUpKey( get_orbit_rate() );
}
void camera_spin_under( EKeystate s )
{
if( KEYSTATE_UP == s ) return;
- gAgent.unlockView();
- gAgent.setOrbitDownKey( get_orbit_rate() );
+ gAgentCamera.unlockView();
+ gAgentCamera.setOrbitDownKey( get_orbit_rate() );
}
void camera_spin_over_sitting( EKeystate s )
{
if( KEYSTATE_UP == s ) return;
- if (gAgent.upGrabbed() || gAgent.sitCameraEnabled())
+ if (gAgent.upGrabbed() || gAgentCamera.sitCameraEnabled())
{
//send keystrokes, but do not change camera
agent_jump(s);
@@ -349,7 +350,7 @@ void camera_spin_over_sitting( EKeystate s )
else
{
//change camera but do not send keystrokes
- gAgent.setOrbitUpKey( get_orbit_rate() );
+ gAgentCamera.setOrbitUpKey( get_orbit_rate() );
}
}
@@ -357,7 +358,7 @@ void camera_spin_over_sitting( EKeystate s )
void camera_spin_under_sitting( EKeystate s )
{
if( KEYSTATE_UP == s ) return;
- if (gAgent.downGrabbed() || gAgent.sitCameraEnabled())
+ if (gAgent.downGrabbed() || gAgentCamera.sitCameraEnabled())
{
//send keystrokes, but do not change camera
agent_push_down(s);
@@ -365,35 +366,35 @@ void camera_spin_under_sitting( EKeystate s )
else
{
//change camera but do not send keystrokes
- gAgent.setOrbitDownKey( get_orbit_rate() );
+ gAgentCamera.setOrbitDownKey( get_orbit_rate() );
}
}
void camera_move_forward( EKeystate s )
{
if( KEYSTATE_UP == s ) return;
- gAgent.unlockView();
- gAgent.setOrbitInKey( get_orbit_rate() );
+ gAgentCamera.unlockView();
+ gAgentCamera.setOrbitInKey( get_orbit_rate() );
}
void camera_move_backward( EKeystate s )
{
if( KEYSTATE_UP == s ) return;
- gAgent.unlockView();
- gAgent.setOrbitOutKey( get_orbit_rate() );
+ gAgentCamera.unlockView();
+ gAgentCamera.setOrbitOutKey( get_orbit_rate() );
}
void camera_move_forward_sitting( EKeystate s )
{
if( KEYSTATE_UP == s ) return;
- if (gAgent.forwardGrabbed() || gAgent.sitCameraEnabled())
+ if (gAgent.forwardGrabbed() || gAgentCamera.sitCameraEnabled())
{
agent_push_forward(s);
}
else
{
- gAgent.setOrbitInKey( get_orbit_rate() );
+ gAgentCamera.setOrbitInKey( get_orbit_rate() );
}
}
@@ -402,70 +403,70 @@ void camera_move_backward_sitting( EKeystate s )
{
if( KEYSTATE_UP == s ) return;
- if (gAgent.backwardGrabbed() || gAgent.sitCameraEnabled())
+ if (gAgent.backwardGrabbed() || gAgentCamera.sitCameraEnabled())
{
agent_push_backward(s);
}
else
{
- gAgent.setOrbitOutKey( get_orbit_rate() );
+ gAgentCamera.setOrbitOutKey( get_orbit_rate() );
}
}
void camera_pan_up( EKeystate s )
{
if( KEYSTATE_UP == s ) return;
- gAgent.unlockView();
- gAgent.setPanUpKey( get_orbit_rate() );
+ gAgentCamera.unlockView();
+ gAgentCamera.setPanUpKey( get_orbit_rate() );
}
void camera_pan_down( EKeystate s )
{
if( KEYSTATE_UP == s ) return;
- gAgent.unlockView();
- gAgent.setPanDownKey( get_orbit_rate() );
+ gAgentCamera.unlockView();
+ gAgentCamera.setPanDownKey( get_orbit_rate() );
}
void camera_pan_left( EKeystate s )
{
if( KEYSTATE_UP == s ) return;
- gAgent.unlockView();
- gAgent.setPanLeftKey( get_orbit_rate() );
+ gAgentCamera.unlockView();
+ gAgentCamera.setPanLeftKey( get_orbit_rate() );
}
void camera_pan_right( EKeystate s )
{
if( KEYSTATE_UP == s ) return;
- gAgent.unlockView();
- gAgent.setPanRightKey( get_orbit_rate() );
+ gAgentCamera.unlockView();
+ gAgentCamera.setPanRightKey( get_orbit_rate() );
}
void camera_pan_in( EKeystate s )
{
if( KEYSTATE_UP == s ) return;
- gAgent.unlockView();
- gAgent.setPanInKey( get_orbit_rate() );
+ gAgentCamera.unlockView();
+ gAgentCamera.setPanInKey( get_orbit_rate() );
}
void camera_pan_out( EKeystate s )
{
if( KEYSTATE_UP == s ) return;
- gAgent.unlockView();
- gAgent.setPanOutKey( get_orbit_rate() );
+ gAgentCamera.unlockView();
+ gAgentCamera.setPanOutKey( get_orbit_rate() );
}
void camera_move_forward_fast( EKeystate s )
{
if( KEYSTATE_UP == s ) return;
- gAgent.unlockView();
- gAgent.setOrbitInKey(2.5f);
+ gAgentCamera.unlockView();
+ gAgentCamera.setOrbitInKey(2.5f);
}
void camera_move_backward_fast( EKeystate s )
{
if( KEYSTATE_UP == s ) return;
- gAgent.unlockView();
- gAgent.setOrbitOutKey(2.5f);
+ gAgentCamera.unlockView();
+ gAgentCamera.setOrbitOutKey(2.5f);
}
@@ -473,7 +474,7 @@ void edit_avatar_spin_ccw( EKeystate s )
{
if( KEYSTATE_UP == s ) return;
gMorphView->setCameraDrivenByKeys( TRUE );
- gAgent.setOrbitLeftKey( get_orbit_rate() );
+ gAgentCamera.setOrbitLeftKey( get_orbit_rate() );
//gMorphView->orbitLeft( get_orbit_rate() );
}
@@ -482,7 +483,7 @@ void edit_avatar_spin_cw( EKeystate s )
{
if( KEYSTATE_UP == s ) return;
gMorphView->setCameraDrivenByKeys( TRUE );
- gAgent.setOrbitRightKey( get_orbit_rate() );
+ gAgentCamera.setOrbitRightKey( get_orbit_rate() );
//gMorphView->orbitRight( get_orbit_rate() );
}
@@ -490,7 +491,7 @@ void edit_avatar_spin_over( EKeystate s )
{
if( KEYSTATE_UP == s ) return;
gMorphView->setCameraDrivenByKeys( TRUE );
- gAgent.setOrbitUpKey( get_orbit_rate() );
+ gAgentCamera.setOrbitUpKey( get_orbit_rate() );
//gMorphView->orbitUp( get_orbit_rate() );
}
@@ -499,7 +500,7 @@ void edit_avatar_spin_under( EKeystate s )
{
if( KEYSTATE_UP == s ) return;
gMorphView->setCameraDrivenByKeys( TRUE );
- gAgent.setOrbitDownKey( get_orbit_rate() );
+ gAgentCamera.setOrbitDownKey( get_orbit_rate() );
//gMorphView->orbitDown( get_orbit_rate() );
}
@@ -507,7 +508,7 @@ void edit_avatar_move_forward( EKeystate s )
{
if( KEYSTATE_UP == s ) return;
gMorphView->setCameraDrivenByKeys( TRUE );
- gAgent.setOrbitInKey( get_orbit_rate() );
+ gAgentCamera.setOrbitInKey( get_orbit_rate() );
//gMorphView->orbitIn();
}
@@ -516,7 +517,7 @@ void edit_avatar_move_backward( EKeystate s )
{
if( KEYSTATE_UP == s ) return;
gMorphView->setCameraDrivenByKeys( TRUE );
- gAgent.setOrbitOutKey( get_orbit_rate() );
+ gAgentCamera.setOrbitOutKey( get_orbit_rate() );
//gMorphView->orbitOut();
}
@@ -868,7 +869,7 @@ S32 LLViewerKeyboard::loadBindings(const std::string& filename)
EKeyboardMode LLViewerKeyboard::getMode()
{
- if ( gAgent.cameraMouselook() )
+ if ( gAgentCamera.cameraMouselook() )
{
return MODE_FIRST_PERSON;
}
@@ -876,7 +877,7 @@ EKeyboardMode LLViewerKeyboard::getMode()
{
return MODE_EDIT_AVATAR;
}
- else if (gAgent.getAvatarObject() && gAgent.getAvatarObject()->isSitting())
+ else if (isAgentAvatarValid() && gAgentAvatarp->isSitting())
{
return MODE_SITTING;
}