For smoother ship movement, I am going to gradually move it to it's actual location - So like this:
(mz - sz) / (10 * (60 / TerrainDemo.FPS))
mz is the ship's actual location on the Z axis - And I divide it by 10, and obviously at the end I account for the FPS.
However, on seemingly random occasions, this is returning NaN.
How can I fix this to not return NaN?
This expression gives
NaNin each one of the following cases:In addition to that, if the value of any of these variables is
NaNto begin with, then so will be the value of the entire expression.