Concave phys bodies containing small phys objects....Why do they fall through?

cwilliams87's icon

Hi, I'm just wondering if someone can help me with this particular jitter problem.

Max Patch
Copy patch and select New From Clipboard in Max.

The patch I've created displays a rigid sphere inside a larger (mesh) sphere.
The problem I'm having is that when the size of the 'small ball' is decreased below about 0.8 it falls through the rigid body.

I want to use multiple 'particles' in a further patcher but they will need to be very small.
Is there a way in which I can adapt the concave shape to not let small spheres through?

Thanks
Chris

Rob Ramirez's icon

couple things.
you should increase your qmetro speed, so that it matches the internal-timestep of your phys.world (defaults to 60hz, so if you set your qmetro to something close to that, 16 or so). otherwise increase your maxsubsteps.

when i increased the dim attribute of the concave-body gridshape to 60 60, there was no longer any fall-through. you probably also want to set @automatic 0 on that gridshape, so that it does not constantly send out matrices every draw-frame, but only when you bang it. if you prefer the visual appearance of a 30x30 grid, simply downsample the matrix before sending to the mesh, or create another gridshape at those dims.

if you're still having issues, you can try increasing the default phys.world timestep, which increases the simulation resolution, at the cost of cpu cycles. you will also want to increase the maxsubsteps.

lastly, concave shapes will never be very efficient, so a better way might be to create a bowl shape out of several flattened phys.body @shape cube. javascript would be useful in this case.

Rob Ramirez's icon
Max Patch
Copy patch and select New From Clipboard in Max.

here's what i'm referring to when i say create out of simple shapes.
obviously, you could break this down further, and even use jit.phys.multiple instead.

cwilliams87's icon

Thank you so much for your help Rob although I am still having issues when using concave shapes.

I think your advice regarding constructing a shape using planes will be a good idea so I'll have to try that.

Thanks again