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

main/yubo-dev
Nuno 3 years ago
commit ba7123b519

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