0

Let's consider a platform-based structured imported as an external mesh in Three.js, and a rigid body we would like to evolve on this structure.

My current understanding is that any object we want to apply physics on has to be approximated by one or several convex hulls which will be used for the physics computations (eg. collisions).

Considering the platform-based structure, let's assume these are only parallelepipeds, so creating Ammo shapes around them is trivial. Hence, creating the whole world physics is just a matter of iterating over the objects and creating as many Ammo.btBoxShape.

But now, suppose we want to add a hollow on of the platforms (or for instance a pothole on a road). What would be the recommended approach to make the physics world include these hollows?

Should a custom Ammo shape be built? Considering the expected result, it can't be a preposterous need, but it seems I'm lacking beginner skills in this domain because I can't find any hint about how to do this...

So any help will be greatly appreciated!

Zim
  • 1,457
  • 1
  • 10
  • 21
  • 1
    I think you may want a heightfield shape for the terrain, see http://kripken.github.io/ammo.js/examples/webgl_demo_terrain/index.html. Mesh-mesh collision on concave shapes is very slow, and Bullet / AmmoJS don't support it. I would avoid trying to re-implement that yourself, but use existing convex shapes or compound combinations of shapes. – Don McCurdy Nov 26 '18 at 23:11
  • 1
    Related: https://stackoverflow.com/questions/39441459/rigid-body-shape-in-bullet-ammo-js-from-a-mesh-in-three-js – Don McCurdy Nov 26 '18 at 23:12

0 Answers0