1
0

Fixed normalizing large angles.

This commit is contained in:
madmaxoft
2013-12-08 13:08:56 +01:00
parent 044fd237b6
commit 6785bb7c16
4 changed files with 51 additions and 8 deletions

View File

@@ -158,8 +158,7 @@ bool cEntity::Initialize(cWorld * a_World)
void cEntity::WrapHeadYaw(void)
{
while (m_HeadYaw > 180.f) m_HeadYaw -= 360.f; // Wrap it
while (m_HeadYaw < -180.f) m_HeadYaw += 360.f;
m_HeadYaw = NormalizeAngleDegrees(m_HeadYaw);
}
@@ -168,10 +167,8 @@ void cEntity::WrapHeadYaw(void)
void cEntity::WrapRotation(void)
{
while (m_Rot.x > 180.f) m_Rot.x -= 360.f; // Wrap it
while (m_Rot.x < -180.f) m_Rot.x += 360.f;
while (m_Rot.y > 180.f) m_Rot.y -= 360.f;
while (m_Rot.y < -180.f) m_Rot.y += 360.f;
m_Rot.x = NormalizeAngleDegrees(m_Rot.x);
m_Rot.y = NormalizeAngleDegrees(m_Rot.z);
}