pmndrs / use-cannon

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

Some edge cases in which Sphere + Box collision detection seems to fail #123

Closed patreeceeo closed 3 years ago

patreeceeo commented 3 years ago

Made a sandbox that reproduces one of the edge cases:

https://codesandbox.io/s/bitter-bird-ooxd3?file=/src/App.js

It creates an elongated box and a sphere with a velocity vector pointing towards the long side of the box at an oblique angle. The ball rolls along the ground and when it reaches the elongated box it passes through.

This seems to only happen in specific cases. For instance, it seems to not happen if:

patreeceeo commented 3 years ago

I know it's quite an edge case, but any thoughts here?

patreeceeo commented 3 years ago

Never mind, I realized that I wasn't passing args to useBox so Cannon was using a 1x1x1 box.