pmndrs / use-cannon

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

feat: add useMaterial and useContactMaterial #297

Closed alexandernanberg closed 2 years ago

alexandernanberg commented 2 years ago

Closes #64

Uses parts of #122

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/52PNmAA3LzxmtLY1stuqWSKSCEyT
✅ Preview: https://use-cannon-git-fork-alexandernanberg-add-material-pmndrs.vercel.app

hazem3500 commented 2 years ago

Will this PR be merged soon 😁?

bjornstar commented 2 years ago

I appreciate you trying to revive a recently closed PR, but it had some fundamental issues that are still not resolved here. The primary problem is that we never use Cannon on the client side and only use it in the Worker. We synchronize properties between the two and track individual entities using GUIDs.

Implementing useContactMaterial will require tracking GUIDs of the materials.

alexandernanberg commented 2 years ago

Unfortunately I won't have to to continue this in the near future, might pick it up again at some point but closing for now

Glavin001 commented 2 years ago

I have an open PR adding ContactMaterial support and a Friction example: https://github.com/pmndrs/use-cannon/pull/316 Would appreciate any code reviews!

Edit: New PR: https://github.com/pmndrs/use-cannon/pull/317