#4472 Permit going below ground if camera isn't constrained

Basically a revert of SL-20206, 25388312cf
master
Andrey Kleshchev 2025-08-08 20:08:57 +03:00 committed by Andrey Kleshchev
parent 1f441b1158
commit 0dc10ad3d8
1 changed files with 5 additions and 5 deletions

View File

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