Building menu, avatar offsets, more attempts to fix min cam dist.

This commit is contained in:
CharleyLevenque
2010-09-01 23:35:11 -04:00
parent 95327d1bda
commit 86adc65261
4 changed files with 85 additions and 55 deletions

View File

@@ -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;

View File

@@ -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?

View File

@@ -372,6 +372,31 @@
</panel>
<panel border="true" left="1" bottom="-408" height="408" width="500" mouse_opaque="true"
follows="left|top|right|bottom" label="Building" name="Building">
<text type="string" length="1" bg_visible="false" border_drop_shadow_visible="false" border_visible="false"
bottom_delta="-25" drop_shadow_visible="true" enabled="true" follows="left|top" font="SansSerifSmall"
h_pad="0" halign="left" height="10" left_delta="30" mouse_opaque="false"
name="text_box6" v_pad="0" width="150"> Pivot Point</text>
<spinner bottom_delta="-20" decimal_digits="5" follows="left|top" height="16" increment="0.05"
label="X pos" label_width="40" left="10" mouse_opaque="true" max_val="256"
min_val="-256" name="X pos" width="120" control_name="AscentBuildPrefs_PivotX"/>
<spinner bottom_delta="-20" decimal_digits="5" follows="left|top" height="16" increment="0.05"
label="Y pos" label_width="40" left_delta="0" mouse_opaque="true" max_val="256"
min_val="-256" name="Y pos" width="120" control_name="AscentBuildPrefs_PivotY"/>
<spinner bottom_delta="-20" decimal_digits="5" follows="left|top" height="16" increment="0.05"
label="Z pos" label_width="40" left_delta="0" mouse_opaque="true" max_val="256"
min_val="-256" name="Z pos" width="120" control_name="AscentBuildPrefs_PivotZ"/>
<check_box bottom_delta="-20" enabled="true" follows="left|top" font="SansSerifSmall" height="16"
label="Values are percent" left_delta="-5" mouse_opaque="true" tool_tip="Default settings are Percentages and every axis set at 50"
name="EmPivotPercToggle" radio_style="false" width="100" control_name="AscentBuildPrefs_PivotIsPercent"/>
<check_box bottom_delta="60" enabled="true" follows="left|top" font="SansSerifSmall" height="16"
initial_value="true" label="Enable highlighting of selected prims" left_delta="140"
mouse_opaque="true" name="EmBuildPrefsRenderHighlight_toggle" control_name="AscentRenderHighlightSelections"
radio_style="false" width="270"/>
<check_box bottom_delta="-20" enabled="true" follows="left|top" font="SansSerifSmall" height="16"
initial_value="false" label="Show axis arrow on root prim position" left_delta="0"
mouse_opaque="true" tool_tip="Default behaviour is to show the axis on the center of mass of a linkset. If enabled, the axis will be shown on the root prim of the linkset instead."
name="EmBuildPrefsActualRoot_toggle" control_name="AscentBuildPrefs_ActualRoot"
radio_style="false" width="270"/>
</panel>
</tab_container>
</panel>

View File

@@ -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=""/>
<text type="string" length="1" bg_visible="false" border_drop_shadow_visible="false" border_visible="false"
bottom_delta="-20" drop_shadow_visible="true" enabled="true" follows="left|top"
font="SansSerifSmall" h_pad="0" halign="left" height="15" left="10"
mouse_opaque="true" name="av_mod_textbox" v_pad="0" width="394">
Avatar Offset Modifiers
</text>
<spinner bottom_delta="-20" decimal_digits="5" follows="left|top" height="16" increment="0.05"
label="X Modifier" label_width="65" left_delta="5" max_val="0.15" min_val="-0.15"
mouse_opaque="true" name="X Modifier" width="128" control_name="AscentAvatarXModifier"
tool_tip="Use this to manipulate, to a degree, your avatar bounding box. This can be used to distort orbiters, or to raise you up or down without altering your shape."/>
<spinner bottom_delta="-20" decimal_digits="5" follows="left|top" height="16" increment="0.05"
label="Y Modifier" label_width="65" left_delta="0" max_val="0.20" min_val="-0.20"
mouse_opaque="true" name="Y Modifier" width="128" control_name="AscentAvatarYModifier"
tool_tip="Use this to manipulate, to a degree, your avatar bounding box. This can be used to distort orbiters, or to raise you up or down without altering your shape."/>
<spinner bottom_delta="-20" decimal_digits="5" follows="left|top" height="16" increment="0.1"
label="Z Modifier" label_width="65" left_delta="0" max_val="5.0" min_val="-5.0"
mouse_opaque="true" name="Z Modifier" width="128" control_name="AscentAvatarZModifier"
tool_tip="Use this to manipulate, to a degree, your avatar bounding box. This can be used to distort orbiters, or to raise you up or down without altering your shape."/>
</panel>
</tab_container>
</panel>