Adde default value to _HeadPitch. Change bounds

main/atys-pre-live
Nuno 3 years ago
parent aa34e88101
commit 35a7a6628b

@ -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;
@ -2553,8 +2553,8 @@ 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