How can build out physical torus, such as basketry, the ball can pass in the middle or collide with it

How can build out physical torus, such as basketry, the ball can pass in the middle or collide with it.

There are some examples with physics. Maybe they’ll give you a clue:
https://threejs.org/examples/?q=physics#webgl_physics_terrain

I’m not sure but it seems that ammo.js does not provide a torus collision shape. That might be a problem for @duanleon if he is going to work with this physic engine.

We have Physijs :slight_smile:

I think I would not use a physic engine at all but develop a more simple approximation like in this example:

https://threejs.org/examples/webvr_daydream.html

The code does not illustrate a collision detection between a torus and a sphere but the idea to work with velocity in order to simulate movement and collision. Check out the implementation of the render function.

Thank you very much, @Mugen87 and @prisoner849. From your comments, I understand:

  1. physic engine cannot support torusMesh;
  2. There are two potential solutions: one is velocity and another one is concave shape decomposition algorithm. I will research these two topics and try to find out solution.
    Will be back once I get solution.
    Thanks again!

Finally, I use many physical Cylinder to simulate the torus, it works, although not very perfect…
Thanks for your help again!

1 Like