summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrey Kleshchev <andreykproductengine@lindenlab.com>2025-08-08 20:08:57 +0300
committerAndrey Kleshchev <117672381+akleshchev@users.noreply.github.com>2025-08-08 21:15:57 +0300
commit0dc10ad3d8ac898058d46882f2b29b1603ecbc35 (patch)
tree3dbef52d7a5263b57624b20a351e42590fed28b7
parent1f441b11586f8e4ab8e1d034fd69ceb59432b1d4 (diff)
#4472 Permit going below ground if camera isn't constrained
Basically a revert of SL-20206, 25388312cf28f8b30934ac3885783a96a3b2ed69
-rw-r--r--indra/newview/llagentcamera.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/indra/newview/llagentcamera.cpp b/indra/newview/llagentcamera.cpp
index d4767e18af..86909b6989 100644
--- a/indra/newview/llagentcamera.cpp
+++ b/indra/newview/llagentcamera.cpp
@@ -1753,7 +1753,6 @@ F32 LLAgentCamera::calcCameraFOVZoomFactor()
LLVector3d LLAgentCamera::calcCameraPositionTargetGlobal(bool *hit_limit)
{
// Compute base camera position and look-at points.
- F32 camera_land_height;
LLVector3d frame_center_global = !isAgentAvatarValid() ?
gAgent.getPositionGlobal() :
gAgent.getPosGlobalFromAgent(getAvatarRootPosition());
@@ -1990,10 +1989,11 @@ LLVector3d LLAgentCamera::calcCameraPositionTargetGlobal(bool *hit_limit)
}
}
- // Don't let camera go underground
- F32 camera_min_off_ground = getCameraMinOffGround();
- camera_land_height = LLWorld::getInstance()->resolveLandHeightGlobal(camera_position_global);
- F32 minZ = llmax(F_ALMOST_ZERO, camera_land_height + camera_min_off_ground);
+ // Don't let camera go underground if constrained
+ // If not constrained, permit going 1000m below 0, use case: retrieving objects
+ F32 camera_min_off_ground = getCameraMinOffGround(); // checks isDisableCameraConstraints
+ F32 camera_land_height = LLWorld::getInstance()->resolveLandHeightGlobal(camera_position_global);
+ F32 minZ = camera_land_height + camera_min_off_ground;
if (camera_position_global.mdV[VZ] < minZ)
{
camera_position_global.mdV[VZ] = minZ;