1
General / Re: Box2D + SFML question
« on: December 22, 2013, 01:40:31 pm »Unless I am mistaken...world.Step(60.0f, 8, 3);
You need to measure the elapsed time for each frame and pass it to your world. Passing 60 seconds when maybe only 1/60th of a second has passed is totally wrong.
Ah of course. Thanks for noticing this. I really meant to type "1.0f / 60.0f" instead of just "60.0f". (And I will introduce variable time step later on.)
Anyway, I seem to have figured out the problem. It seems that in Box2D a body's origin is the center of the said body, while in SFML the origin is top left corner. Setting the origin of SFML shape to center of the shape seems to fix the gap problem.