pmndrs / use-cannon

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

CCD / Continous Collision Detection Enable #391

Closed yyynnn closed 2 years ago

yyynnn commented 2 years ago

How to enable ccd on bodies? Or this feature is not wired yet? https://github.com/pmndrs/cannon-es/issues/93

yyynnn commented 2 years ago

is there a ways use cannonjs directly around and with use-cannon?

isaac-mason commented 2 years ago

Cannon doesn't support CCD right now.

Someone created a WIP implementation for CCD on the original repo, but afaik this hasn't been picked up again.

isaac-mason commented 2 years ago

Regarding using cannon directly, because @react-three/cannon runs cannon in a web worker, all objects are created in the web worker and can't be interfaced with directly.

If you find yourself needing to add your own scripts or use other cannon libraries, you may be better off not using @react-three/cannon but using cannon directly.

See this comment for what that might look like: https://github.com/pmndrs/use-cannon/issues/63#issuecomment-609457998


You can track that issue to follow CCD support being added to cannon-es (https://github.com/pmndrs/cannon-es/issues/93)

If/when CCD is added, @react-three/cannon can be updated to support it.

In the meantime, I think it makes sense to close this issue.

If you're looking for help with anything else, check out our discord! 🙂

https://discord.gg/poimandres