Please help me, making precise mouse dragging for Havok physics meshes

@jamessimo I’m using the exact same interaction in my app https://www.mokk.app/

You’re basically almost there, the only thing you’ll need to change: instead of moving the sphere directly by setting the position (which I assume is what the PointerDragBehaviour is doing) you need to apply an appropriate force to move it. The last playground in @carolhmj’s post has example code for this: Havok physics behaves unnatural when moving a box with a constraint - #13 by carolhmj (check the setPosition function)

I’m not sure if you can stop PointerDragBehaviour to modify the position of the sphere direclty. In case it’s not possible you can either use another sphere for the actual joint or implement your own pointer drag behaviour (this is what I did, don’t really recommend it for this case :sweat_smile: I think I did it because I wanted to have more control for some other parts).

1 Like