Hello, i'm using the latest version of jbox2d and i'm having this problem:
using:
physicWorld.step(TIMESTEP, 10);
for > 1 times give different results from:
physicWorld.step(TIMESTEP*step, 10*step);
where step is the number of step. Why this is happening?
Why do you expect the results to be the same? In any nontrival simulation, it is going to differ. Even a single point mass in freefall will exhibit framerate dependent behavior.
The reason is that it is in general impossible to simulate with perfect accuracy, so approximations have to be made. When you set the timestep, you're basically telling Box2d how big of an error you are willing to tolerate. The bigger the timestep, the bigger the error.
i was sure timestep is the time of iteration to calculate, and the second number the depth (precision of collision) to use. the problem is that the difference in + o - 100 step are really big (many low step = body softly torque, one big step = body is like a washer)...
Well if i can't use one big step, how can I speed up like 100 step in one time? there are some trick or just optimize jbox2d code?
love'n'rock