diff options
Diffstat (limited to '')
-rw-r--r-- | linden/indra/newview/lltoolgrab.cpp | 37 |
1 files changed, 18 insertions, 19 deletions
diff --git a/linden/indra/newview/lltoolgrab.cpp b/linden/indra/newview/lltoolgrab.cpp index a60046b..a8e789d 100644 --- a/linden/indra/newview/lltoolgrab.cpp +++ b/linden/indra/newview/lltoolgrab.cpp | |||
@@ -69,7 +69,6 @@ const S32 SLOP_DIST_SQ = 4; | |||
69 | BOOL gGrabBtnVertical = FALSE; | 69 | BOOL gGrabBtnVertical = FALSE; |
70 | BOOL gGrabBtnSpin = FALSE; | 70 | BOOL gGrabBtnSpin = FALSE; |
71 | LLTool* gGrabTransientTool = NULL; | 71 | LLTool* gGrabTransientTool = NULL; |
72 | LLToolGrab *gToolGrab = NULL; | ||
73 | extern BOOL gDebugClicks; | 72 | extern BOOL gDebugClicks; |
74 | 73 | ||
75 | // | 74 | // |
@@ -151,26 +150,26 @@ void LLToolGrab::pickCallback(S32 x, S32 y, MASK mask) | |||
151 | 150 | ||
152 | BOOL extend_select = (mask & MASK_SHIFT); | 151 | BOOL extend_select = (mask & MASK_SHIFT); |
153 | 152 | ||
154 | if (!extend_select && !gSelectMgr->getSelection()->isEmpty()) | 153 | if (!extend_select && !LLSelectMgr::getInstance()->getSelection()->isEmpty()) |
155 | { | 154 | { |
156 | gSelectMgr->deselectAll(); | 155 | LLSelectMgr::getInstance()->deselectAll(); |
157 | gToolGrab->mDeselectedThisClick = TRUE; | 156 | LLToolGrab::getInstance()->mDeselectedThisClick = TRUE; |
158 | } | 157 | } |
159 | else | 158 | else |
160 | { | 159 | { |
161 | gToolGrab->mDeselectedThisClick = FALSE; | 160 | LLToolGrab::getInstance()->mDeselectedThisClick = FALSE; |
162 | } | 161 | } |
163 | 162 | ||
164 | // if not over object, do nothing | 163 | // if not over object, do nothing |
165 | if (!objectp) | 164 | if (!objectp) |
166 | { | 165 | { |
167 | gToolGrab->setMouseCapture(TRUE); | 166 | LLToolGrab::getInstance()->setMouseCapture(TRUE); |
168 | gToolGrab->mMode = GRAB_NOOBJECT; | 167 | LLToolGrab::getInstance()->mMode = GRAB_NOOBJECT; |
169 | gToolGrab->mHitObjectID.setNull(); | 168 | LLToolGrab::getInstance()->mHitObjectID.setNull(); |
170 | } | 169 | } |
171 | else | 170 | else |
172 | { | 171 | { |
173 | gToolGrab->handleObjectHit(objectp, x, y, mask); | 172 | LLToolGrab::getInstance()->handleObjectHit(objectp, x, y, mask); |
174 | } | 173 | } |
175 | } | 174 | } |
176 | 175 | ||
@@ -273,7 +272,7 @@ BOOL LLToolGrab::handleObjectHit(LLViewerObject *objectp, S32 x, S32 y, MASK mas | |||
273 | startSpin(); | 272 | startSpin(); |
274 | } | 273 | } |
275 | 274 | ||
276 | gSelectMgr->updateSelectionCenter(); // update selection beam | 275 | LLSelectMgr::getInstance()->updateSelectionCenter(); // update selection beam |
277 | 276 | ||
278 | // update point at | 277 | // update point at |
279 | LLViewerObject *edit_object = gObjectList.findObject(mHitObjectID); | 278 | LLViewerObject *edit_object = gObjectList.findObject(mHitObjectID); |
@@ -505,7 +504,7 @@ void LLToolGrab::handleHoverActive(S32 x, S32 y, MASK mask) | |||
505 | LLQuaternion rotation_around_vertical( dx*RADIANS_PER_PIXEL_X, up ); | 504 | LLQuaternion rotation_around_vertical( dx*RADIANS_PER_PIXEL_X, up ); |
506 | 505 | ||
507 | // y motion maps to rotation around left axis | 506 | // y motion maps to rotation around left axis |
508 | const LLVector3 &agent_left = gCamera->getLeftAxis(); | 507 | const LLVector3 &agent_left = LLViewerCamera::getInstance()->getLeftAxis(); |
509 | LLQuaternion rotation_around_left( dy*RADIANS_PER_PIXEL_Y, agent_left ); | 508 | LLQuaternion rotation_around_left( dy*RADIANS_PER_PIXEL_Y, agent_left ); |
510 | 509 | ||
511 | // compose with current rotation | 510 | // compose with current rotation |
@@ -530,14 +529,14 @@ void LLToolGrab::handleHoverActive(S32 x, S32 y, MASK mask) | |||
530 | //------------------------------------------------------ | 529 | //------------------------------------------------------ |
531 | 530 | ||
532 | LLVector3d x_part; | 531 | LLVector3d x_part; |
533 | x_part.setVec(gCamera->getLeftAxis()); | 532 | x_part.setVec(LLViewerCamera::getInstance()->getLeftAxis()); |
534 | x_part.mdV[VZ] = 0.0; | 533 | x_part.mdV[VZ] = 0.0; |
535 | x_part.normVec(); | 534 | x_part.normVec(); |
536 | 535 | ||
537 | LLVector3d y_part; | 536 | LLVector3d y_part; |
538 | if( mVerticalDragging ) | 537 | if( mVerticalDragging ) |
539 | { | 538 | { |
540 | y_part.setVec(gCamera->getUpAxis()); | 539 | y_part.setVec(LLViewerCamera::getInstance()->getUpAxis()); |
541 | // y_part.setVec(0.f, 0.f, 1.f); | 540 | // y_part.setVec(0.f, 0.f, 1.f); |
542 | } | 541 | } |
543 | else | 542 | else |
@@ -579,7 +578,7 @@ void LLToolGrab::handleHoverActive(S32 x, S32 y, MASK mask) | |||
579 | */ | 578 | */ |
580 | 579 | ||
581 | // Don't let object centers go underground. | 580 | // Don't let object centers go underground. |
582 | F32 land_height = gWorldPointer->resolveLandHeightGlobal(grab_point_global); | 581 | F32 land_height = LLWorld::getInstance()->resolveLandHeightGlobal(grab_point_global); |
583 | 582 | ||
584 | if (grab_point_global.mdV[VZ] < land_height) | 583 | if (grab_point_global.mdV[VZ] < land_height) |
585 | { | 584 | { |
@@ -592,7 +591,7 @@ void LLToolGrab::handleHoverActive(S32 x, S32 y, MASK mask) | |||
592 | grab_point_global.mdV[VZ] = MAX_OBJECT_Z; | 591 | grab_point_global.mdV[VZ] = MAX_OBJECT_Z; |
593 | } | 592 | } |
594 | 593 | ||
595 | grab_point_global = gWorldp->clipToVisibleRegions(mDragStartPointGlobal, grab_point_global); | 594 | grab_point_global = LLWorld::getInstance()->clipToVisibleRegions(mDragStartPointGlobal, grab_point_global); |
596 | // propagate constrained grab point back to grab offset | 595 | // propagate constrained grab point back to grab offset |
597 | mGrabHiddenOffsetFromCamera = grab_point_global - gAgent.getCameraPositionGlobal(); | 596 | mGrabHiddenOffsetFromCamera = grab_point_global - gAgent.getCameraPositionGlobal(); |
598 | 597 | ||
@@ -600,7 +599,7 @@ void LLToolGrab::handleHoverActive(S32 x, S32 y, MASK mask) | |||
600 | LLVector3 grab_pos_agent = gAgent.getPosAgentFromGlobal( grab_point_global ); | 599 | LLVector3 grab_pos_agent = gAgent.getPosAgentFromGlobal( grab_point_global ); |
601 | 600 | ||
602 | LLCoordGL grab_center_gl( gViewerWindow->getWindowWidth() / 2, gViewerWindow->getWindowHeight() / 2); | 601 | LLCoordGL grab_center_gl( gViewerWindow->getWindowWidth() / 2, gViewerWindow->getWindowHeight() / 2); |
603 | gCamera->projectPosAgentToScreen(grab_pos_agent, grab_center_gl); | 602 | LLViewerCamera::getInstance()->projectPosAgentToScreen(grab_pos_agent, grab_center_gl); |
604 | 603 | ||
605 | const S32 ROTATE_H_MARGIN = gViewerWindow->getWindowWidth() / 20; | 604 | const S32 ROTATE_H_MARGIN = gViewerWindow->getWindowWidth() / 20; |
606 | const F32 ROTATE_ANGLE_PER_SECOND = 30.f * DEG_TO_RAD; | 605 | const F32 ROTATE_ANGLE_PER_SECOND = 30.f * DEG_TO_RAD; |
@@ -652,7 +651,7 @@ void LLToolGrab::handleHoverActive(S32 x, S32 y, MASK mask) | |||
652 | 651 | ||
653 | gViewerWindow->moveCursorToCenter(); | 652 | gViewerWindow->moveCursorToCenter(); |
654 | 653 | ||
655 | gSelectMgr->updateSelectionCenter(); | 654 | LLSelectMgr::getInstance()->updateSelectionCenter(); |
656 | 655 | ||
657 | } | 656 | } |
658 | 657 | ||
@@ -804,7 +803,7 @@ void LLToolGrab::onMouseCaptureLost() | |||
804 | LLVector3 grab_point_agent = mGrabObject->getRenderPosition(); | 803 | LLVector3 grab_point_agent = mGrabObject->getRenderPosition(); |
805 | 804 | ||
806 | LLCoordGL gl_point; | 805 | LLCoordGL gl_point; |
807 | if (gCamera->projectPosAgentToScreen(grab_point_agent, gl_point)) | 806 | if (LLViewerCamera::getInstance()->projectPosAgentToScreen(grab_point_agent, gl_point)) |
808 | { | 807 | { |
809 | LLUI::setCursorPositionScreen(gl_point.mX, gl_point.mY); | 808 | LLUI::setCursorPositionScreen(gl_point.mX, gl_point.mY); |
810 | } | 809 | } |
@@ -826,7 +825,7 @@ void LLToolGrab::onMouseCaptureLost() | |||
826 | 825 | ||
827 | mGrabObject = NULL; | 826 | mGrabObject = NULL; |
828 | 827 | ||
829 | gSelectMgr->updateSelectionCenter(); | 828 | LLSelectMgr::getInstance()->updateSelectionCenter(); |
830 | gAgent.setPointAt(POINTAT_TARGET_CLEAR); | 829 | gAgent.setPointAt(POINTAT_TARGET_CLEAR); |
831 | gAgent.setLookAt(LOOKAT_TARGET_CLEAR); | 830 | gAgent.setLookAt(LOOKAT_TARGET_CLEAR); |
832 | 831 | ||