Code: Select all
Space.Update((float)gameTime.ElapsedGameTime.TotalMilliseconds);
Code: Select all
Space.Update((float)gameTime.ElapsedGameTime.TotalMilliseconds);
It will accumulate 1/120f worth of time. If the accumulated time is greater than 1/60f, it will perform a time step. The remainder at the end of any frame is used to compute interpolated states for smooth movement if the interpolated states buffer is enabled.What happens if my timestep is 1/60 but I pass a dt of 1/120?
That is passing in milliseconds instead of seconds. That means the physics are being told to advance at 1000x real time. The Space.TimeStepSettings.MaximumTimeStepsPerFrame defaults to 3, though, so it only takes 3 time steps instead of hundreds. Since the clamp is so low compared to the target number, the physics appear to be framerate dependent.Space.Update((float)gameTime.ElapsedGameTime.TotalMilliseconds);
Code: Select all
Spazio.Update(gameTime.ElapsedGameTime.Milliseconds);
Code: Select all
TargetElapsedTime = new TimeSpan(TimeSpan.TicksPerSecond / 60);
Mass and inertia can be left unchanged, but all time dependent values do indeed require scaling. For example, if the game was effectively running at 3x speed before, gravity and other forces will have to be scaled up by 3 to keep the same apparent behavior.So i suppose i must to modifi all the forces and inertias... Would you mind to suggest me the right way to fix this apocalipticist situation, without implement some others 'BigDummyBug'
Code: Select all
Spazio.TimeStepSettings.TimeStepDuration =1f/60
Code: Select all
Spazio.TimeStepSettings.TimeStepDuration =1f/Main1.mApplicazione.TIME.FpS;