From 3e226eae0cbf8bc8b01575ad84205ad2d6bfa491 Mon Sep 17 00:00:00 2001 From: CharleyLevenque Date: Wed, 1 Sep 2010 21:10:15 -0400 Subject: [PATCH 1/2] Settings change --- indra/newview/app_settings/settings.xml | 35 +------------------------ 1 file changed, 1 insertion(+), 34 deletions(-) diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index f9524946b..1c266ff1d 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -2,28 +2,6 @@ - AscentDisplayTotalScriptJumps - - Comment - Shows large changes to the sim script count in chat. - Persist - 1 - Type - Boolean - Value - 1 - - Ascentnumscriptdiff - - Comment - The delta to spam you the script jump difference - Persist - 1 - Type - F32 - Value - 100.0 - AscentAvatarXModifier Comment @@ -101,17 +79,6 @@ Value 0 - AscentDisableMinZoomDist - - Comment - Disable minimum zoom distance for the camera. - Persist - 1 - Type - Boolean - Value - 1 - AscentDisplayTotalScriptJumps Comment @@ -130,7 +97,7 @@ Persist 1 Type - S32 + F32 Value 100 From 86adc65261c837b2576c331bea532fb5b879ed2f Mon Sep 17 00:00:00 2001 From: CharleyLevenque Date: Wed, 1 Sep 2010 23:35:11 -0400 Subject: [PATCH 2/2] Building menu, avatar offsets, more attempts to fix min cam dist. --- indra/newview/llagent.cpp | 93 ++++++++----------- indra/newview/llagent.h | 4 +- .../en-us/panel_preferences_ascent_system.xml | 25 +++++ .../en-us/panel_preferences_ascent_vanity.xml | 18 ++++ 4 files changed, 85 insertions(+), 55 deletions(-) diff --git a/indra/newview/llagent.cpp b/indra/newview/llagent.cpp index e83e1c713..84e5bafe4 100644 --- a/indra/newview/llagent.cpp +++ b/indra/newview/llagent.cpp @@ -1970,7 +1970,7 @@ void LLAgent::cameraOrbitIn(const F32 meters) mCameraZoomFraction = (mTargetCameraDistance - meters) / camera_offset_dist; - if (!gSavedSettings.getBOOL("FreezeTime") && mCameraZoomFraction < MIN_ZOOM_FRACTION && meters > 0.f) + if (!LLAppViewer::sFreezeTime && mCameraZoomFraction < MIN_ZOOM_FRACTION && meters > 0.f) { // No need to animate, camera is already there. changeCameraToMouselook(FALSE); @@ -1984,13 +1984,48 @@ void LLAgent::cameraOrbitIn(const F32 meters) LLVector3d camera_offset_unit(mCameraFocusOffsetTarget); F32 current_distance = (F32)camera_offset_unit.normalize(); F32 new_distance = current_distance - meters; + /* + F32 min_zoom = LAND_MIN_ZOOM; + + // Don't move through focus point + if (mFocusObject.notNull()) + { + if (mFocusObject->isAvatar()) + { + min_zoom = AVATAR_MIN_ZOOM; + } + else + { + min_zoom = OBJECT_MIN_ZOOM; + } + } + new_distance = llmax(new_distance, min_zoom); + + // Don't zoom too far back + const F32 DIST_FUDGE = 16.f; // meters + F32 max_distance = llmin(mDrawDistance - DIST_FUDGE, + LLWorld::getInstance()->getRegionWidthInMeters() - DIST_FUDGE ); + + if (new_distance > max_distance) + { + // Unless camera is unlocked + if (!gSavedSettings.getBOOL("DisableCameraConstraints")) + { + return; + } + } + + if( CAMERA_MODE_CUSTOMIZE_AVATAR == getCameraMode() ) + { + new_distance = llclamp( new_distance, APPEARANCE_MIN_ZOOM, APPEARANCE_MAX_ZOOM ); + } + */ + // Compute new camera offset mCameraFocusOffsetTarget = new_distance * camera_offset_unit; cameraZoomIn(1.f); } } - - //----------------------------------------------------------------------------- // cameraPanIn() //----------------------------------------------------------------------------- @@ -3646,7 +3681,8 @@ F32 LLAgent::calcCameraFOVZoomFactor() // don't FOV zoom on mostly transparent objects LLVector3 focus_offset = mFocusObjectOffset; F32 obj_min_dist = 0.f; - calcCameraMinDistance(obj_min_dist); + if (!gSavedSettings.getBOOL("AscentDisableMinZoomDist")) + calcCameraMinDistance(obj_min_dist); F32 current_distance = llmax(0.001f, camera_offset_dir.magVec()); mFocusObjectDist = obj_min_dist - current_distance; @@ -3874,55 +3910,6 @@ LLVector3d LLAgent::calcCameraPositionTargetGlobal(BOOL *hit_limit) camera_position_global = focusPosGlobal + mCameraFocusOffset; } - if (!gSavedSettings.getBOOL("DisableCameraConstraints") && !gAgent.isGodlike()) - { - LLViewerRegion* regionp = LLWorld::getInstance()->getRegionFromPosGlobal( - camera_position_global); - bool constrain = true; - if(regionp && regionp->canManageEstate()) - { - constrain = false; - } - if(constrain) - { - F32 max_dist = ( CAMERA_MODE_CUSTOMIZE_AVATAR == mCameraMode ) ? - APPEARANCE_MAX_ZOOM : mDrawDistance; - - LLVector3d camera_offset = camera_position_global - - gAgent.getPositionGlobal(); - F32 camera_distance = (F32)camera_offset.magVec(); - - if(camera_distance > max_dist) - { - camera_position_global = gAgent.getPositionGlobal() + - (max_dist / camera_distance) * camera_offset; - isConstrained = TRUE; - } - } - -// JC - Could constrain camera based on parcel stuff here. -// LLViewerRegion *regionp = LLWorld::getInstance()->getRegionFromPosGlobal(camera_position_global); -// -// if (regionp && !regionp->mParcelOverlay->isBuildCameraAllowed(regionp->getPosRegionFromGlobal(camera_position_global))) -// { -// camera_position_global = last_position_global; -// -// isConstrained = TRUE; -// } - } - - // Don't let camera go underground - F32 camera_min_off_ground = getCameraMinOffGround(); - - camera_land_height = LLWorld::getInstance()->resolveLandHeightGlobal(camera_position_global); - - if (camera_position_global.mdV[VZ] < camera_land_height + camera_min_off_ground) - { - camera_position_global.mdV[VZ] = camera_land_height + camera_min_off_ground; - isConstrained = TRUE; - } - - if (hit_limit) { *hit_limit = isConstrained; diff --git a/indra/newview/llagent.h b/indra/newview/llagent.h index 10e9f1a2c..cb99803fd 100644 --- a/indra/newview/llagent.h +++ b/indra/newview/llagent.h @@ -414,8 +414,8 @@ public: static void setPhantom(BOOL phantom); static void togglePhantom(); - static BOOL isTPosed() { return mForceTPose; }; - static void setTPosed(BOOL TPose) { mForceTPose = TPose }; + static BOOL isTPosed() { return mForceTPose; } + static void setTPosed(BOOL TPose) { mForceTPose = TPose; } static void toggleTPosed(); // Does this parcel allow you to fly? diff --git a/indra/newview/skins/default/xui/en-us/panel_preferences_ascent_system.xml b/indra/newview/skins/default/xui/en-us/panel_preferences_ascent_system.xml index be54e139f..372ac12e7 100644 --- a/indra/newview/skins/default/xui/en-us/panel_preferences_ascent_system.xml +++ b/indra/newview/skins/default/xui/en-us/panel_preferences_ascent_system.xml @@ -372,6 +372,31 @@ + Pivot Point + + + + + + diff --git a/indra/newview/skins/default/xui/en-us/panel_preferences_ascent_vanity.xml b/indra/newview/skins/default/xui/en-us/panel_preferences_ascent_vanity.xml index 0e012d850..3a52f45f2 100644 --- a/indra/newview/skins/default/xui/en-us/panel_preferences_ascent_vanity.xml +++ b/indra/newview/skins/default/xui/en-us/panel_preferences_ascent_vanity.xml @@ -155,6 +155,24 @@ decimal_digits="0" enabled="true" follows="left|top" height="18" increment="1" label="Breast min vel:" label_width="100" max_val="100" min_val="1" mouse_opaque="true" show_text="true" width="250" auto_resize="false" tool_tip=""/> + + Avatar Offset Modifiers + + + +