LLAgentCamera transition (1/2)
This commit is contained in:
@@ -36,6 +36,7 @@
|
||||
#include "llviewerkeyboard.h"
|
||||
#include "llmath.h"
|
||||
#include "llagent.h"
|
||||
#include "llagentcamera.h"
|
||||
#include "llchatbar.h"
|
||||
#include "llviewercontrol.h"
|
||||
#include "llfocusmgr.h"
|
||||
@@ -246,22 +247,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);
|
||||
@@ -269,7 +270,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() );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -277,7 +278,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);
|
||||
@@ -285,7 +286,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() );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -293,22 +294,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);
|
||||
@@ -316,7 +317,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() );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -324,7 +325,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);
|
||||
@@ -332,35 +333,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() );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -369,70 +370,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);
|
||||
}
|
||||
|
||||
|
||||
@@ -440,7 +441,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() );
|
||||
}
|
||||
|
||||
@@ -449,7 +450,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() );
|
||||
}
|
||||
|
||||
@@ -457,7 +458,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() );
|
||||
}
|
||||
|
||||
@@ -466,7 +467,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() );
|
||||
}
|
||||
|
||||
@@ -474,7 +475,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();
|
||||
}
|
||||
|
||||
@@ -483,7 +484,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();
|
||||
}
|
||||
|
||||
@@ -834,7 +835,7 @@ S32 LLViewerKeyboard::loadBindings(const std::string& filename)
|
||||
|
||||
EKeyboardMode LLViewerKeyboard::getMode()
|
||||
{
|
||||
if ( gAgent.cameraMouselook() )
|
||||
if ( gAgentCamera.cameraMouselook() )
|
||||
{
|
||||
return MODE_FIRST_PERSON;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user