pmndrs / use-cannon

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

Worker has no handler for setMaterial op #339

Closed isaac-mason closed 2 years ago

isaac-mason commented 2 years ago

While working on a PR for #327, I noticed that the material atomic prop has an API generated for it, but as far as I can see there is no worker handler for a setMaterial op.

Here's a quick thrown together example - one cube has its material set on creation in it's body props, another tries to set it in an effect. https://codesandbox.io/s/missing-setmaterial-op-repro-3bhes?file=/src/index.js

Is this just a miss? I take it this API wouldn't be used often.

I'm happy to create a PR to add the missing handler to the worker if it's something we want to add 🙂

bjornstar commented 2 years ago

If it's something you want to use, go for it.

isaac-mason commented 2 years ago

Sure, created a quick PR for this now: https://github.com/pmndrs/use-cannon/pull/340