Use epsilon comparison

This commit is contained in:
David Markowitz 2023-04-11 22:25:02 -07:00
parent 47445ada54
commit 308d56968a

View File

@ -312,7 +312,9 @@ foundComponent:
if (physicsComponent) speed = physicsComponent->speed; if (physicsComponent) speed = physicsComponent->speed;
if (speed == -1.0f) speed = 10.0f; float delta = fabs(speed) - 1.0f;
if (delta <= std::numeric_limits<float>::epsilon()) speed = 10.0f;
m_PhysicsSpeedCache[lot] = speed; m_PhysicsSpeedCache[lot] = speed;