I encoutered the following code lines in a Box 2d Project.
box2DWorld.Step(TIME_STEP, VELOCITY_ITERATIONS, POSITION_ITERATIONS);
Manual => Take a time step. This performs collision detection, integration, and constraint solution.
box2DWorld.ClearForces();
Manual => Call this after you are done with time steps to clear the forces. You normally call this after each call to Step, unless you are performing sub-steps.
I was able to read the manual, and got some hints ( written above), but still not fully able to understand what Step function is used for. And why is it necessary to call ClearForces just afterwards ?
Help appreciated
V.
box2DWorld.Step(TIME_STEP, VELOCITY_ITERATIONS, POSITION_ITERATIONS);
Manual => Take a time step. This performs collision detection, integration, and constraint solution.
box2DWorld.ClearForces();
Manual => Call this after you are done with time steps to clear the forces. You normally call this after each call to Step, unless you are performing sub-steps.
I was able to read the manual, and got some hints ( written above), but still not fully able to understand what Step function is used for. And why is it necessary to call ClearForces just afterwards ?
Help appreciated
V.