Allow camera to go (almost) all the way up (179 degrees, cant do 180 or the camera wll freek out) and (almost) all the way down (down to 1 degree, cant look straight down for same reason), implements FIRE-2065

meow-7.2.2
Liny 2011-07-13 15:08:43 -07:00
parent f394597119
commit 3f5b8ee9da
1 changed files with 2 additions and 9 deletions

View File

@ -1062,18 +1062,11 @@ F32 LLAgent::clampPitchToLimits(F32 angle)
LLVector3 skyward = getReferenceUpVector();
F32 look_down_limit;
F32 look_up_limit = 10.f * DEG_TO_RAD;
F32 look_up_limit = 1.f * DEG_TO_RAD;
F32 angle_from_skyward = acos( mFrameAgent.getAtAxis() * skyward );
if (isAgentAvatarValid() && gAgentAvatarp->isSitting())
{
look_down_limit = 130.f * DEG_TO_RAD;
}
else
{
look_down_limit = 170.f * DEG_TO_RAD;
}
look_down_limit = 179.f * DEG_TO_RAD;
// clamp pitch to limits
if ((angle >= 0.f) && (angle_from_skyward + angle > look_down_limit))