1
0

Simplified speed clamping.

This commit is contained in:
madmaxoft 2014-06-14 18:16:10 +02:00
parent 3f009a7c9e
commit a89422ea4c

View File

@ -179,14 +179,9 @@ void cEntity::WrapRotation(void)
void cEntity::WrapSpeed(void) void cEntity::WrapSpeed(void)
{ {
// There shoudn't be a need for flipping the flag on because this function is called m_Speed.x = Clamp(m_Speed.x, -78.0, 78.0);
// after any update, so the flag is already turned on m_Speed.y = Clamp(m_Speed.y, -78.0, 78.0);
if (m_Speed.x > 78.0f) m_Speed.x = 78.0f; m_Speed.z = Clamp(m_Speed.z, -78.0, 78.0);
else if (m_Speed.x < -78.0f) m_Speed.x = -78.0f;
if (m_Speed.y > 78.0f) m_Speed.y = 78.0f;
else if (m_Speed.y < -78.0f) m_Speed.y = -78.0f;
if (m_Speed.z > 78.0f) m_Speed.z = 78.0f;
else if (m_Speed.z < -78.0f) m_Speed.z = -78.0f;
} }