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

Loading…
Cancel
Save