I was just wondering, when simulating physics is it usually a good idea to get the time delta from the last frame and apply the relevant motion equations?
Something like:
void simulate(float dt)
{
vel += (force / m) * dt;
}
In this case wouldn't there be an accumulated error over time due to precision? For example when trying to simulate a circular motion?
Or would it be better to get the entire elapsed time from the beginning, and then apply the motion:
void simulate(float elapsedTime)
{
vel = vel0 + (force/m)*elapsedTime;
}
And since this doesn't depend on the previous simulate() steps, it's less likely to cause precision errors?
Thanks!