summaryrefslogtreecommitdiff
path: root/indra/newview/llmaniprotate.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llmaniprotate.cpp')
-rw-r--r--indra/newview/llmaniprotate.cpp31
1 files changed, 16 insertions, 15 deletions
diff --git a/indra/newview/llmaniprotate.cpp b/indra/newview/llmaniprotate.cpp
index 8535d52015..6dc0a929c8 100644
--- a/indra/newview/llmaniprotate.cpp
+++ b/indra/newview/llmaniprotate.cpp
@@ -45,6 +45,7 @@
// viewer includes
#include "llagent.h"
+#include "llagentcamera.h"
#include "llbox.h"
#include "llbutton.h"
#include "llviewercontrol.h"
@@ -138,7 +139,7 @@ void LLManipRotate::render()
glPushMatrix();
if (mObjectSelection->getSelectType() == SELECT_TYPE_HUD)
{
- F32 zoom = gAgent.mHUDCurZoom;
+ F32 zoom = gAgentCamera.mHUDCurZoom;
glScalef(zoom, zoom, zoom);
}
@@ -690,7 +691,7 @@ void LLManipRotate::drag( S32 x, S32 y )
LLSelectMgr::getInstance()->updateSelectionCenter();
// RN: just clear focus so camera doesn't follow spurious object updates
- gAgent.clearFocusObject();
+ gAgentCamera.clearFocusObject();
dialog_refresh_all();
}
@@ -730,7 +731,7 @@ void LLManipRotate::renderSnapGuides()
}
else
{
- cam_at_axis = center - gAgent.getCameraPositionAgent();
+ cam_at_axis = center - gAgentCamera.getCameraPositionAgent();
cam_at_axis.normVec();
}
@@ -1097,12 +1098,12 @@ BOOL LLManipRotate::updateVisiblity()
LLVector3 center = gAgent.getPosAgentFromGlobal( mRotationCenter );
if (mObjectSelection->getSelectType() == SELECT_TYPE_HUD)
{
- mCenterToCam = LLVector3(-1.f / gAgent.mHUDCurZoom, 0.f, 0.f);
+ mCenterToCam = LLVector3(-1.f / gAgentCamera.mHUDCurZoom, 0.f, 0.f);
mCenterToCamNorm = mCenterToCam;
mCenterToCamMag = mCenterToCamNorm.normVec();
mRadiusMeters = RADIUS_PIXELS / (F32) LLViewerCamera::getInstance()->getViewHeightInPixels();
- mRadiusMeters /= gAgent.mHUDCurZoom;
+ mRadiusMeters /= gAgentCamera.mHUDCurZoom;
mCenterToProfilePlaneMag = mRadiusMeters * mRadiusMeters / mCenterToCamMag;
mCenterToProfilePlane = -mCenterToProfilePlaneMag * mCenterToCamNorm;
@@ -1110,8 +1111,8 @@ BOOL LLManipRotate::updateVisiblity()
// x axis range is (-aspect * 0.5f, +aspect * 0.5)
// y axis range is (-0.5, 0.5)
// so use getWorldViewHeightRaw as scale factor when converting to pixel coordinates
- mCenterScreen.set((S32)((0.5f - center.mV[VY]) / gAgent.mHUDCurZoom * gViewerWindow->getWorldViewHeightScaled()),
- (S32)((center.mV[VZ] + 0.5f) / gAgent.mHUDCurZoom * gViewerWindow->getWorldViewHeightScaled()));
+ mCenterScreen.set((S32)((0.5f - center.mV[VY]) / gAgentCamera.mHUDCurZoom * gViewerWindow->getWorldViewHeightScaled()),
+ (S32)((center.mV[VZ] + 0.5f) / gAgentCamera.mHUDCurZoom * gViewerWindow->getWorldViewHeightScaled()));
visible = TRUE;
}
else
@@ -1119,7 +1120,7 @@ BOOL LLManipRotate::updateVisiblity()
visible = LLViewerCamera::getInstance()->projectPosAgentToScreen(center, mCenterScreen );
if( visible )
{
- mCenterToCam = gAgent.getCameraPositionAgent() - center;
+ mCenterToCam = gAgentCamera.getCameraPositionAgent() - center;
mCenterToCamNorm = mCenterToCam;
mCenterToCamMag = mCenterToCamNorm.normVec();
LLVector3 cameraAtAxis = LLViewerCamera::getInstance()->getAtAxis();
@@ -1165,7 +1166,7 @@ BOOL LLManipRotate::updateVisiblity()
LLQuaternion LLManipRotate::dragUnconstrained( S32 x, S32 y )
{
- LLVector3 cam = gAgent.getCameraPositionAgent();
+ LLVector3 cam = gAgentCamera.getCameraPositionAgent();
LLVector3 center = gAgent.getPosAgentFromGlobal( mRotationCenter );
mMouseCur = intersectMouseWithSphere( x, y, center, mRadiusMeters);
@@ -1333,7 +1334,7 @@ LLQuaternion LLManipRotate::dragConstrained( S32 x, S32 y )
}
else
{
- cam_to_snap_plane = snap_plane_center - gAgent.getCameraPositionAgent();
+ cam_to_snap_plane = snap_plane_center - gAgentCamera.getCameraPositionAgent();
cam_to_snap_plane.normVec();
}
@@ -1383,7 +1384,7 @@ LLQuaternion LLManipRotate::dragConstrained( S32 x, S32 y )
}
else
{
- cam_to_snap_plane = snap_plane_center - gAgent.getCameraPositionAgent();
+ cam_to_snap_plane = snap_plane_center - gAgentCamera.getCameraPositionAgent();
cam_to_snap_plane.normVec();
}
@@ -1430,7 +1431,7 @@ LLQuaternion LLManipRotate::dragConstrained( S32 x, S32 y )
}
else
{
- cam_at_axis = snap_plane_center - gAgent.getCameraPositionAgent();
+ cam_at_axis = snap_plane_center - gAgentCamera.getCameraPositionAgent();
cam_at_axis.normVec();
}
@@ -1627,15 +1628,15 @@ void LLManipRotate::mouseToRay( S32 x, S32 y, LLVector3* ray_pt, LLVector3* ray_
{
if (LLSelectMgr::getInstance()->getSelection()->getSelectType() == SELECT_TYPE_HUD)
{
- F32 mouse_x = (((F32)x / gViewerWindow->getWorldViewRectScaled().getWidth()) - 0.5f) / gAgent.mHUDCurZoom;
- F32 mouse_y = ((((F32)y) / gViewerWindow->getWorldViewRectScaled().getHeight()) - 0.5f) / gAgent.mHUDCurZoom;
+ F32 mouse_x = (((F32)x / gViewerWindow->getWorldViewRectScaled().getWidth()) - 0.5f) / gAgentCamera.mHUDCurZoom;
+ F32 mouse_y = ((((F32)y) / gViewerWindow->getWorldViewRectScaled().getHeight()) - 0.5f) / gAgentCamera.mHUDCurZoom;
*ray_pt = LLVector3(-1.f, -mouse_x, mouse_y);
*ray_dir = LLVector3(1.f, 0.f, 0.f);
}
else
{
- *ray_pt = gAgent.getCameraPositionAgent();
+ *ray_pt = gAgentCamera.getCameraPositionAgent();
LLViewerCamera::getInstance()->projectScreenToPosAgent(x, y, ray_dir);
*ray_dir -= *ray_pt;
ray_dir->normVec();