pmndrs / use-cannon

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

R3F object's args aren't respected in useSphere #287

Closed CodyJasonBennett closed 3 years ago

CodyJasonBennett commented 3 years ago

useSphere will default to using default sphere construct args, and it seems that we cannot override this by explicitly passing args into the hook. Furthermore, this will work if you specify args: [n] but only where n >= 1.

Here's a recreation I picked up from the Discord from @andersonleite:

krispya commented 3 years ago

Might be related: https://github.com/pmndrs/use-cannon/issues/235

bjornstar commented 3 years ago

It seems this is a major point of confusion. I'll go ahead and change the args for useSphere to an array with a single entry.

andersonleite commented 3 years ago

Just to confirm, I updated to v4 and it works. https://codesandbox.io/s/u327l?file=/src/index.js

Thanks @bjornstar