SL-20206 Underwater visuals problematic when camera is swung below Z=0

master
Alexander Gavriliuk 2023-09-05 13:19:10 +02:00 committed by Guru
parent 512d450fe3
commit 25388312cf
1 changed files with 10 additions and 4 deletions

View File

@ -1996,15 +1996,21 @@ 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);
if (camera_position_global.mdV[VZ] < camera_land_height + camera_min_off_ground)
F32 minZ = llmax(F_ALMOST_ZERO, camera_land_height + camera_min_off_ground);
if (camera_position_global.mdV[VZ] < minZ)
{
camera_position_global.mdV[VZ] = camera_land_height + camera_min_off_ground;
camera_position_global.mdV[VZ] = minZ;
isConstrained = TRUE;
}
// Don't let camera go abovesky
F32 maxZ = LLWorld::getInstance()->getRegionMaxHeight() * 0.25 - F_ALMOST_ZERO;
if (camera_position_global.mdV[VZ] > maxZ)
{
camera_position_global.mdV[VZ] = maxZ;
isConstrained = TRUE;
}
if (hit_limit)
{