diff options
Diffstat (limited to 'indra/newview/llmaniprotate.cpp')
-rw-r--r-- | indra/newview/llmaniprotate.cpp | 25 |
1 files changed, 17 insertions, 8 deletions
diff --git a/indra/newview/llmaniprotate.cpp b/indra/newview/llmaniprotate.cpp index ca0812c8a0..e98ded2a87 100644 --- a/indra/newview/llmaniprotate.cpp +++ b/indra/newview/llmaniprotate.cpp @@ -98,6 +98,7 @@ LLManipRotate::LLManipRotate( LLToolComposite* composite ) mCenterToCamMag(0.f), mCenterToProfilePlane(), mCenterToProfilePlaneMag(0.f), + mManipPart( LL_NO_PART ), mSendUpdateOnMouseUp( FALSE ), mSmoothRotate( FALSE ), mCamEdgeOn(FALSE), @@ -112,6 +113,13 @@ void LLManipRotate::handleSelect() LLManip::handleSelect(); } +void LLManipRotate::handleDeselect() +{ + mHighlightedPart = LL_NO_PART; + mManipPart = LL_NO_PART; + LLManip::handleDeselect(); +} + void LLManipRotate::render() { LLGLSUIDefault gls_ui; @@ -136,7 +144,7 @@ void LLManipRotate::render() glPushMatrix(); if (mObjectSelection->getSelectType() == SELECT_TYPE_HUD) { - F32 zoom = gAgent.mHUDCurZoom; + F32 zoom = gAgent.getAvatarObject()->mHUDCurZoom; glScalef(zoom, zoom, zoom); } @@ -355,7 +363,8 @@ BOOL LLManipRotate::handleMouseDown(S32 x, S32 y, MASK mask) LLViewerObject* first_object = mObjectSelection->getFirstMoveableObject(TRUE); if( first_object ) { - if( mHighlightedPart != LL_NO_PART ) + LLViewerObject* hit_obj = gViewerWindow->lastObjectHit(); + if( hit_obj && mHighlightedPart != LL_NO_PART ) { handled = handleMouseDownOnPart( x, y, mask ); } @@ -1117,18 +1126,18 @@ 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 / gAgent.getAvatarObject()->mHUDCurZoom, 0.f, 0.f); mCenterToCamNorm = mCenterToCam; mCenterToCamMag = mCenterToCamNorm.normVec(); mRadiusMeters = RADIUS_PIXELS / (F32) LLViewerCamera::getInstance()->getViewHeightInPixels(); - mRadiusMeters /= gAgent.mHUDCurZoom; + mRadiusMeters /= gAgent.getAvatarObject()->mHUDCurZoom; mCenterToProfilePlaneMag = mRadiusMeters * mRadiusMeters / mCenterToCamMag; mCenterToProfilePlane = -mCenterToProfilePlaneMag * mCenterToCamNorm; - mCenterScreen.set((S32)((0.5f - mRotationCenter.mdV[VY]) / gAgent.mHUDCurZoom * gViewerWindow->getWindowWidth()), - (S32)((mRotationCenter.mdV[VZ] + 0.5f) / gAgent.mHUDCurZoom * gViewerWindow->getWindowHeight())); + mCenterScreen.set((S32)((0.5f - mRotationCenter.mdV[VY]) / gAgent.getAvatarObject()->mHUDCurZoom * gViewerWindow->getWindowWidth()), + (S32)((mRotationCenter.mdV[VZ] + 0.5f) / gAgent.getAvatarObject()->mHUDCurZoom * gViewerWindow->getWindowHeight())); visible = TRUE; } else @@ -1644,8 +1653,8 @@ 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->getWindowWidth()) - 0.5f) / gAgent.mHUDCurZoom; - F32 mouse_y = ((((F32)y) / gViewerWindow->getWindowHeight()) - 0.5f) / gAgent.mHUDCurZoom; + F32 mouse_x = (((F32)x / gViewerWindow->getWindowWidth()) - 0.5f) / gAgent.getAvatarObject()->mHUDCurZoom; + F32 mouse_y = ((((F32)y) / gViewerWindow->getWindowHeight()) - 0.5f) / gAgent.getAvatarObject()->mHUDCurZoom; *ray_pt = LLVector3(-1.f, -mouse_x, mouse_y); *ray_dir = LLVector3(1.f, 0.f, 0.f); |