Box2D MouseJoint rotation issue

Hi all,

I’m stuck trying to figure out how to stop the shape in the movie below from rotating when dragging it with the mouse.

I understand that when box2d.registerGrabbing(); is set a mouseJoint is created whenever an object gets clicked.
I’ve been looking in the box2d documentation and its forum as well, and found several references to ‘angularVelocity’, but I find no such thing in b2MouseJoint.h in the add-on…

Is there a way to stop this rotation, especially the endless spinning that occurs at some times?

Hi Autofasurer,
I came across the same problem. Have you found the solution?

Hi Autofasurer,

Fortunately, I’ve found the solution.
All you have to do is to add this line:




Thanks for the tip. I tried that before, and then of course I couldn’t rotate anything.
Now I’ve turned it on/off at the right moment and it behaves as I want!

Thanks for having me re-examine the possibilities of SetFixedRotation :slight_smile: You made my day!