Hi, I'm trying to create a basic mouse joint so that I can drag objects, similar to this p2 example.
I've had a bit of success with useRevoluteConstraint, but it seems that enable() and disable() aren't actually available in the ConstraintApi returned from the revolute constraint (only seeing motor functions), so I'm unable to disable the constraint while not dragging the mouse. Also, it only really works if I set a different collisionGroup on the mouse body, but then this messes up the collisions on the target body while dragging it. Sleeping/waking the mouse body doesn't seem to help.
Any advice for creating a basic mouse constraint in use-p2 would be greatly appreciated!
Hi, I'm trying to create a basic mouse joint so that I can drag objects, similar to this p2 example.
I've had a bit of success with
useRevoluteConstraint
, but it seems thatenable()
anddisable()
aren't actually available in theConstraintApi
returned from the revolute constraint (only seeing motor functions), so I'm unable to disable the constraint while not dragging the mouse. Also, it only really works if I set a differentcollisionGroup
on the mouse body, but then this messes up the collisions on the target body while dragging it. Sleeping/waking the mouse body doesn't seem to help.Any advice for creating a basic mouse constraint in use-p2 would be greatly appreciated!