-
Notifications
You must be signed in to change notification settings - Fork 191
Open
Description
Many users that are not experienced with physics engines will believe that the best design is to pass in the frame time (the actual time that passed since the last time step was called) as dt in space.step(dt). However, in Pymunk (and others) its much better if the dt value used is stable, a fixed value. With a stable dt it will be easier for the engine to create a realistic and stable simulation.
However, as of Pymunk 6.x the API of Pymunk does not make this clear, the user should pass in a dt value every time step(dt) is called, and can easy get the impression that it is good if it changes according to actual time passed.
I have two ideas:
- Add a default for
dtof 1/60.0:def step(self, dt=1/60.0). Minimal changes to the API, should help the user a bit. - Move the
dtvalue to a property on theSpace. So you dospace = pymunk.Space(dt=1/60), or later `space.dt = 1/60), just like how you deal with gravity.
Metadata
Metadata
Assignees
Labels
No labels