pmndrs / use-cannon

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

Add support for frictionGravity #402

Closed chnicoloso closed 1 year ago

chnicoloso commented 1 year ago

Howdy - updating the worker api to enable setting the world's frictionGravity. This is a new property that was just added to cannon-es (https://github.com/pmndrs/cannon-es/pull/156) to address https://github.com/schteppe/cannon.js/issues/224 and allow friction to be optionally applied to worlds without gravity.

vercel[bot] commented 1 year ago

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated
use-cannon ✅ Ready (Inspect) Visit Preview Aug 17, 2022 at 9:36PM (UTC)
chnicoloso commented 1 year ago

Hi @isaac-mason, can I borrow your eagle eyes for another small one? 😄 Otherwise, hi @bjornstar you also come up as a recent collaborator 👀

Glavin001 commented 1 year ago

@chnicoloso out of curiosity, is the demo you shared open-source (and using react-xr)? Look interesting, would love to take a look!

Before After
ezgif com-gif-maker (1) ezgif com-gif-maker
chnicoloso commented 1 year ago

@Glavin001 thanks for the interest! I am not using react-xr. I don't have anything up yet but I'll let you know when I do!

bjornstar commented 1 year ago

This looks good, just some minor stylistic issues from my side and we should be good to go.

chnicoloso commented 1 year ago

Thank you @bjornstar! Updated

bjornstar commented 1 year ago

I ended up using null internally instead of undefined, it made things much more straight-forward.