Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to create a basic mouse constraint? #16

Open
bmandeberg opened this issue May 15, 2023 · 0 comments
Open

How to create a basic mouse constraint? #16

bmandeberg opened this issue May 15, 2023 · 0 comments

Comments

@bmandeberg
Copy link

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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant