pmndrs / use-cannon

👋💣 physics based hooks for @react-three/fiber
https://cannon.pmnd.rs
2.76k stars 155 forks source link

Create API layer between hooks and cannon web worker #343

Closed isaac-mason closed 2 years ago

isaac-mason commented 2 years ago
vercel[bot] commented 2 years ago

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/pmndrs/use-cannon/Ev4hdUedpSPXZfunE2P2YP3FfrZg
✅ Preview: https://use-cannon-git-fork-isaac-mason-worker-api-pmndrs.vercel.app

bjornstar commented 2 years ago

I'm actually ok with everything and moving forward from here. Does it seem like a usable api for the worker?

isaac-mason commented 2 years ago

Great! Thanks for taking a look.

I think the worker API as it is now is largely good for building out the non-react package. There are a couple of things we may want to add/change as we go. One thing that comes to mind is - if we're building the other package to mirror cannon-es syntax/usage as we discussed in the issue, we may add addShape and removeShape worker ops for bodies?

But it's probably best to look at making those changes in small chunks as we build out that package.

For now, wrapping the current worker as-is sounds good to me 🙂

I'll update the PR to address your comments & rebase shortly.

isaac-mason commented 2 years ago

@bjornstar I've rebased now & addressed your comments!