private void ClampRotation()
{
if (Pitch >= Math.PI)
{
Pitch = Math.PI;
}
else if (Pitch <= -Math.PI)
{
Pitch = -Math.PI;
}
if (Yaw >= MathHelper.TwoPi)
{
Yaw -= MathHelper.TwoPi;
}
else if (Yaw <= -MathHelper.TwoPi)
{
Yaw += MathHelper.TwoPi;
}
}