aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/newview/llagent.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'linden/indra/newview/llagent.cpp')
-rw-r--r--linden/indra/newview/llagent.cpp23
1 files changed, 2 insertions, 21 deletions
diff --git a/linden/indra/newview/llagent.cpp b/linden/indra/newview/llagent.cpp
index 09d65d1..54b71eb 100644
--- a/linden/indra/newview/llagent.cpp
+++ b/linden/indra/newview/llagent.cpp
@@ -1613,8 +1613,6 @@ BOOL LLAgent::calcCameraMinDistance(F32 &obj_min_distance)
1613 abs_target_offset.abs(); 1613 abs_target_offset.abs();
1614 1614
1615 LLVector3 target_offset_dir = target_offset_origin; 1615 LLVector3 target_offset_dir = target_offset_origin;
1616 F32 object_radius = mFocusObject->getVObjRadius();
1617
1618 BOOL target_outside_object_extents = FALSE; 1616 BOOL target_outside_object_extents = FALSE;
1619 1617
1620 for (U32 i = VX; i <= VZ; i++) 1618 for (U32 i = VX; i <= VZ; i++)
@@ -1708,18 +1706,6 @@ BOOL LLAgent::calcCameraMinDistance(F32 &obj_min_distance)
1708 1706
1709 LLVector3 camera_offset_object(getCameraPositionAgent() - mFocusObject->getPositionAgent()); 1707 LLVector3 camera_offset_object(getCameraPositionAgent() - mFocusObject->getPositionAgent());
1710 1708
1711 // length projected orthogonal to target offset
1712 F32 camera_offset_dist = (camera_offset_object - target_offset_dir * (camera_offset_object * target_offset_dir)).magVec();
1713
1714 // calculate whether the target point would be "visible" if it were outside the bounding box
1715 // on the opposite of the splitting plane defined by object_split_axis;
1716 BOOL exterior_target_visible = FALSE;
1717 if (camera_offset_dist > object_radius)
1718 {
1719 // target is visible from camera, so turn off fov zoom
1720 exterior_target_visible = TRUE;
1721 }
1722
1723 F32 camera_offset_clip = camera_offset_object * object_split_axis; 1709 F32 camera_offset_clip = camera_offset_object * object_split_axis;
1724 F32 target_offset_clip = target_offset_dir * object_split_axis; 1710 F32 target_offset_clip = target_offset_dir * object_split_axis;
1725 1711
@@ -2538,12 +2524,10 @@ void LLAgent::autoPilot(F32 *delta_yaw)
2538 *delta_yaw = yaw; 2524 *delta_yaw = yaw;
2539 2525
2540 // Compute when to start slowing down and when to stop 2526 // Compute when to start slowing down and when to stop
2541 F32 stop_distance = mAutoPilotStopDistance;
2542 F32 slow_distance; 2527 F32 slow_distance;
2543 if (getFlying()) 2528 if (getFlying())
2544 { 2529 {
2545 slow_distance = llmax(6.f, mAutoPilotStopDistance + 5.f); 2530 slow_distance = llmax(6.f, mAutoPilotStopDistance + 5.f);
2546 stop_distance = llmax(2.f, mAutoPilotStopDistance);
2547 } 2531 }
2548 else 2532 else
2549 { 2533 {
@@ -3719,7 +3703,6 @@ F32 LLAgent::calcCameraFOVZoomFactor()
3719 else if (mFocusObject.notNull() && !mFocusObject->isAvatar()) 3703 else if (mFocusObject.notNull() && !mFocusObject->isAvatar())
3720 { 3704 {
3721 // don't FOV zoom on mostly transparent objects 3705 // don't FOV zoom on mostly transparent objects
3722 LLVector3 focus_offset = mFocusObjectOffset;
3723 F32 obj_min_dist = 0.f; 3706 F32 obj_min_dist = 0.f;
3724 if (!gSavedSettings.getBOOL("DisableMinZoomDist")) 3707 if (!gSavedSettings.getBOOL("DisableMinZoomDist"))
3725 calcCameraMinDistance(obj_min_dist); 3708 calcCameraMinDistance(obj_min_dist);
@@ -3746,9 +3729,8 @@ LLVector3d LLAgent::calcCameraPositionTargetGlobal(BOOL *hit_limit)
3746 // Compute base camera position and look-at points. 3729 // Compute base camera position and look-at points.
3747 F32 camera_land_height; 3730 F32 camera_land_height;
3748 LLVector3d frame_center_global = mAvatarObject.isNull() ? getPositionGlobal() 3731 LLVector3d frame_center_global = mAvatarObject.isNull() ? getPositionGlobal()
3749 : getPosGlobalFromAgent(mAvatarObject->mRoot.getWorldPosition()); 3732 : getPosGlobalFromAgent(mAvatarObject->mRoot.getWorldPosition());
3750 3733
3751 LLVector3 upAxis = getUpAxis();
3752 BOOL isConstrained = FALSE; 3734 BOOL isConstrained = FALSE;
3753 LLVector3d head_offset; 3735 LLVector3d head_offset;
3754 head_offset.setVec(mThirdPersonHeadOffset); 3736 head_offset.setVec(mThirdPersonHeadOffset);
@@ -3883,7 +3865,6 @@ LLVector3d LLAgent::calcCameraPositionTargetGlobal(BOOL *hit_limit)
3883 // set the global camera position 3865 // set the global camera position
3884 LLVector3d camera_offset; 3866 LLVector3d camera_offset;
3885 3867
3886 LLVector3 av_pos = mAvatarObject.isNull() ? LLVector3::zero : mAvatarObject->getRenderPosition();
3887 camera_offset.setVec( local_camera_offset ); 3868 camera_offset.setVec( local_camera_offset );
3888 camera_position_global = frame_center_global + head_offset + camera_offset; 3869 camera_position_global = frame_center_global + head_offset + camera_offset;
3889 3870