Is there an upper limit on velocity when using box2d?

前端 未结 2 861
我在风中等你
我在风中等你 2020-12-20 13:25

I\'m using box2d for physics simulation. I\'m moving a circle using arrow keys by applying impulse on the body when ever a key is pressed. Unfortunately, the circle moves ex

2条回答
  •  温柔的废话
    2020-12-20 14:01

    It took me pretty long to understand that now, but there actually really IS a hard limit on velocity in Box2D. See here:

    There is a maximum movement limit of 2.0 units per time step, given in the file b2Settings.h in the source code.

    If you have one step per frame at 60FPS, then your bodies can move at a maximum speed of 120m/s. Maybe this will save somebody a bit of time one day.

提交回复
热议问题