behdad / box2d

Automatically exported from code.google.com/p/box2d
2 stars 12 forks source link

Impossible to implement Glenn Fiedler's "fix your timestep" #37

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
As forces are reseted after returning from b2World::Step(), and there is no
way to backup and restore them, is impossible to implement the Glenn
Fiedler's technique "fix your timestep" (used also by Bullet).

The technique allows to use a fixed time step with the physics system
(maintaining a good numerical stability) while having a variable frame-rate
game, keeping the physics in sync with the real clock.

Proposed solutions:
- Add accessors to b2Body to backup and restore applied forces.
- Modify b2World::Step() with a flag to know if it have to reset applied
forces. This allows to perform minor physics logic (as controllers) between
subsequent calls to Step() (in the same game tick).

Some other details in
http://www.box2d.org/forum/viewtopic.php?f=4&t=3973&start=0 .

Original issue reported on code.google.com by daniele.benegiamo@gmail.com on 19 Nov 2009 at 12:47

GoogleCodeExporter commented 9 years ago

Original comment by erinca...@gmail.com on 20 Nov 2009 at 8:25

GoogleCodeExporter commented 9 years ago
Implement flag in b2World::Step.

Original comment by erinca...@gmail.com on 20 Nov 2009 at 8:31