2 Answers
2

When a force is applied, it is merely set as some state indicating that the force was applied. The actual movement does not yet happen. The physics engine needs to integrate the physics with a time step, do collision checks, and then resolve those collisions (which can apply more impulses to the objects, causing them to move in other ways), and it does this a few to try to get the physics simulation to stabilize as best as possible.

Short version: physics engines don't apply forces immediately, they integrate them in whole when the simulation is advanced.

In Box2D, this is done with the Step method on the World object. (I'm assuming the class and methods names in jbox2d are identical or very similar to those in the main C++ Box2D.)

Thanks, but, I actually tried integrating the step and that didn't help either, but maybe I did it wrong. See update...
–
JackieDec 30 '12 at 13:24

1

In your sample, you're applying the force after stepping the simulation. So you get the position with no force applied, step (which will have no effect, as no force is applied), apply a force, then get the position (which will not yet be affected by the force), so both positions will be equal to each other.
–
Sean MiddleditchDec 31 '12 at 1:17

Ok I added it afterwards and I still get the same response... Updating update :-) Also I included the intervals in case those are off. I was wondering if it has anything todo with the way I am getting the position or something.
–
JackieDec 31 '12 at 3:08