planck.js icon indicating copy to clipboard operation
planck.js copied to clipboard

how to use mouseJoint without the testbed

Open bobcgausa opened this issue 4 years ago • 3 comments

I'm writing a p5 interface for planck and i don't use the testbed because i want p5 graphics. however i can't create a mouse joint in mousePressed

so i created a mousejoint statically

now what can i do in mousePressed to set the target body and location? any help appreciated

here's the example https://editor.p5js.org/Bobcook47/sketches/OlzHvRszI

i only want to drag the figure that i click

I already did a P5 box2d interface with a much more extensive tutorial than any that I found for planck https://github.com/bobcgausa/cook-js I plan to rewrite the tutorial for planck once i finish but i need HELP with modifying a mouse joint dynamically

bobcgausa avatar Apr 21 '21 01:04 bobcgausa

here's the p5 example https://editor.p5js.org/Bobcook47/sketches/OlzHvRszI

bobcgausa avatar Apr 21 '21 01:04 bobcgausa

Have you checked out testbed code? It is in testbed folder.

shakiba avatar Apr 21 '21 06:04 shakiba

Yes I looked at testbed codeI have to create mousejoint in setupThen in mousepressed I get body and need to reset body a and b.As code shows, it didn't workTestbed doesn't work that wayOn Apr 21, 2021 2:34 AM, Ali Shakiba @.***> wrote: Have you checked out testbed code? It is in testbed folder.

—You are receiving this because you authored the thread.Reply to this email directly, view it on GitHub, or unsubscribe.

bobcgausa avatar Apr 21 '21 12:04 bobcgausa