Is there an upper limit on velocity when using box2d?

前端 未结 2 856
我在风中等你
我在风中等你 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:25

    Yes, there is a difference between which size do you use. Box2d operates over floating point numbers and thus it's precision is limited and simulation quality differs. Box2d is tuned to work best with dynamic bodies of size 0.1 to 10.

    So generally you should prefer to use one units for physics and other for graphics

    Now to your question. Body's velocity is affected by collisions, friction (if one body is sliding over the other) and by linear damping. So check what value for linear damping do you use (it's non-zero by default as I remember). There are no velocity limitations, as far as I know, but higher velocity will provide less quality collisions if using the same time step.

提交回复
热议问题