summaryrefslogtreecommitdiff
path: root/indra/newview/lltoolfocus.cpp
diff options
context:
space:
mode:
authorVadim Savchuk <vsavchuk@productengine.com>2010-03-26 19:00:27 +0200
committerVadim Savchuk <vsavchuk@productengine.com>2010-03-26 19:00:27 +0200
commita5227864bd7ca930b41041ff80b20c30474f5f8c (patch)
tree0a7f77c543184209717be29dfc24e1d05d320a00 /indra/newview/lltoolfocus.cpp
parent3f3c9c7e255e090c7f09dafd08ec20f2d8a09c6d (diff)
parentb74e1d942352e81e0cc00e21ef3b351152b32248 (diff)
Manual merge from default branch
Resolved conflict in indra/newview/llviewerwindow.cpp. --HG-- branch : product-engine
Diffstat (limited to 'indra/newview/lltoolfocus.cpp')
-rw-r--r--indra/newview/lltoolfocus.cpp45
1 files changed, 23 insertions, 22 deletions
diff --git a/indra/newview/lltoolfocus.cpp b/indra/newview/lltoolfocus.cpp
index 2320ae57df..1e2e7095d8 100644
--- a/indra/newview/lltoolfocus.cpp
+++ b/indra/newview/lltoolfocus.cpp
@@ -42,6 +42,7 @@
// Viewer includes
#include "llagent.h"
+#include "llagentcamera.h"
#include "llbutton.h"
#include "llviewercontrol.h"
#include "lldrawable.h"
@@ -167,7 +168,7 @@ void LLToolCamera::pickCallback(const LLPickInfo& pick_info)
}
}
- if( CAMERA_MODE_CUSTOMIZE_AVATAR == gAgent.getCameraMode() )
+ if( CAMERA_MODE_CUSTOMIZE_AVATAR == gAgentCamera.getCameraMode() )
{
BOOL good_customize_avatar_hit = FALSE;
if( hit_obj )
@@ -207,19 +208,19 @@ void LLToolCamera::pickCallback(const LLPickInfo& pick_info)
// ...clicked on a world object, so focus at its position
if (!hit_obj->isHUDAttachment())
{
- gAgent.setFocusOnAvatar(FALSE, ANIMATE);
- gAgent.setFocusGlobal(pick_info);
+ gAgentCamera.setFocusOnAvatar(FALSE, ANIMATE);
+ gAgentCamera.setFocusGlobal(pick_info);
}
}
else if (!pick_info.mPosGlobal.isExactlyZero())
{
// Hit the ground
- gAgent.setFocusOnAvatar(FALSE, ANIMATE);
- gAgent.setFocusGlobal(pick_info);
+ gAgentCamera.setFocusOnAvatar(FALSE, ANIMATE);
+ gAgentCamera.setFocusGlobal(pick_info);
}
if (!(pick_info.mKeyMask & MASK_ALT) &&
- gAgent.cameraThirdPerson() &&
+ gAgentCamera.cameraThirdPerson() &&
gViewerWindow->getLeftMouseDown() &&
!gSavedSettings.getBOOL("FreezeTime") &&
(hit_obj == gAgent.getAvatarObject() ||
@@ -232,14 +233,14 @@ void LLToolCamera::pickCallback(const LLPickInfo& pick_info)
LLToolCamera::getInstance()->mValidClickPoint = TRUE;
- if( CAMERA_MODE_CUSTOMIZE_AVATAR == gAgent.getCameraMode() )
+ if( CAMERA_MODE_CUSTOMIZE_AVATAR == gAgentCamera.getCameraMode() )
{
- gAgent.setFocusOnAvatar(FALSE, FALSE);
+ gAgentCamera.setFocusOnAvatar(FALSE, FALSE);
- LLVector3d cam_pos = gAgent.getCameraPositionGlobal();
- cam_pos -= LLVector3d(LLViewerCamera::getInstance()->getLeftAxis() * gAgent.calcCustomizeAvatarUIOffset( cam_pos ));
+ LLVector3d cam_pos = gAgentCamera.getCameraPositionGlobal();
+ cam_pos -= LLVector3d(LLViewerCamera::getInstance()->getLeftAxis() * gAgentCamera.calcCustomizeAvatarUIOffset( cam_pos ));
- gAgent.setCameraPosAndFocusGlobal( cam_pos, pick_info.mPosGlobal, pick_info.mObjectID);
+ gAgentCamera.setCameraPosAndFocusGlobal( cam_pos, pick_info.mPosGlobal, pick_info.mObjectID);
}
}
@@ -280,10 +281,10 @@ BOOL LLToolCamera::handleMouseUp(S32 x, S32 y, MASK mask)
{
if (mValidClickPoint)
{
- if( CAMERA_MODE_CUSTOMIZE_AVATAR == gAgent.getCameraMode() )
+ if( CAMERA_MODE_CUSTOMIZE_AVATAR == gAgentCamera.getCameraMode() )
{
LLCoordGL mouse_pos;
- LLVector3 focus_pos = gAgent.getPosAgentFromGlobal(gAgent.getFocusGlobal());
+ LLVector3 focus_pos = gAgent.getPosAgentFromGlobal(gAgentCamera.getFocusGlobal());
BOOL success = LLViewerCamera::getInstance()->projectPosAgentToScreen(focus_pos, mouse_pos);
if (success)
{
@@ -369,12 +370,12 @@ BOOL LLToolCamera::handleHover(S32 x, S32 y, MASK mask)
if (dx != 0)
{
- gAgent.cameraOrbitAround( -dx * RADIANS_PER_PIXEL );
+ gAgentCamera.cameraOrbitAround( -dx * RADIANS_PER_PIXEL );
}
if (dy != 0)
{
- gAgent.cameraOrbitOver( -dy * RADIANS_PER_PIXEL );
+ gAgentCamera.cameraOrbitOver( -dy * RADIANS_PER_PIXEL );
}
gViewerWindow->moveCursorToCenter();
@@ -388,8 +389,8 @@ BOOL LLToolCamera::handleHover(S32 x, S32 y, MASK mask)
// Pan tool
if (hasMouseCapture())
{
- LLVector3d camera_to_focus = gAgent.getCameraPositionGlobal();
- camera_to_focus -= gAgent.getFocusGlobal();
+ LLVector3d camera_to_focus = gAgentCamera.getCameraPositionGlobal();
+ camera_to_focus -= gAgentCamera.getFocusGlobal();
F32 dist = (F32) camera_to_focus.normVec();
// Fudge factor for pan
@@ -397,12 +398,12 @@ BOOL LLToolCamera::handleHover(S32 x, S32 y, MASK mask)
if (dx != 0)
{
- gAgent.cameraPanLeft( dx * meters_per_pixel );
+ gAgentCamera.cameraPanLeft( dx * meters_per_pixel );
}
if (dy != 0)
{
- gAgent.cameraPanUp( -dy * meters_per_pixel );
+ gAgentCamera.cameraPanUp( -dy * meters_per_pixel );
}
gViewerWindow->moveCursorToCenter();
@@ -419,7 +420,7 @@ BOOL LLToolCamera::handleHover(S32 x, S32 y, MASK mask)
if (dx != 0)
{
- gAgent.cameraOrbitAround( -dx * RADIANS_PER_PIXEL );
+ gAgentCamera.cameraOrbitAround( -dx * RADIANS_PER_PIXEL );
}
const F32 IN_FACTOR = 0.99f;
@@ -428,11 +429,11 @@ BOOL LLToolCamera::handleHover(S32 x, S32 y, MASK mask)
{
if (mMouseSteering)
{
- gAgent.cameraOrbitOver( -dy * RADIANS_PER_PIXEL );
+ gAgentCamera.cameraOrbitOver( -dy * RADIANS_PER_PIXEL );
}
else
{
- gAgent.cameraZoomIn( pow( IN_FACTOR, dy ) );
+ gAgentCamera.cameraZoomIn( pow( IN_FACTOR, dy ) );
}
}