diff options
author | Karl Steifvater <qarl@lindenlab.com> | 2008-07-22 20:12:37 +0000 |
---|---|---|
committer | Karl Steifvater <qarl@lindenlab.com> | 2008-07-22 20:12:37 +0000 |
commit | df4f20d4f51e41355e876f734527b4245543415c (patch) | |
tree | 36aaf66ddb96b27fb9701764153cd7d17add275a /indra/newview/llagent.cpp | |
parent | 0c0391cc7114bd2e9e4462c40e88814326f61bc2 (diff) |
merge uv-picking branch.
svn merge -r92602:92632 svn+ssh://svn.lindenlab.com/svn/linden/branches/uv-picking-4
Diffstat (limited to 'indra/newview/llagent.cpp')
-rw-r--r-- | indra/newview/llagent.cpp | 28 |
1 files changed, 16 insertions, 12 deletions
diff --git a/indra/newview/llagent.cpp b/indra/newview/llagent.cpp index 7fb9e57507..cffd4410c3 100644 --- a/indra/newview/llagent.cpp +++ b/indra/newview/llagent.cpp @@ -133,7 +133,6 @@ // end Ventrella extern LLMenuBarGL* gMenuBarView; -extern U8 gLastPickAlpha; //drone wandering constants const F32 MAX_WANDER_TIME = 20.f; // seconds @@ -330,6 +329,8 @@ LLAgent::LLAgent() mCameraZoomFraction(1.f), // deprecated mThirdPersonHeadOffset(0.f, 0.f, 1.f), mSitCameraEnabled(FALSE), + mHUDTargetZoom(1.f), + mHUDCurZoom(1.f), mFocusOnAvatar(TRUE), mFocusGlobal(), mFocusTargetGlobal(), @@ -530,10 +531,7 @@ void LLAgent::resetView(BOOL reset_camera) setFocusOnAvatar(TRUE, ANIMATE); } - if (mAvatarObject.notNull()) - { - mAvatarObject->mHUDTargetZoom = 1.f; - } + mHUDTargetZoom = 1.f; } // Handle any actions that need to be performed when the main app gains focus @@ -1298,7 +1296,7 @@ LLQuaternion LLAgent::getQuat() const //----------------------------------------------------------------------------- // calcFocusOffset() //----------------------------------------------------------------------------- -LLVector3d LLAgent::calcFocusOffset(LLViewerObject *object, S32 x, S32 y) +LLVector3 LLAgent::calcFocusOffset(LLViewerObject *object, S32 x, S32 y) { // calculate offset based on view direction BOOL is_avatar = object->isAvatar(); @@ -1457,10 +1455,10 @@ LLVector3d LLAgent::calcFocusOffset(LLViewerObject *object, S32 x, S32 y) obj_rel = lerp(focus_delta, obj_rel, bias); - return LLVector3d(obj_rel); + return LLVector3(obj_rel); } - return LLVector3d(focus_delta.mV[VX], focus_delta.mV[VY], focus_delta.mV[VZ]); + return LLVector3(focus_delta.mV[VX], focus_delta.mV[VY], focus_delta.mV[VZ]); } //----------------------------------------------------------------------------- @@ -1650,7 +1648,7 @@ F32 LLAgent::getCameraZoomFraction() if (selection->getObjectCount() && selection->getSelectType() == SELECT_TYPE_HUD) { // already [0,1] - return mAvatarObject->mHUDTargetZoom; + return mHUDTargetZoom; } else if (mFocusOnAvatar && cameraThirdPerson()) { @@ -1698,7 +1696,7 @@ void LLAgent::setCameraZoomFraction(F32 fraction) if (selection->getObjectCount() && selection->getSelectType() == SELECT_TYPE_HUD) { - mAvatarObject->mHUDTargetZoom = fraction; + mHUDTargetZoom = fraction; } else if (mFocusOnAvatar && cameraThirdPerson()) { @@ -1808,7 +1806,7 @@ void LLAgent::cameraZoomIn(const F32 fraction) if (selection->getObjectCount() && selection->getSelectType() == SELECT_TYPE_HUD) { // just update hud zoom level - mAvatarObject->mHUDTargetZoom /= fraction; + mHUDTargetZoom /= fraction; return; } @@ -3757,7 +3755,7 @@ LLVector3d LLAgent::calcCameraPositionTargetGlobal(BOOL *hit_limit) lag_interp *= u; - if (gViewerWindow->getLeftMouseDown() && gLastHitObjectID == mAvatarObject->getID()) + if (gViewerWindow->getLeftMouseDown() && gViewerWindow->getLastPick().mObjectID == mAvatarObject->getID()) { // disable camera lag when using mouse-directed steering target_lag.clearVec(); @@ -4285,6 +4283,12 @@ void LLAgent::setFocusObject(LLViewerObject* object) //----------------------------------------------------------------------------- // setFocusGlobal() //----------------------------------------------------------------------------- +void LLAgent::setFocusGlobal(const LLPickInfo& pick) +{ + setFocusGlobal(pick.mPosGlobal, pick.mObjectID); +} + + void LLAgent::setFocusGlobal(const LLVector3d& focus, const LLUUID &object_id) { setFocusObject(gObjectList.findObject(object_id)); |