Merge branch '29-fix-camera-vertical-rotation-prevent-see-under-the-char' into 'main/gingo-test'

Resolve "Fix camera vertical rotation (prevent see under the char)"

See merge request ryzom/ryzom-core!27
merge-requests/26/merge
Nuno Gonçalves (Ulukyn) 3 years ago
commit 7f01b21d11

@ -186,7 +186,7 @@ CUserEntity::CUserEntity()
_MoveToAction= CUserEntity::None; _MoveToAction= CUserEntity::None;
_MoveToDist= 0.0; _MoveToDist= 0.0;
_MoveToColStartTime= 0; _MoveToColStartTime= 0;
_HeadPitch = Pi/2;
_FollowForceHeadPitch= false; _FollowForceHeadPitch= false;
_ForceLookSlot= CLFECOMMON::INVALID_SLOT; _ForceLookSlot= CLFECOMMON::INVALID_SLOT;
@ -2552,9 +2552,9 @@ void CUserEntity::rotHeadVertically(float ang)
//----------------------------------------------- //-----------------------------------------------
void CUserEntity::setHeadPitch(double hp) void CUserEntity::setHeadPitch(double hp)
{ {
_HeadPitch= hp; _HeadPitch = hp;
const double bound= Pi/2 - 0.01; // epsilon to avoid gimbal lock // epsilon to avoid gimbal lock
clamp(_HeadPitch, -bound, bound); clamp(_HeadPitch, -Pi/2 + 0.01, Pi/2 - 0.5);
} }
//--------------------------------------------------- //---------------------------------------------------

Loading…
Cancel
Save