pmndrs / use-cannon

👋💣 physics based hooks for @react-three/fiber

Home Page:https://cannon.pmnd.rs

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Dynamically update CompoundBody shapes

krispya opened this issue · comments

I am trying to dynamically update the useCompoundBody shape so that the bounding box changes without having to reinitialize the component. Here is a CodeSandbox example: https://codesandbox.io/s/dynamically-update-compoundbody-nkzu0?file=/src/App.js

I expect that when the shape state changes that all the CompoundBody components update to match. Am I wrong to expect this? And if so, is there a preferred way to update the bounding box dynamically?

This was the closest I could come up with: https://codesandbox.io/s/dynamically-update-compoundbody-v2-4k93f?file=/src/App.js

Note the rotation issues will be fixed with the latest PR.