From de5b15b590770219927aa5bfb3911629d895fefe Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Wed, 12 May 2010 18:05:57 -0500 Subject: CTS-149 Get rid of camera minimum distance for meshes and when DisableCameraConstraints is TRUE. --- indra/newview/llagentcamera.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'indra/newview/llagentcamera.cpp') diff --git a/indra/newview/llagentcamera.cpp b/indra/newview/llagentcamera.cpp index 9638d0e94f..f838af61a9 100644 --- a/indra/newview/llagentcamera.cpp +++ b/indra/newview/llagentcamera.cpp @@ -556,7 +556,9 @@ BOOL LLAgentCamera::calcCameraMinDistance(F32 &obj_min_distance) { BOOL soft_limit = FALSE; // is the bounding box to be treated literally (volumes) or as an approximation (avatars) - if (!mFocusObject || mFocusObject->isDead()) + if (!mFocusObject || mFocusObject->isDead() || + mFocusObject->isMesh() || + gSavedSettings.getBOOL("DisableCameraConstraints")) { obj_min_distance = 0.f; return TRUE; -- cgit v1.2.3 From 76cf9e29a77566c10da6184833fad6b0912e9688 Mon Sep 17 00:00:00 2001 From: Leyla Farazha Date: Mon, 14 Jun 2010 10:53:28 -0700 Subject: EXT-7799 My Appearance - Edit outfit positions camera to previous camera coordinates reviewed by richard --- indra/newview/llagentcamera.cpp | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'indra/newview/llagentcamera.cpp') diff --git a/indra/newview/llagentcamera.cpp b/indra/newview/llagentcamera.cpp index c3f075fd49..977f1c9fa8 100644 --- a/indra/newview/llagentcamera.cpp +++ b/indra/newview/llagentcamera.cpp @@ -2312,12 +2312,6 @@ void LLAgentCamera::changeCameraToCustomizeAvatar(BOOL avatar_animate, BOOL came startCameraAnimation(); } - // Remove any pitch from the avatar - //LLVector3 at = gAgent.getFrameAgent().getAtAxis(); - //at.mV[VZ] = 0.f; - //at.normalize(); - //gAgent.resetAxes(at); - if (mCameraMode != CAMERA_MODE_CUSTOMIZE_AVATAR) { updateLastCamera(); @@ -2338,9 +2332,11 @@ void LLAgentCamera::changeCameraToCustomizeAvatar(BOOL avatar_animate, BOOL came if (isAgentAvatarValid()) { if(avatar_animate) - { - // Remove any pitch from the avatar - LLVector3 at = gAgent.getFrameAgent().getAtAxis(); + { + // slamming the avatar's axis to the camera so that when the rotation + // completes it correctly points to the front of the avatar + // Remove any pitch or rotation from the avatar + LLVector3 at = LLViewerCamera::getInstance()->getAtAxis(); at.mV[VZ] = 0.f; at.normalize(); gAgent.resetAxes(at); @@ -2360,6 +2356,10 @@ void LLAgentCamera::changeCameraToCustomizeAvatar(BOOL avatar_animate, BOOL came mAnimationDuration = gSavedSettings.getF32("ZoomTime"); } } + + // this is what sets the avatar as the mFocusTargetGlobal + setFocusGlobal(LLVector3d::zero); + gAgentAvatarp->updateMeshTextures(); } else -- cgit v1.2.3 From 8b95793c35c2fe1bf8ddf100fb4481b674ddfc63 Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Tue, 15 Jun 2010 13:53:40 -0700 Subject: EXT-6953 WIP fixed walk cycle foot slip feedback to not speed up animation so much also, made camera default target and offset live-settable for debugging reviewed by vir --- indra/newview/llagentcamera.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'indra/newview/llagentcamera.cpp') diff --git a/indra/newview/llagentcamera.cpp b/indra/newview/llagentcamera.cpp index 977f1c9fa8..3fc5e88633 100644 --- a/indra/newview/llagentcamera.cpp +++ b/indra/newview/llagentcamera.cpp @@ -207,13 +207,13 @@ void LLAgentCamera::init() mCameraPreset = (ECameraPreset) gSavedSettings.getU32("CameraPreset"); - mCameraOffsetInitial[CAMERA_PRESET_REAR_VIEW] = gSavedSettings.getVector3("CameraOffsetRearView"); - mCameraOffsetInitial[CAMERA_PRESET_FRONT_VIEW] = gSavedSettings.getVector3("CameraOffsetFrontView"); - mCameraOffsetInitial[CAMERA_PRESET_GROUP_VIEW] = gSavedSettings.getVector3("CameraOffsetGroupView"); + mCameraOffsetInitial[CAMERA_PRESET_REAR_VIEW] = gSavedSettings.getControl("CameraOffsetRearView"); + mCameraOffsetInitial[CAMERA_PRESET_FRONT_VIEW] = gSavedSettings.getControl("CameraOffsetFrontView"); + mCameraOffsetInitial[CAMERA_PRESET_GROUP_VIEW] = gSavedSettings.getControl("CameraOffsetGroupView"); - mFocusOffsetInitial[CAMERA_PRESET_REAR_VIEW] = gSavedSettings.getVector3d("FocusOffsetRearView"); - mFocusOffsetInitial[CAMERA_PRESET_FRONT_VIEW] = gSavedSettings.getVector3d("FocusOffsetFrontView"); - mFocusOffsetInitial[CAMERA_PRESET_GROUP_VIEW] = gSavedSettings.getVector3d("FocusOffsetGroupView"); + mFocusOffsetInitial[CAMERA_PRESET_REAR_VIEW] = gSavedSettings.getControl("FocusOffsetRearView"); + mFocusOffsetInitial[CAMERA_PRESET_FRONT_VIEW] = gSavedSettings.getControl("FocusOffsetFrontView"); + mFocusOffsetInitial[CAMERA_PRESET_GROUP_VIEW] = gSavedSettings.getControl("FocusOffsetGroupView"); mCameraCollidePlane.clearVec(); mCurrentCameraDistance = getCameraOffsetInitial().magVec() * gSavedSettings.getF32("CameraOffsetScale"); @@ -1643,7 +1643,7 @@ LLVector3d LLAgentCamera::calcThirdPersonFocusOffset() agent_rot *= ((LLViewerObject*)(gAgentAvatarp->getParent()))->getRenderRotation(); } - focus_offset = mFocusOffsetInitial[mCameraPreset] * agent_rot; + focus_offset = convert_from_llsd(mFocusOffsetInitial[mCameraPreset]->get(), TYPE_VEC3D, ""); return focus_offset; } @@ -1978,7 +1978,7 @@ LLVector3d LLAgentCamera::calcCameraPositionTargetGlobal(BOOL *hit_limit) LLVector3 LLAgentCamera::getCameraOffsetInitial() { - return mCameraOffsetInitial[mCameraPreset]; + return convert_from_llsd(mCameraOffsetInitial[mCameraPreset]->get(), TYPE_VEC3, ""); } -- cgit v1.2.3 From 206ce0bb2c0b884b8c64f05d3eb3f9173267d764 Mon Sep 17 00:00:00 2001 From: Richard Nelson Date: Wed, 16 Jun 2010 09:50:09 -0700 Subject: fix for broken rear view camera --- indra/newview/llagentcamera.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview/llagentcamera.cpp') diff --git a/indra/newview/llagentcamera.cpp b/indra/newview/llagentcamera.cpp index 3fc5e88633..c6ca9c5e3a 100644 --- a/indra/newview/llagentcamera.cpp +++ b/indra/newview/llagentcamera.cpp @@ -1644,7 +1644,7 @@ LLVector3d LLAgentCamera::calcThirdPersonFocusOffset() } focus_offset = convert_from_llsd(mFocusOffsetInitial[mCameraPreset]->get(), TYPE_VEC3D, ""); - return focus_offset; + return focus_offset * agent_rot; } void LLAgentCamera::setupSitCamera() -- cgit v1.2.3 From c0129e4b11455a05a94300e1649cf3edaaf824aa Mon Sep 17 00:00:00 2001 From: Aimee Linden Date: Mon, 21 Jun 2010 13:35:55 +0100 Subject: DEV-36437 FIXED (VWR-2485) Menu remains after switch to Mouselook Ported from Snowglobe. --- indra/newview/llagentcamera.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'indra/newview/llagentcamera.cpp') diff --git a/indra/newview/llagentcamera.cpp b/indra/newview/llagentcamera.cpp index c6ca9c5e3a..9cf0a659c1 100644 --- a/indra/newview/llagentcamera.cpp +++ b/indra/newview/llagentcamera.cpp @@ -2084,6 +2084,9 @@ void LLAgentCamera::changeCameraToMouselook(BOOL animate) // visibility changes at end of animation gViewerWindow->getWindow()->resetBusyCount(); + // Menus should not remain open on switching to mouselook... + LLMenuGL::sMenuContainer->hideMenus(); + // unpause avatar animation gAgent.unpauseAnimation(); -- cgit v1.2.3 From 0aabcc81346390fe312bf03355744a6e13ab0927 Mon Sep 17 00:00:00 2001 From: Richard Nelson Date: Wed, 23 Jun 2010 16:50:06 -0700 Subject: EXT-7767 FIX Outfit editor doesn't appear to have a default camera view --- indra/newview/llagentcamera.cpp | 74 ++++++++++++++++++++++------------------- 1 file changed, 39 insertions(+), 35 deletions(-) (limited to 'indra/newview/llagentcamera.cpp') diff --git a/indra/newview/llagentcamera.cpp b/indra/newview/llagentcamera.cpp index 9cf0a659c1..70f9fa03e4 100644 --- a/indra/newview/llagentcamera.cpp +++ b/indra/newview/llagentcamera.cpp @@ -156,7 +156,6 @@ LLAgentCamera::LLAgentCamera() : mFocusObjectOffset(), mFocusDotRadius( 0.1f ), // meters mTrackFocusObject(TRUE), - mUIOffset(0.f), mAtKey(0), // Either 1, 0, or -1... indicates that movement-key is pressed mWalkKey(0), // like AtKey, but causes less forward thrust @@ -1407,13 +1406,6 @@ void LLAgentCamera::updateCamera() // llinfos << "Current FOV Zoom: " << mCameraCurrentFOVZoomFactor << " Target FOV Zoom: " << mCameraFOVZoomFactor << " Object penetration: " << mFocusObjectDist << llendl; - F32 ui_offset = 0.f; - if( CAMERA_MODE_CUSTOMIZE_AVATAR == mCameraMode ) - { - ui_offset = calcCustomizeAvatarUIOffset( camera_pos_global ); - } - - LLVector3 focus_agent = gAgent.getPosAgentFromGlobal(mFocusGlobal); mCameraPositionAgent = gAgent.getPosAgentFromGlobal(camera_pos_global); @@ -1424,9 +1416,6 @@ void LLAgentCamera::updateCamera() LLViewerCamera::getInstance()->updateCameraLocation(mCameraPositionAgent, mCameraUpVector, focus_agent); //LLViewerCamera::getInstance()->updateCameraLocation(mCameraPositionAgent, camera_skyward, focus_agent); //end Ventrella - - //RN: translate UI offset after camera is oriented properly - LLViewerCamera::getInstance()->translate(LLViewerCamera::getInstance()->getLeftAxis() * ui_offset); // Change FOV LLViewerCamera::getInstance()->setView(LLViewerCamera::getInstance()->getDefaultFOV() / (1.f + mCameraCurrentFOVZoomFactor)); @@ -1531,18 +1520,6 @@ void LLAgentCamera::validateFocusObject() } } -//----------------------------------------------------------------------------- -// calcCustomizeAvatarUIOffset() -//----------------------------------------------------------------------------- -F32 LLAgentCamera::calcCustomizeAvatarUIOffset(const LLVector3d& camera_pos_global) -{ - F32 ui_offset = 0.f; - - F32 range = (F32)dist_vec(camera_pos_global, getFocusGlobal()); - mUIOffset = lerp(mUIOffset, ui_offset, LLCriticalDamp::getInterpolant(0.05f)); - return mUIOffset * range; -} - //----------------------------------------------------------------------------- // calcFocusPositionTargetGlobal() //----------------------------------------------------------------------------- @@ -2332,6 +2309,18 @@ void LLAgentCamera::changeCameraToCustomizeAvatar(BOOL avatar_animate, BOOL came LLVOAvatarSelf::onCustomizeStart(); } + + // default focus point for customize avatar + LLVector3 focus_target; + if (isAgentAvatarValid()) + { + focus_target = gAgentAvatarp->mHeadp->getWorldPosition(); + } + else + { + focus_target = gAgent.getPositionAgent(); + } + if (isAgentAvatarValid()) { if(avatar_animate) @@ -2339,7 +2328,7 @@ void LLAgentCamera::changeCameraToCustomizeAvatar(BOOL avatar_animate, BOOL came // slamming the avatar's axis to the camera so that when the rotation // completes it correctly points to the front of the avatar // Remove any pitch or rotation from the avatar - LLVector3 at = LLViewerCamera::getInstance()->getAtAxis(); + LLVector3 at = gAgent.getAtAxis(); at.mV[VZ] = 0.f; at.normalize(); gAgent.resetAxes(at); @@ -2351,17 +2340,25 @@ void LLAgentCamera::changeCameraToCustomizeAvatar(BOOL avatar_animate, BOOL came if (turn_motion) { - mAnimationDuration = turn_motion->getDuration() + CUSTOMIZE_AVATAR_CAMERA_ANIM_SLOP; + setAnimationDuration(turn_motion->getDuration() + CUSTOMIZE_AVATAR_CAMERA_ANIM_SLOP); } else { - mAnimationDuration = gSavedSettings.getF32("ZoomTime"); + setAnimationDuration(gSavedSettings.getF32("ZoomTime")); } } - // this is what sets the avatar as the mFocusTargetGlobal - setFocusGlobal(LLVector3d::zero); + LLVector3 agent_at = gAgent.getAtAxis(); + agent_at.mV[VZ] = 0.f; + agent_at.normalize(); + + LLVector3d camera_offset(agent_at * -1.0); + // push camera up and out from avatar + camera_offset.mdV[VZ] = 0.1f; + camera_offset *= 3.5f; + LLVector3d focus_target_global = gAgent.getPosGlobalFromAgent(focus_target); + setCameraPosAndFocusGlobal(focus_target_global + camera_offset, focus_target_global, gAgent.getID()); gAgentAvatarp->updateMeshTextures(); } @@ -2391,6 +2388,19 @@ void LLAgentCamera::switchCameraPreset(ECameraPreset preset) // Focus point management // +void LLAgentCamera::setAnimationDuration(F32 duration) +{ + if (mCameraAnimating) + { + F32 animation_left = llmax(0.f, mAnimationDuration - mAnimationTimer.getElapsedTimeF32()); + mAnimationDuration = llmax(duration, animation_left); + } + else + { + mAnimationDuration = duration; + } +} + //----------------------------------------------------------------------------- // startCameraAnimation() //----------------------------------------------------------------------------- @@ -2398,9 +2408,9 @@ void LLAgentCamera::startCameraAnimation() { mAnimationCameraStartGlobal = getCameraPositionGlobal(); mAnimationFocusStartGlobal = mFocusGlobal; + setAnimationDuration(gSavedSettings.getF32("ZoomTime")); mAnimationTimer.reset(); mCameraAnimating = TRUE; - mAnimationDuration = gSavedSettings.getF32("ZoomTime"); } //----------------------------------------------------------------------------- @@ -2546,12 +2556,6 @@ void LLAgentCamera::setCameraPosAndFocusGlobal(const LLVector3d& camera_pos, con if (focus_delta_squared > ANIM_EPSILON_SQUARED) { startCameraAnimation(); - - if (CAMERA_MODE_CUSTOMIZE_AVATAR == mCameraMode) - { - // Compensate for the fact that the camera has already been offset to make room for LLFloaterCustomize. - mAnimationCameraStartGlobal -= LLVector3d(LLViewerCamera::getInstance()->getLeftAxis() * calcCustomizeAvatarUIOffset( mAnimationCameraStartGlobal )); - } } //LLViewerCamera::getInstance()->setOrigin( gAgent.getPosAgentFromGlobal( camera_pos ) ); -- cgit v1.2.3 From 6dd35018d2f7aa84973b8e7ff743e8de6454f01c Mon Sep 17 00:00:00 2001 From: Richard Nelson Date: Wed, 23 Jun 2010 18:32:31 -0700 Subject: EXT-7767 FIX Outfit editor doesn't appear to have a default camera view added some comments and cleaned up code based on review --- indra/newview/llagentcamera.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'indra/newview/llagentcamera.cpp') diff --git a/indra/newview/llagentcamera.cpp b/indra/newview/llagentcamera.cpp index 70f9fa03e4..e1a0162441 100644 --- a/indra/newview/llagentcamera.cpp +++ b/indra/newview/llagentcamera.cpp @@ -95,6 +95,8 @@ const F32 OBJECT_MIN_ZOOM = 0.02f; const F32 APPEARANCE_MIN_ZOOM = 0.39f; const F32 APPEARANCE_MAX_ZOOM = 8.f; +const F32 CUSTOMIZE_AVATAR_CAMERA_DEFAULT_DIST = 3.5f; + const F32 GROUND_TO_AIR_CAMERA_TRANSITION_TIME = 0.5f; const F32 GROUND_TO_AIR_CAMERA_TRANSITION_START_TIME = 0.5f; @@ -2325,8 +2327,6 @@ void LLAgentCamera::changeCameraToCustomizeAvatar(BOOL avatar_animate, BOOL came { if(avatar_animate) { - // slamming the avatar's axis to the camera so that when the rotation - // completes it correctly points to the front of the avatar // Remove any pitch or rotation from the avatar LLVector3 at = gAgent.getAtAxis(); at.mV[VZ] = 0.f; @@ -2356,7 +2356,7 @@ void LLAgentCamera::changeCameraToCustomizeAvatar(BOOL avatar_animate, BOOL came LLVector3d camera_offset(agent_at * -1.0); // push camera up and out from avatar camera_offset.mdV[VZ] = 0.1f; - camera_offset *= 3.5f; + camera_offset *= CUSTOMIZE_AVATAR_CAMERA_DEFAULT_DIST; LLVector3d focus_target_global = gAgent.getPosGlobalFromAgent(focus_target); setCameraPosAndFocusGlobal(focus_target_global + camera_offset, focus_target_global, gAgent.getID()); @@ -2392,6 +2392,7 @@ void LLAgentCamera::setAnimationDuration(F32 duration) { if (mCameraAnimating) { + // do not cut any existing camera animation short F32 animation_left = llmax(0.f, mAnimationDuration - mAnimationTimer.getElapsedTimeF32()); mAnimationDuration = llmax(duration, animation_left); } -- cgit v1.2.3 From e8a52ebc51ebb27b7ffe3c9c275c04ccf3084bbb Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Thu, 1 Jul 2010 10:33:06 -0700 Subject: EXT-8148 Camera transitions are occasionally very slow for appearance editing transitions reviewed by Nyx --- indra/newview/llagentcamera.cpp | 87 ++++++++++++----------------------------- 1 file changed, 25 insertions(+), 62 deletions(-) (limited to 'indra/newview/llagentcamera.cpp') diff --git a/indra/newview/llagentcamera.cpp b/indra/newview/llagentcamera.cpp index e1a0162441..ec3c7452e5 100644 --- a/indra/newview/llagentcamera.cpp +++ b/indra/newview/llagentcamera.cpp @@ -85,7 +85,7 @@ const F32 MAX_CAMERA_SMOOTH_DISTANCE = 50.0f; const F32 HEAD_BUFFER_SIZE = 0.3f; -const F32 CUSTOMIZE_AVATAR_CAMERA_ANIM_SLOP = 0.2f; +const F32 CUSTOMIZE_AVATAR_CAMERA_ANIM_SLOP = 0.1f; const F32 LAND_MIN_ZOOM = 0.15f; @@ -2169,12 +2169,7 @@ void LLAgentCamera::changeCameraToFollow(BOOL animate) // unpause avatar animation gAgent.unpauseAnimation(); - const U32 old_flags = gAgent.getControlFlags(); gAgent.clearControlFlags(AGENT_CONTROL_MOUSELOOK); - if (old_flags != gAgent.getControlFlags()) - { - gAgent.setFlagsDirty(); - } if (animate) { @@ -2233,13 +2228,7 @@ void LLAgentCamera::changeCameraToThirdPerson(BOOL animate) } updateLastCamera(); mCameraMode = CAMERA_MODE_THIRD_PERSON; - const U32 old_flags = gAgent.getControlFlags(); gAgent.clearControlFlags(AGENT_CONTROL_MOUSELOOK); - if (old_flags != gAgent.getControlFlags()) - { - gAgent.setFlagsDirty(); - } - } // Remove any pitch from the avatar @@ -2274,7 +2263,7 @@ void LLAgentCamera::changeCameraToThirdPerson(BOOL animate) //----------------------------------------------------------------------------- // changeCameraToCustomizeAvatar() //----------------------------------------------------------------------------- -void LLAgentCamera::changeCameraToCustomizeAvatar(BOOL avatar_animate, BOOL camera_animate) +void LLAgentCamera::changeCameraToCustomizeAvatar() { if (LLViewerJoystick::getInstance()->getOverrideCamera()) { @@ -2289,44 +2278,21 @@ void LLAgentCamera::changeCameraToCustomizeAvatar(BOOL avatar_animate, BOOL came LLToolMgr::getInstance()->setCurrentToolset(gFaceEditToolset); } - if (camera_animate) - { - startCameraAnimation(); - } + startCameraAnimation(); if (mCameraMode != CAMERA_MODE_CUSTOMIZE_AVATAR) { updateLastCamera(); mCameraMode = CAMERA_MODE_CUSTOMIZE_AVATAR; - const U32 old_flags = gAgent.getControlFlags(); gAgent.clearControlFlags(AGENT_CONTROL_MOUSELOOK); - if (old_flags != gAgent.getControlFlags()) - { - gAgent.setFlagsDirty(); - } gFocusMgr.setKeyboardFocus( NULL ); gFocusMgr.setMouseCapture( NULL ); LLVOAvatarSelf::onCustomizeStart(); - } - - - // default focus point for customize avatar - LLVector3 focus_target; - if (isAgentAvatarValid()) - { - focus_target = gAgentAvatarp->mHeadp->getWorldPosition(); - } - else - { - focus_target = gAgent.getPositionAgent(); - } - if (isAgentAvatarValid()) - { - if(avatar_animate) - { + if (isAgentAvatarValid()) + { // Remove any pitch or rotation from the avatar LLVector3 at = gAgent.getAtAxis(); at.mV[VZ] = 0.f; @@ -2340,33 +2306,30 @@ void LLAgentCamera::changeCameraToCustomizeAvatar(BOOL avatar_animate, BOOL came if (turn_motion) { + // delay camera animation long enough to play through turn animation setAnimationDuration(turn_motion->getDuration() + CUSTOMIZE_AVATAR_CAMERA_ANIM_SLOP); - - } - else - { - setAnimationDuration(gSavedSettings.getF32("ZoomTime")); } + + gAgentAvatarp->updateMeshTextures(); } + } - LLVector3 agent_at = gAgent.getAtAxis(); - agent_at.mV[VZ] = 0.f; - agent_at.normalize(); + LLVector3 agent_at = gAgent.getAtAxis(); + agent_at.mV[VZ] = 0.f; + agent_at.normalize(); - LLVector3d camera_offset(agent_at * -1.0); - // push camera up and out from avatar - camera_offset.mdV[VZ] = 0.1f; - camera_offset *= CUSTOMIZE_AVATAR_CAMERA_DEFAULT_DIST; - LLVector3d focus_target_global = gAgent.getPosGlobalFromAgent(focus_target); - setCameraPosAndFocusGlobal(focus_target_global + camera_offset, focus_target_global, gAgent.getID()); - - gAgentAvatarp->updateMeshTextures(); - } - else - { - mCameraAnimating = FALSE; - gAgent.endAnimationUpdateUI(); - } + // default focus point for customize avatar + LLVector3 focus_target = isAgentAvatarValid() + ? gAgentAvatarp->mHeadp->getWorldPosition() + : gAgent.getPositionAgent(); + + LLVector3d camera_offset(agent_at * -1.0); + // push camera up and out from avatar + camera_offset.mdV[VZ] = 0.1f; + camera_offset *= CUSTOMIZE_AVATAR_CAMERA_DEFAULT_DIST; + LLVector3d focus_target_global = gAgent.getPosGlobalFromAgent(focus_target); + setAnimationDuration(gSavedSettings.getF32("ZoomTime")); + setCameraPosAndFocusGlobal(focus_target_global + camera_offset, focus_target_global, gAgent.getID()); } @@ -2550,7 +2513,7 @@ void LLAgentCamera::setFocusGlobal(const LLVector3d& focus, const LLUUID &object //----------------------------------------------------------------------------- void LLAgentCamera::setCameraPosAndFocusGlobal(const LLVector3d& camera_pos, const LLVector3d& focus, const LLUUID &object_id) { - LLVector3d old_focus = mFocusTargetGlobal; + LLVector3d old_focus = mFocusTargetGlobal.isExactlyZero() ? focus : mFocusTargetGlobal; F64 focus_delta_squared = (old_focus - focus).magVecSquared(); const F64 ANIM_EPSILON_SQUARED = 0.0001; -- cgit v1.2.3 From fcfaa698215c7d8516c5bc175dc9dd19996f32ca Mon Sep 17 00:00:00 2001 From: "Nyx (Neal Orman)" Date: Tue, 6 Jul 2010 18:13:46 -0400 Subject: EXT-8020 FIX outfit textures are blurry on opening outfit editor We believe this fix should help with the blurry textures - we weren't updating our local bake of your avatars' appearance. Added a line to trigger this refresh. Code reviewed by Seraph --- indra/newview/llagentcamera.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'indra/newview/llagentcamera.cpp') diff --git a/indra/newview/llagentcamera.cpp b/indra/newview/llagentcamera.cpp index ec3c7452e5..c70bbb985f 100644 --- a/indra/newview/llagentcamera.cpp +++ b/indra/newview/llagentcamera.cpp @@ -2310,6 +2310,7 @@ void LLAgentCamera::changeCameraToCustomizeAvatar() setAnimationDuration(turn_motion->getDuration() + CUSTOMIZE_AVATAR_CAMERA_ANIM_SLOP); } + gAgentAvatarp->invalidateAll(); gAgentAvatarp->updateMeshTextures(); } } -- cgit v1.2.3 From 07406b839789e8f72b9dd0321942aa458c922589 Mon Sep 17 00:00:00 2001 From: Vadim Savchuk Date: Wed, 7 Jul 2010 21:18:32 +0300 Subject: EXT-8208 FIXED Hide pop-ups on entering mouse-look mode. Reviewed by Sergey Litovchuk at https://codereview.productengine.com/secondlife/r/706/ --HG-- branch : product-engine --- indra/newview/llagentcamera.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'indra/newview/llagentcamera.cpp') diff --git a/indra/newview/llagentcamera.cpp b/indra/newview/llagentcamera.cpp index c70bbb985f..1ef9e34f87 100644 --- a/indra/newview/llagentcamera.cpp +++ b/indra/newview/llagentcamera.cpp @@ -2065,6 +2065,7 @@ void LLAgentCamera::changeCameraToMouselook(BOOL animate) // Menus should not remain open on switching to mouselook... LLMenuGL::sMenuContainer->hideMenus(); + LLUI::clearPopups(); // unpause avatar animation gAgent.unpauseAnimation(); -- cgit v1.2.3 From 75cfa9a0c3c15e3a472a4c4fd2462402a3a766a0 Mon Sep 17 00:00:00 2001 From: Loren Shih Date: Thu, 22 Jul 2010 15:06:08 -0400 Subject: EXT-8051 FIXED Change cameraCustomizeAvatar calls to use gAvatarp->isUsingBakedTextures Changed some uses of cameraCustomizeAvatar as appropriate. --- indra/newview/llagentcamera.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview/llagentcamera.cpp') diff --git a/indra/newview/llagentcamera.cpp b/indra/newview/llagentcamera.cpp index 1ef9e34f87..4dc78e9a1d 100644 --- a/indra/newview/llagentcamera.cpp +++ b/indra/newview/llagentcamera.cpp @@ -941,7 +941,7 @@ void LLAgentCamera::cameraZoomIn(const F32 fraction) */ } - if( cameraCustomizeAvatar() ) + if(cameraCustomizeAvatar()) { new_distance = llclamp( new_distance, APPEARANCE_MIN_ZOOM, APPEARANCE_MAX_ZOOM ); } -- cgit v1.2.3 From 06b0d72efa96b6a0ed665f7cd46f358c48929e7b Mon Sep 17 00:00:00 2001 From: Oz Linden Date: Fri, 13 Aug 2010 07:24:57 -0400 Subject: Change license from GPL to LGPL (version 2.1) --- indra/newview/llagentcamera.cpp | 36 +++++++++++++++--------------------- 1 file changed, 15 insertions(+), 21 deletions(-) (limited to 'indra/newview/llagentcamera.cpp') diff --git a/indra/newview/llagentcamera.cpp b/indra/newview/llagentcamera.cpp index 4dc78e9a1d..6c050a1309 100644 --- a/indra/newview/llagentcamera.cpp +++ b/indra/newview/llagentcamera.cpp @@ -2,31 +2,25 @@ * @file llagentcamera.cpp * @brief LLAgent class implementation * - * $LicenseInfo:firstyear=2001&license=viewergpl$ - * - * Copyright (c) 2001-2009, Linden Research, Inc. - * + * $LicenseInfo:firstyear=2001&license=viewerlgpl$ * Second Life Viewer Source Code - * The source code in this file ("Source Code") is provided by Linden Lab - * to you under the terms of the GNU General Public License, version 2.0 - * ("GPL"), unless you have obtained a separate licensing agreement - * ("Other License"), formally executed by you and Linden Lab. Terms of - * the GPL can be found in doc/GPL-license.txt in this distribution, or - * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2 + * Copyright (C) 2010, Linden Research, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; + * version 2.1 of the License only. * - * There are special exceptions to the terms and conditions of the GPL as - * it is applied to this Source Code. View the full text of the exception - * in the file doc/FLOSS-exception.txt in this software distribution, or - * online at - * http://secondlifegrid.net/programs/open_source/licensing/flossexception + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. * - * By copying, modifying or distributing this software, you acknowledge - * that you have read and understood your obligations described above, - * and agree to abide by those obligations. + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * - * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO - * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, - * COMPLETENESS OR PERFORMANCE. + * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA * $/LicenseInfo$ */ -- cgit v1.2.3 From 9989c304c9e5a1f20fe65873c3db43911c4a7635 Mon Sep 17 00:00:00 2001 From: Tofu Linden Date: Fri, 13 Aug 2010 12:25:59 +0100 Subject: trivial comment changes while I was in this code. --- indra/newview/llagentcamera.cpp | 18 +++--------------- 1 file changed, 3 insertions(+), 15 deletions(-) (limited to 'indra/newview/llagentcamera.cpp') diff --git a/indra/newview/llagentcamera.cpp b/indra/newview/llagentcamera.cpp index 4dc78e9a1d..e97e152a38 100644 --- a/indra/newview/llagentcamera.cpp +++ b/indra/newview/llagentcamera.cpp @@ -1149,10 +1149,9 @@ void LLAgentCamera::updateCamera() static LLFastTimer::DeclareTimer ftm("Camera"); LLFastTimer t(ftm); - //Ventrella - changed camera_skyward to the new global "mCameraUpVector" + // - changed camera_skyward to the new global "mCameraUpVector" mCameraUpVector = LLVector3::z_axis; //LLVector3 camera_skyward(0.f, 0.f, 1.f); - //end Ventrella U32 camera_mode = mCameraAnimating ? mLastCameraMode : mCameraMode; @@ -1162,10 +1161,8 @@ void LLAgentCamera::updateCamera() gAgentAvatarp->isSitting() && camera_mode == CAMERA_MODE_MOUSELOOK) { - //Ventrella //changed camera_skyward to the new global "mCameraUpVector" mCameraUpVector = mCameraUpVector * gAgentAvatarp->getRenderRotation(); - //end Ventrella } if (cameraThirdPerson() && mFocusOnAvatar && LLFollowCamMgr::getActiveFollowCamParams()) @@ -1173,13 +1170,11 @@ void LLAgentCamera::updateCamera() changeCameraToFollow(); } - //Ventrella //NOTE - this needs to be integrated into a general upVector system here within llAgent. if ( camera_mode == CAMERA_MODE_FOLLOW && mFocusOnAvatar ) { mCameraUpVector = mFollowCam.getUpVector(); } - //end Ventrella if (mSitCameraEnabled) { @@ -1256,7 +1251,6 @@ void LLAgentCamera::updateCamera() // lerp camera focus offset mCameraFocusOffset = lerp(mCameraFocusOffset, mCameraFocusOffsetTarget, LLCriticalDamp::getInterpolant(CAMERA_FOCUS_HALF_LIFE)); - //Ventrella if ( mCameraMode == CAMERA_MODE_FOLLOW ) { if (isAgentAvatarValid()) @@ -1283,7 +1277,6 @@ void LLAgentCamera::updateCamera() } } } - // end Ventrella BOOL hit_limit; LLVector3d camera_pos_global; @@ -1414,10 +1407,8 @@ void LLAgentCamera::updateCamera() // Move the camera - //Ventrella LLViewerCamera::getInstance()->updateCameraLocation(mCameraPositionAgent, mCameraUpVector, focus_agent); //LLViewerCamera::getInstance()->updateCameraLocation(mCameraPositionAgent, camera_skyward, focus_agent); - //end Ventrella // Change FOV LLViewerCamera::getInstance()->setView(LLViewerCamera::getInstance()->getDefaultFOV() / (1.f + mCameraCurrentFOVZoomFactor)); @@ -1532,12 +1523,11 @@ LLVector3d LLAgentCamera::calcFocusPositionTargetGlobal() clearFocusObject(); } - // Ventrella if (mCameraMode == CAMERA_MODE_FOLLOW && mFocusOnAvatar) { mFocusTargetGlobal = gAgent.getPosGlobalFromAgent(mFollowCam.getSimulatedFocus()); return mFocusTargetGlobal; - }// End Ventrella + } else if (mCameraMode == CAMERA_MODE_MOUSELOOK) { LLVector3d at_axis(1.0, 0.0, 0.0); @@ -1706,11 +1696,10 @@ LLVector3d LLAgentCamera::calcCameraPositionTargetGlobal(BOOL *hit_limit) LLVector3d camera_position_global; - // Ventrella if (mCameraMode == CAMERA_MODE_FOLLOW && mFocusOnAvatar) { camera_position_global = gAgent.getPosGlobalFromAgent(mFollowCam.getSimulatedPosition()); - }// End Ventrella + } else if (mCameraMode == CAMERA_MODE_MOUSELOOK) { if (!isAgentAvatarValid() || gAgentAvatarp->mDrawable.isNull()) @@ -2130,7 +2119,6 @@ void LLAgentCamera::changeCameraToDefault() } -// Ventrella //----------------------------------------------------------------------------- // changeCameraToFollow() //----------------------------------------------------------------------------- -- cgit v1.2.3 From 98cc2365034a93c69704daa69efb389799cc9627 Mon Sep 17 00:00:00 2001 From: Tofu Linden Date: Tue, 24 Aug 2010 18:44:39 +0100 Subject: Backed out changeset a62bf7c0af21 Backing out this merge that I pushed (prematurely) to the wrong place. --- indra/newview/llagentcamera.cpp | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) (limited to 'indra/newview/llagentcamera.cpp') diff --git a/indra/newview/llagentcamera.cpp b/indra/newview/llagentcamera.cpp index 68e408d3e4..6c050a1309 100644 --- a/indra/newview/llagentcamera.cpp +++ b/indra/newview/llagentcamera.cpp @@ -1143,9 +1143,10 @@ void LLAgentCamera::updateCamera() static LLFastTimer::DeclareTimer ftm("Camera"); LLFastTimer t(ftm); - // - changed camera_skyward to the new global "mCameraUpVector" + //Ventrella - changed camera_skyward to the new global "mCameraUpVector" mCameraUpVector = LLVector3::z_axis; //LLVector3 camera_skyward(0.f, 0.f, 1.f); + //end Ventrella U32 camera_mode = mCameraAnimating ? mLastCameraMode : mCameraMode; @@ -1155,8 +1156,10 @@ void LLAgentCamera::updateCamera() gAgentAvatarp->isSitting() && camera_mode == CAMERA_MODE_MOUSELOOK) { + //Ventrella //changed camera_skyward to the new global "mCameraUpVector" mCameraUpVector = mCameraUpVector * gAgentAvatarp->getRenderRotation(); + //end Ventrella } if (cameraThirdPerson() && mFocusOnAvatar && LLFollowCamMgr::getActiveFollowCamParams()) @@ -1164,11 +1167,13 @@ void LLAgentCamera::updateCamera() changeCameraToFollow(); } + //Ventrella //NOTE - this needs to be integrated into a general upVector system here within llAgent. if ( camera_mode == CAMERA_MODE_FOLLOW && mFocusOnAvatar ) { mCameraUpVector = mFollowCam.getUpVector(); } + //end Ventrella if (mSitCameraEnabled) { @@ -1245,6 +1250,7 @@ void LLAgentCamera::updateCamera() // lerp camera focus offset mCameraFocusOffset = lerp(mCameraFocusOffset, mCameraFocusOffsetTarget, LLCriticalDamp::getInterpolant(CAMERA_FOCUS_HALF_LIFE)); + //Ventrella if ( mCameraMode == CAMERA_MODE_FOLLOW ) { if (isAgentAvatarValid()) @@ -1271,6 +1277,7 @@ void LLAgentCamera::updateCamera() } } } + // end Ventrella BOOL hit_limit; LLVector3d camera_pos_global; @@ -1401,8 +1408,10 @@ void LLAgentCamera::updateCamera() // Move the camera + //Ventrella LLViewerCamera::getInstance()->updateCameraLocation(mCameraPositionAgent, mCameraUpVector, focus_agent); //LLViewerCamera::getInstance()->updateCameraLocation(mCameraPositionAgent, camera_skyward, focus_agent); + //end Ventrella // Change FOV LLViewerCamera::getInstance()->setView(LLViewerCamera::getInstance()->getDefaultFOV() / (1.f + mCameraCurrentFOVZoomFactor)); @@ -1517,11 +1526,12 @@ LLVector3d LLAgentCamera::calcFocusPositionTargetGlobal() clearFocusObject(); } + // Ventrella if (mCameraMode == CAMERA_MODE_FOLLOW && mFocusOnAvatar) { mFocusTargetGlobal = gAgent.getPosGlobalFromAgent(mFollowCam.getSimulatedFocus()); return mFocusTargetGlobal; - } + }// End Ventrella else if (mCameraMode == CAMERA_MODE_MOUSELOOK) { LLVector3d at_axis(1.0, 0.0, 0.0); @@ -1690,10 +1700,11 @@ LLVector3d LLAgentCamera::calcCameraPositionTargetGlobal(BOOL *hit_limit) LLVector3d camera_position_global; + // Ventrella if (mCameraMode == CAMERA_MODE_FOLLOW && mFocusOnAvatar) { camera_position_global = gAgent.getPosGlobalFromAgent(mFollowCam.getSimulatedPosition()); - } + }// End Ventrella else if (mCameraMode == CAMERA_MODE_MOUSELOOK) { if (!isAgentAvatarValid() || gAgentAvatarp->mDrawable.isNull()) @@ -2113,6 +2124,7 @@ void LLAgentCamera::changeCameraToDefault() } +// Ventrella //----------------------------------------------------------------------------- // changeCameraToFollow() //----------------------------------------------------------------------------- -- cgit v1.2.3