I'm building some stuff with Qt and Box2D. I just follow the Hello Box2D
with some of my customization, here is the screen:
The application hase the timer, each time the timer tick , I call world->Step(B2_TIMESTEP, B2_VELOCITY_ITERATIONS, B2_POSITION_ITERATIONS);
static const float32 B2_TIMESTEP = 1.0f / 60.0f;
static const int B2_VELOCITY_ITERATIONS = 8;
static const int B2_POSITION_ITERATIONS = 3;
static const int TIMER_INTERVAL = 16;//in milisecon
I get some trouble with set the value for TIMER_INTERVAL and B2_TIMESTEP.
About: B2_TIMESTEP, if I increase it let say 1000 times the movement of the green-box is different. When B2_TIMESTEP = 1.0f / 60.0f
the small box jump out of the second ground-box, and when B2_TIMESTEP = 1000.0f / 60.0f
the green-box land on the second ground-box. Why?
I think TIMER_INTERVAL around 16-20 is ok, right?
Thanks for your time.