aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/newview/llmaniptranslate.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'linden/indra/newview/llmaniptranslate.cpp')
-rw-r--r--linden/indra/newview/llmaniptranslate.cpp88
1 files changed, 44 insertions, 44 deletions
diff --git a/linden/indra/newview/llmaniptranslate.cpp b/linden/indra/newview/llmaniptranslate.cpp
index c1457b3..7d729a6 100644
--- a/linden/indra/newview/llmaniptranslate.cpp
+++ b/linden/indra/newview/llmaniptranslate.cpp
@@ -53,7 +53,7 @@
53#include "llhudrender.h" 53#include "llhudrender.h"
54#include "llresmgr.h" 54#include "llresmgr.h"
55#include "llselectmgr.h" 55#include "llselectmgr.h"
56#include "llsphere.h" 56#include "llrendersphere.h"
57#include "llstatusbar.h" 57#include "llstatusbar.h"
58#include "lltoolmgr.h" 58#include "lltoolmgr.h"
59#include "llviewercamera.h" 59#include "llviewercamera.h"
@@ -252,7 +252,7 @@ LLManipTranslate::~LLManipTranslate()
252 252
253void LLManipTranslate::handleSelect() 253void LLManipTranslate::handleSelect()
254{ 254{
255 gSelectMgr->saveSelectedObjectTransform(SELECT_ACTION_TYPE_PICK); 255 LLSelectMgr::getInstance()->saveSelectedObjectTransform(SELECT_ACTION_TYPE_PICK);
256 gFloaterTools->setStatusText("move"); 256 gFloaterTools->setStatusText("move");
257 LLManip::handleSelect(); 257 LLManip::handleSelect();
258} 258}
@@ -309,12 +309,12 @@ BOOL LLManipTranslate::handleMouseDownOnPart( S32 x, S32 y, MASK mask )
309 mHelpTextTimer.reset(); 309 mHelpTextTimer.reset();
310 sNumTimesHelpTextShown++; 310 sNumTimesHelpTextShown++;
311 311
312 gSelectMgr->getGrid(mGridOrigin, mGridRotation, mGridScale); 312 LLSelectMgr::getInstance()->getGrid(mGridOrigin, mGridRotation, mGridScale);
313 313
314 gSelectMgr->enableSilhouette(FALSE); 314 LLSelectMgr::getInstance()->enableSilhouette(FALSE);
315 315
316 // we just started a drag, so save initial object positions 316 // we just started a drag, so save initial object positions
317 gSelectMgr->saveSelectedObjectTransform(SELECT_ACTION_TYPE_MOVE); 317 LLSelectMgr::getInstance()->saveSelectedObjectTransform(SELECT_ACTION_TYPE_MOVE);
318 318
319 mManipPart = (EManipPart)hit_part; 319 mManipPart = (EManipPart)hit_part;
320 mMouseDownX = x; 320 mMouseDownX = x;
@@ -345,7 +345,7 @@ BOOL LLManipTranslate::handleMouseDownOnPart( S32 x, S32 y, MASK mask )
345 BOOL axis_exists = getManipAxis(selected_object, mManipPart, axis); 345 BOOL axis_exists = getManipAxis(selected_object, mManipPart, axis);
346 getManipNormal(selected_object, mManipPart, mManipNormal); 346 getManipNormal(selected_object, mManipPart, mManipNormal);
347 347
348 //LLVector3 select_center_agent = gAgent.getPosAgentFromGlobal(gSelectMgr->getSelectionCenterGlobal()); 348 //LLVector3 select_center_agent = gAgent.getPosAgentFromGlobal(LLSelectMgr::getInstance()->getSelectionCenterGlobal());
349 // TomY: The above should (?) be identical to the below 349 // TomY: The above should (?) be identical to the below
350 LLVector3 select_center_agent = getPivotPoint(); 350 LLVector3 select_center_agent = getPivotPoint();
351 mSubdivisions = llclamp(getSubdivisionLevel(select_center_agent, axis_exists ? axis : LLVector3::z_axis, getMinGridScale()), sGridMinSubdivisionLevel, sGridMaxSubdivisionLevel); 351 mSubdivisions = llclamp(getSubdivisionLevel(select_center_agent, axis_exists ? axis : LLVector3::z_axis, getMinGridScale()), sGridMinSubdivisionLevel, sGridMaxSubdivisionLevel);
@@ -354,7 +354,7 @@ BOOL LLManipTranslate::handleMouseDownOnPart( S32 x, S32 y, MASK mask )
354 if (mManipPart >= LL_YZ_PLANE && mManipPart <= LL_XY_PLANE) 354 if (mManipPart >= LL_YZ_PLANE && mManipPart <= LL_XY_PLANE)
355 { 355 {
356 LLCoordGL mouse_pos; 356 LLCoordGL mouse_pos;
357 if (!gCamera->projectPosAgentToScreen(select_center_agent, mouse_pos)) 357 if (!LLViewerCamera::getInstance()->projectPosAgentToScreen(select_center_agent, mouse_pos))
358 { 358 {
359 // mouse_pos may be nonsense 359 // mouse_pos may be nonsense
360 llwarns << "Failed to project object center to screen" << llendl; 360 llwarns << "Failed to project object center to screen" << llendl;
@@ -367,7 +367,7 @@ BOOL LLManipTranslate::handleMouseDownOnPart( S32 x, S32 y, MASK mask )
367 } 367 }
368 } 368 }
369 369
370 gSelectMgr->updateSelectionCenter(); 370 LLSelectMgr::getInstance()->updateSelectionCenter();
371 LLVector3d object_start_global = gAgent.getPosGlobalFromAgent(getPivotPoint()); 371 LLVector3d object_start_global = gAgent.getPosGlobalFromAgent(getPivotPoint());
372 getMousePointOnPlaneGlobal(mDragCursorStartGlobal, x, y, object_start_global, mManipNormal); 372 getMousePointOnPlaneGlobal(mDragCursorStartGlobal, x, y, object_start_global, mManipNormal);
373 mDragSelectionStartGlobal = object_start_global; 373 mDragSelectionStartGlobal = object_start_global;
@@ -445,7 +445,7 @@ BOOL LLManipTranslate::handleHover(S32 x, S32 y, MASK mask)
445 if (mask == MASK_COPY) 445 if (mask == MASK_COPY)
446 { 446 {
447 // ...we're trying to make a copy 447 // ...we're trying to make a copy
448 gSelectMgr->selectDuplicate(LLVector3::zero, FALSE); 448 LLSelectMgr::getInstance()->selectDuplicate(LLVector3::zero, FALSE);
449 mCopyMadeThisDrag = TRUE; 449 mCopyMadeThisDrag = TRUE;
450 450
451 // When we make the copy, we don't want to do any other processing. 451 // When we make the copy, we don't want to do any other processing.
@@ -487,7 +487,7 @@ BOOL LLManipTranslate::handleHover(S32 x, S32 y, MASK mask)
487 487
488 axis_d.setVec(axis_f); 488 axis_d.setVec(axis_f);
489 489
490 gSelectMgr->updateSelectionCenter(); 490 LLSelectMgr::getInstance()->updateSelectionCenter();
491 LLVector3d current_pos_global = gAgent.getPosGlobalFromAgent(getPivotPoint()); 491 LLVector3d current_pos_global = gAgent.getPosGlobalFromAgent(getPivotPoint());
492 492
493 mSubdivisions = llclamp(getSubdivisionLevel(getPivotPoint(), axis_f, getMinGridScale()), sGridMinSubdivisionLevel, sGridMaxSubdivisionLevel); 493 mSubdivisions = llclamp(getSubdivisionLevel(getPivotPoint(), axis_f, getMinGridScale()), sGridMinSubdivisionLevel, sGridMaxSubdivisionLevel);
@@ -558,7 +558,7 @@ BOOL LLManipTranslate::handleHover(S32 x, S32 y, MASK mask)
558 558
559 // snap to planar grid 559 // snap to planar grid
560 LLVector3 cursor_point_agent = gAgent.getPosAgentFromGlobal(cursor_point_global); 560 LLVector3 cursor_point_agent = gAgent.getPosAgentFromGlobal(cursor_point_global);
561 LLVector3 camera_plane_projection = gCamera->getAtAxis(); 561 LLVector3 camera_plane_projection = LLViewerCamera::getInstance()->getAtAxis();
562 camera_plane_projection -= projected_vec(camera_plane_projection, mManipNormal); 562 camera_plane_projection -= projected_vec(camera_plane_projection, mManipNormal);
563 camera_plane_projection.normVec(); 563 camera_plane_projection.normVec();
564 LLVector3 camera_projected_dir = camera_plane_projection; 564 LLVector3 camera_projected_dir = camera_plane_projection;
@@ -709,7 +709,7 @@ BOOL LLManipTranslate::handleHover(S32 x, S32 y, MASK mask)
709 LLVector3d new_position_global = selectNode->mSavedPositionGlobal + clamped_relative_move; 709 LLVector3d new_position_global = selectNode->mSavedPositionGlobal + clamped_relative_move;
710 710
711 // Don't let object centers go too far underground 711 // Don't let object centers go too far underground
712 F64 min_height = gWorldp->getMinAllowedZ(object); 712 F64 min_height = LLWorld::getInstance()->getMinAllowedZ(object);
713 if (new_position_global.mdV[VZ] < min_height) 713 if (new_position_global.mdV[VZ] < min_height)
714 { 714 {
715 new_position_global.mdV[VZ] = min_height; 715 new_position_global.mdV[VZ] = min_height;
@@ -724,12 +724,12 @@ BOOL LLManipTranslate::handleHover(S32 x, S32 y, MASK mask)
724 // Grass is always drawn on the ground, so clamp its position to the ground 724 // Grass is always drawn on the ground, so clamp its position to the ground
725 if (object->getPCode() == LL_PCODE_LEGACY_GRASS) 725 if (object->getPCode() == LL_PCODE_LEGACY_GRASS)
726 { 726 {
727 new_position_global.mdV[VZ] = gWorldp->resolveLandHeightGlobal(new_position_global) + 1.f; 727 new_position_global.mdV[VZ] = LLWorld::getInstance()->resolveLandHeightGlobal(new_position_global) + 1.f;
728 } 728 }
729 729
730 if (object->isRootEdit()) 730 if (object->isRootEdit())
731 { 731 {
732 new_position_global = gWorldp->clipToVisibleRegions(object->getPositionGlobal(), new_position_global); 732 new_position_global = LLWorld::getInstance()->clipToVisibleRegions(object->getPositionGlobal(), new_position_global);
733 } 733 }
734 734
735 // PR: Only update if changed 735 // PR: Only update if changed
@@ -776,7 +776,7 @@ BOOL LLManipTranslate::handleHover(S32 x, S32 y, MASK mask)
776 } 776 }
777 } 777 }
778 778
779 gSelectMgr->updateSelectionCenter(); 779 LLSelectMgr::getInstance()->updateSelectionCenter();
780 gAgent.clearFocusObject(); 780 gAgent.clearFocusObject();
781 dialog_refresh_all(); // ??? is this necessary? 781 dialog_refresh_all(); // ??? is this necessary?
782 782
@@ -794,9 +794,9 @@ void LLManipTranslate::highlightManipulators(S32 x, S32 y)
794 return; 794 return;
795 } 795 }
796 796
797 //LLBBox bbox = gSelectMgr->getBBoxOfSelection(); 797 //LLBBox bbox = LLSelectMgr::getInstance()->getBBoxOfSelection();
798 LLMatrix4 projMatrix = gCamera->getProjection(); 798 LLMatrix4 projMatrix = LLViewerCamera::getInstance()->getProjection();
799 LLMatrix4 modelView = gCamera->getModelview(); 799 LLMatrix4 modelView = LLViewerCamera::getInstance()->getModelview();
800 800
801 LLVector3 object_position = getPivotPoint(); 801 LLVector3 object_position = getPivotPoint();
802 802
@@ -804,7 +804,7 @@ void LLManipTranslate::highlightManipulators(S32 x, S32 y)
804 LLVector3 grid_scale; 804 LLVector3 grid_scale;
805 LLQuaternion grid_rotation; 805 LLQuaternion grid_rotation;
806 806
807 gSelectMgr->getGrid(grid_origin, grid_rotation, grid_scale); 807 LLSelectMgr::getInstance()->getGrid(grid_origin, grid_rotation, grid_scale);
808 808
809 LLVector3 relative_camera_dir; 809 LLVector3 relative_camera_dir;
810 810
@@ -819,14 +819,14 @@ void LLManipTranslate::highlightManipulators(S32 x, S32 y)
819 transform *= cfr; 819 transform *= cfr;
820 LLMatrix4 window_scale; 820 LLMatrix4 window_scale;
821 F32 zoom_level = 2.f * gAgent.getAvatarObject()->mHUDCurZoom; 821 F32 zoom_level = 2.f * gAgent.getAvatarObject()->mHUDCurZoom;
822 window_scale.initAll(LLVector3(zoom_level / gCamera->getAspect(), zoom_level, 0.f), 822 window_scale.initAll(LLVector3(zoom_level / LLViewerCamera::getInstance()->getAspect(), zoom_level, 0.f),
823 LLQuaternion::DEFAULT, 823 LLQuaternion::DEFAULT,
824 LLVector3::zero); 824 LLVector3::zero);
825 transform *= window_scale; 825 transform *= window_scale;
826 } 826 }
827 else 827 else
828 { 828 {
829 relative_camera_dir = (object_position - gCamera->getOrigin()) * ~grid_rotation; 829 relative_camera_dir = (object_position - LLViewerCamera::getInstance()->getOrigin()) * ~grid_rotation;
830 relative_camera_dir.normVec(); 830 relative_camera_dir.normVec();
831 831
832 transform.initRotTrans(grid_rotation, LLVector4(object_position)); 832 transform.initRotTrans(grid_rotation, LLVector4(object_position));
@@ -1036,13 +1036,13 @@ BOOL LLManipTranslate::handleMouseUp(S32 x, S32 y, MASK mask)
1036 { 1036 {
1037 // make sure arrow colors go back to normal 1037 // make sure arrow colors go back to normal
1038 mManipPart = LL_NO_PART; 1038 mManipPart = LL_NO_PART;
1039 gSelectMgr->enableSilhouette(TRUE); 1039 LLSelectMgr::getInstance()->enableSilhouette(TRUE);
1040 1040
1041 // Might have missed last update due to UPDATE_DELAY timing. 1041 // Might have missed last update due to UPDATE_DELAY timing.
1042 gSelectMgr->sendMultipleUpdate( UPD_POSITION ); 1042 LLSelectMgr::getInstance()->sendMultipleUpdate( UPD_POSITION );
1043 1043
1044 mInSnapRegime = FALSE; 1044 mInSnapRegime = FALSE;
1045 gSelectMgr->saveSelectedObjectTransform(SELECT_ACTION_TYPE_PICK); 1045 LLSelectMgr::getInstance()->saveSelectedObjectTransform(SELECT_ACTION_TYPE_PICK);
1046 //gAgent.setObjectTracking(gSavedSettings.getBOOL("TrackFocusObject")); 1046 //gAgent.setObjectTracking(gSavedSettings.getBOOL("TrackFocusObject"));
1047 } 1047 }
1048 1048
@@ -1105,8 +1105,8 @@ void LLManipTranslate::renderSnapGuides()
1105 LLVector3 grid_scale; 1105 LLVector3 grid_scale;
1106 LLQuaternion grid_rotation; 1106 LLQuaternion grid_rotation;
1107 1107
1108 gSelectMgr->getGrid(grid_origin, grid_rotation, grid_scale); 1108 LLSelectMgr::getInstance()->getGrid(grid_origin, grid_rotation, grid_scale);
1109 LLVector3 saved_selection_center = getSavedPivotPoint(); //gSelectMgr->getSavedBBoxOfSelection().getCenterAgent(); 1109 LLVector3 saved_selection_center = getSavedPivotPoint(); //LLSelectMgr::getInstance()->getSavedBBoxOfSelection().getCenterAgent();
1110 LLVector3 selection_center = getPivotPoint(); 1110 LLVector3 selection_center = getPivotPoint();
1111 1111
1112 LLViewerObject *first_object = first_node->getObject(); 1112 LLViewerObject *first_object = first_node->getObject();
@@ -1149,7 +1149,7 @@ void LLManipTranslate::renderSnapGuides()
1149 } 1149 }
1150 else 1150 else
1151 { 1151 {
1152 at_axis_abs = saved_selection_center - gCamera->getOrigin(); 1152 at_axis_abs = saved_selection_center - LLViewerCamera::getInstance()->getOrigin();
1153 at_axis_abs.normVec(); 1153 at_axis_abs.normVec();
1154 1154
1155 at_axis_abs = at_axis_abs * ~grid_rotation; 1155 at_axis_abs = at_axis_abs * ~grid_rotation;
@@ -1225,14 +1225,14 @@ void LLManipTranslate::renderSnapGuides()
1225 } 1225 }
1226 else 1226 else
1227 { 1227 {
1228 LLVector3 cam_to_selection = getPivotPoint() - gCamera->getOrigin(); 1228 LLVector3 cam_to_selection = getPivotPoint() - LLViewerCamera::getInstance()->getOrigin();
1229 F32 current_range = cam_to_selection.normVec(); 1229 F32 current_range = cam_to_selection.normVec();
1230 guide_size_meters = SNAP_GUIDE_SCREEN_SIZE * gViewerWindow->getWindowHeight() * current_range / gCamera->getPixelMeterRatio(); 1230 guide_size_meters = SNAP_GUIDE_SCREEN_SIZE * gViewerWindow->getWindowHeight() * current_range / LLViewerCamera::getInstance()->getPixelMeterRatio();
1231 1231
1232 F32 fraction_of_fov = mAxisArrowLength / (F32) gCamera->getViewHeightInPixels(); 1232 F32 fraction_of_fov = mAxisArrowLength / (F32) LLViewerCamera::getInstance()->getViewHeightInPixels();
1233 F32 apparent_angle = fraction_of_fov * gCamera->getView(); // radians 1233 F32 apparent_angle = fraction_of_fov * LLViewerCamera::getInstance()->getView(); // radians
1234 F32 offset_at_camera = tan(apparent_angle) * 1.5f; 1234 F32 offset_at_camera = tan(apparent_angle) * 1.5f;
1235 F32 range = dist_vec(gAgent.getPosAgentFromGlobal(first_node->mSavedPositionGlobal), gCamera->getOrigin()); 1235 F32 range = dist_vec(gAgent.getPosAgentFromGlobal(first_node->mSavedPositionGlobal), LLViewerCamera::getInstance()->getOrigin());
1236 mSnapOffsetMeters = range * offset_at_camera; 1236 mSnapOffsetMeters = range * offset_at_camera;
1237 } 1237 }
1238 1238
@@ -1362,7 +1362,7 @@ void LLManipTranslate::renderSnapGuides()
1362 1362
1363 sub_div_offset = llround(fmod(dist_grid_axis - offset_nearest_grid_unit, getMinGridScale() * 32.f) / smallest_grid_unit_scale); 1363 sub_div_offset = llround(fmod(dist_grid_axis - offset_nearest_grid_unit, getMinGridScale() * 32.f) / smallest_grid_unit_scale);
1364 1364
1365 LLVector2 screen_translate_axis(llabs(translate_axis * gCamera->getLeftAxis()), llabs(translate_axis * gCamera->getUpAxis())); 1365 LLVector2 screen_translate_axis(llabs(translate_axis * LLViewerCamera::getInstance()->getLeftAxis()), llabs(translate_axis * LLViewerCamera::getInstance()->getUpAxis()));
1366 screen_translate_axis.normVec(); 1366 screen_translate_axis.normVec();
1367 1367
1368 S32 tick_label_spacing = llround(screen_translate_axis * sTickLabelSpacing); 1368 S32 tick_label_spacing = llround(screen_translate_axis * sTickLabelSpacing);
@@ -1387,7 +1387,7 @@ void LLManipTranslate::renderSnapGuides()
1387 { 1387 {
1388 F32 snap_offset_meters; 1388 F32 snap_offset_meters;
1389 1389
1390 if (mSnapOffsetAxis * gCamera->getUpAxis() > 0.f) 1390 if (mSnapOffsetAxis * LLViewerCamera::getInstance()->getUpAxis() > 0.f)
1391 { 1391 {
1392 snap_offset_meters = mSnapOffsetMeters; 1392 snap_offset_meters = mSnapOffsetMeters;
1393 } 1393 }
@@ -1401,7 +1401,7 @@ void LLManipTranslate::renderSnapGuides()
1401 1401
1402 LLVector3 tick_offset = (tick_pos - mGridOrigin) * ~mGridRotation; 1402 LLVector3 tick_offset = (tick_pos - mGridOrigin) * ~mGridRotation;
1403 F32 offset_val = 0.5f * tick_offset.mV[ARROW_TO_AXIS[mManipPart]] / getMinGridScale(); 1403 F32 offset_val = 0.5f * tick_offset.mV[ARROW_TO_AXIS[mManipPart]] / getMinGridScale();
1404 EGridMode grid_mode = gSelectMgr->getGridMode(); 1404 EGridMode grid_mode = LLSelectMgr::getInstance()->getGridMode();
1405 F32 text_highlight = 0.8f; 1405 F32 text_highlight = 0.8f;
1406 if(i - llround(offset_nearest_grid_unit / smallest_grid_unit_scale) == 0 && mInSnapRegime) 1406 if(i - llround(offset_nearest_grid_unit / smallest_grid_unit_scale) == 0 && mInSnapRegime)
1407 { 1407 {
@@ -1426,7 +1426,7 @@ void LLManipTranslate::renderSnapGuides()
1426 if (mHelpTextTimer.getElapsedTimeF32() < sHelpTextVisibleTime + sHelpTextFadeTime && sNumTimesHelpTextShown < sMaxTimesShowHelpText) 1426 if (mHelpTextTimer.getElapsedTimeF32() < sHelpTextVisibleTime + sHelpTextFadeTime && sNumTimesHelpTextShown < sMaxTimesShowHelpText)
1427 { 1427 {
1428 F32 snap_offset_meters_up; 1428 F32 snap_offset_meters_up;
1429 if (mSnapOffsetAxis * gCamera->getUpAxis() > 0.f) 1429 if (mSnapOffsetAxis * LLViewerCamera::getInstance()->getUpAxis() > 0.f)
1430 { 1430 {
1431 snap_offset_meters_up = mSnapOffsetMeters; 1431 snap_offset_meters_up = mSnapOffsetMeters;
1432 } 1432 }
@@ -1435,7 +1435,7 @@ void LLManipTranslate::renderSnapGuides()
1435 snap_offset_meters_up = -mSnapOffsetMeters; 1435 snap_offset_meters_up = -mSnapOffsetMeters;
1436 } 1436 }
1437 1437
1438 LLVector3 selection_center_start = getSavedPivotPoint();//gSelectMgr->getSavedBBoxOfSelection().getCenterAgent(); 1438 LLVector3 selection_center_start = getSavedPivotPoint();//LLSelectMgr::getInstance()->getSavedBBoxOfSelection().getCenterAgent();
1439 1439
1440 LLVector3 help_text_pos = selection_center_start + (snap_offset_meters_up * 3.f * mSnapOffsetAxis); 1440 LLVector3 help_text_pos = selection_center_start + (snap_offset_meters_up * 3.f * mSnapOffsetAxis);
1441 const LLFontGL* big_fontp = LLFontGL::sSansSerif; 1441 const LLFontGL* big_fontp = LLFontGL::sSansSerif;
@@ -1445,7 +1445,7 @@ void LLManipTranslate::renderSnapGuides()
1445 help_text_color.mV[VALPHA] = clamp_rescale(mHelpTextTimer.getElapsedTimeF32(), sHelpTextVisibleTime, sHelpTextVisibleTime + sHelpTextFadeTime, line_alpha, 0.f); 1445 help_text_color.mV[VALPHA] = clamp_rescale(mHelpTextTimer.getElapsedTimeF32(), sHelpTextVisibleTime, sHelpTextVisibleTime + sHelpTextFadeTime, line_alpha, 0.f);
1446 hud_render_utf8text(help_text, help_text_pos, *big_fontp, LLFontGL::NORMAL, -0.5f * big_fontp->getWidthF32(help_text), 3.f, help_text_color, mObjectSelection->getSelectType() == SELECT_TYPE_HUD); 1446 hud_render_utf8text(help_text, help_text_pos, *big_fontp, LLFontGL::NORMAL, -0.5f * big_fontp->getWidthF32(help_text), 3.f, help_text_color, mObjectSelection->getSelectType() == SELECT_TYPE_HUD);
1447 help_text = "to snap to grid"; 1447 help_text = "to snap to grid";
1448 help_text_pos -= gCamera->getUpAxis() * mSnapOffsetMeters * 0.2f; 1448 help_text_pos -= LLViewerCamera::getInstance()->getUpAxis() * mSnapOffsetMeters * 0.2f;
1449 hud_render_utf8text(help_text, help_text_pos, *big_fontp, LLFontGL::NORMAL, -0.5f * big_fontp->getWidthF32(help_text), 3.f, help_text_color, mObjectSelection->getSelectType() == SELECT_TYPE_HUD); 1449 hud_render_utf8text(help_text, help_text_pos, *big_fontp, LLFontGL::NORMAL, -0.5f * big_fontp->getWidthF32(help_text), 3.f, help_text_color, mObjectSelection->getSelectType() == SELECT_TYPE_HUD);
1450 } 1450 }
1451 } 1451 }
@@ -1655,7 +1655,7 @@ void LLManipTranslate::highlightIntersection(LLVector3 normal,
1655 1655
1656 //setup clip plane 1656 //setup clip plane
1657 normal = normal * grid_rotation; 1657 normal = normal * grid_rotation;
1658 if (normal * (gCamera->getOrigin()-selection_center) < 0) 1658 if (normal * (LLViewerCamera::getInstance()->getOrigin()-selection_center) < 0)
1659 { 1659 {
1660 normal = -normal; 1660 normal = -normal;
1661 } 1661 }
@@ -1756,7 +1756,7 @@ void LLManipTranslate::renderTranslationHandles()
1756 LLQuaternion grid_rotation; 1756 LLQuaternion grid_rotation;
1757 LLGLDepthTest gls_depth(GL_FALSE); 1757 LLGLDepthTest gls_depth(GL_FALSE);
1758 1758
1759 gSelectMgr->getGrid(grid_origin, grid_rotation, grid_scale); 1759 LLSelectMgr::getInstance()->getGrid(grid_origin, grid_rotation, grid_scale);
1760 LLVector3 at_axis; 1760 LLVector3 at_axis;
1761 if (mObjectSelection->getSelectType() == SELECT_TYPE_HUD) 1761 if (mObjectSelection->getSelectType() == SELECT_TYPE_HUD)
1762 { 1762 {
@@ -1764,7 +1764,7 @@ void LLManipTranslate::renderTranslationHandles()
1764 } 1764 }
1765 else 1765 else
1766 { 1766 {
1767 at_axis = gCamera->getAtAxis() * ~grid_rotation; 1767 at_axis = LLViewerCamera::getInstance()->getAtAxis() * ~grid_rotation;
1768 } 1768 }
1769 1769
1770 if (at_axis.mV[VX] > 0.f) 1770 if (at_axis.mV[VX] > 0.f)
@@ -1823,8 +1823,8 @@ void LLManipTranslate::renderTranslationHandles()
1823 if (range > 0.001f) 1823 if (range > 0.001f)
1824 { 1824 {
1825 // range != zero 1825 // range != zero
1826 F32 fraction_of_fov = mAxisArrowLength / (F32) gCamera->getViewHeightInPixels(); 1826 F32 fraction_of_fov = mAxisArrowLength / (F32) LLViewerCamera::getInstance()->getViewHeightInPixels();
1827 F32 apparent_angle = fraction_of_fov * gCamera->getView(); // radians 1827 F32 apparent_angle = fraction_of_fov * LLViewerCamera::getInstance()->getView(); // radians
1828 mArrowLengthMeters = range * tan(apparent_angle); 1828 mArrowLengthMeters = range * tan(apparent_angle);
1829 } 1829 }
1830 else 1830 else
@@ -1859,7 +1859,7 @@ void LLManipTranslate::renderTranslationHandles()
1859 } 1859 }
1860 else 1860 else
1861 { 1861 {
1862 relative_camera_dir = (selection_center - gCamera->getOrigin()) * invRotation; 1862 relative_camera_dir = (selection_center - LLViewerCamera::getInstance()->getOrigin()) * invRotation;
1863 } 1863 }
1864 relative_camera_dir.normVec(); 1864 relative_camera_dir.normVec();
1865 1865