2
\$\begingroup\$

I want to move my bodies at higher speeds, but they have a top speed.

I have an Ortoghraphic camera defined at 800x480. My world doesnt have gravity. I apply an impulse of 1000,and a force of 1000 too.

But the speed always is at the same value, it doesnt have more.

How do i add more speed to my body (its a dynamic body).

\$\endgroup\$

1 Answer 1

5
\$\begingroup\$

Box2D has a hard-coded movement cap of 2 meters per tick. So if you are updating at 60Hz then you max speed is 120m/s or 432km/h.

You can either go into the source code and change this cap or you can adjust your pixel to meter ratio to allow for greater speeds. For example if 16pixels = 1meter and you are running at 60Hz then your max speed is slightly less than 2000pixels/second.

Because you are running into this problem I am assuming you are using 1pixel=1meter which will cause you further problems in the future.

\$\endgroup\$
1
  • \$\begingroup\$ You were right, I change my viewport 10 times less than my actual size, and the speed now vary, thanks \$\endgroup\$
    – Rudy_TM
    Commented Feb 22, 2012 at 18:14

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .