How to make box2d mouse joint works similar to box2d setposition

810 Views Asked by At

I want to make b2mouse joint working similar to b2setposition, though i know in mouse joint force is applied, so it's not possible to reach the desired point without any delay like setPosition(), but i want to make it works as close as b2setPosition(). So on which mousejoint/body properties should i work on so that it acts as close as b2setposition.

Thanks for your answer.

1

There are 1 best solutions below

1
On

According to the Box2D API Reference on b2MouseJoint:

NOTE: this joint is not documented in the manual because it was developed to be used in the testbed. If you want to learn how to use the mouse joint, look at the testbed.

There's no "b2setposition". There's b2Position which is an internal class, or you meant b2Body->SetTransform() which sets the position of a body.

If you could explain better what you're trying to do and why it has to be a b2Mouse joint, I might be able to help more.