Forums > Jitter

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

June 19, 2013 | 9:58 am

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

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.

<code>

– Pasted Max Patch, click to expand. –

</code>

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


June 19, 2013 | 11:48 am

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 30×30 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.


June 19, 2013 | 11:58 am

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.

<code>

– Pasted Max Patch, click to expand. –

</code>


June 21, 2013 | 4:48 am

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


Viewing 4 posts - 1 through 4 (of 4 total)