hi,
I'm trying to get gravity in a new simulation to resemble what it was in an old simulation. The problem is that the old simulation was written without regard for units, both simulations are running at different rates, and in general I'm a bit unclear about how to approach this sort of conversion.
The old simulation was run at 25ms/frame (40fps), and did this:
acc = 0.8; //this is in "pixels per frame" units
vel += acc;
pos += vel;
The new simulation runs at 16ms/frame (60fps), and does this:
acc = X; //this is in "pixels per second"
vel += acc*deltaT; //deltaT is 1/60
pos += vel;
(Both simulations are using a fixed timestep.)
Can anyone explain how I might go about determining the value of X above?
Or better, how might I to do the following (if such a thing is possible)?:
(a) convert gravity from a specific simulation into a "framerate agnostic" value
(b) convert a "framerate agnostic" value into an equivalent specific value for a given framerate
I feel like exp or log or something should have something to do with it, but instead of fumbling around I figured I'd defer to your better knowledge :)
thanks,
Raigan