Realistic physics for small items

Hi,

I have a series of small items commonly found in casinos (marbles, dice, chips, etc.) that I would like to have behave somewhat realistically. But I’ve noticed that realistic sized chips (4cm across) tend to fall through the table. If I make everything gigantic, it works great, but the physics is off, because the chips fall from a distance of meters, not centimeters, etc.

Before I get too far into tweaking things, I’m curious–what’s the right way to tackle this? Increase gravity? Decrease the Min Penetration for Penalty? Some other thing?

Thanks!
-Chilton

Use continuous collision detection
Don’t use mesh colliders
Use shorter fixed update interval (test for collisions more often)
Generally the minimum penetration setting should be as small as possible without causing jittering.
Having a higher iteration count also stops jitter in stacked objects.

Play with the settings till you get a balance of performance and physics accuracy.

Hi Spinaljack,

Thanks for your reply!
I think this confirms what I suspected, which is that my time might be better spent just scripting the behaviors I want. That’s fine, I just needed to know before I spent too much time flipping switches.

I’m not using mesh colliders, only box colliders.
I decreased the fixed update interval to .01, but this pegs my CPU at 85%, up from around 70% (at idle, which IMO is incredibly high already).
Min penetration is now 1e-09, which works, but still seems odd.
I’m not seeing any jitter, so that’s good.

I’m mostly concerned about lower end systems being able to see the chips fall properly. But this is a waste of CPU cycles, even at idle ( that means battery for us laptop junkies). Unless I find a better solution, I think I’ll forgo using the physics engine entirely, and just script it.

Thanks!
-Chilton

For small objects, increasing the physics framerate isn’t really enough.

Say your poker chip is one inch in diameter (and considerably smaller along the Y axis!). Beyond the object traveling past a collider in a single frame and a collision not being detected, you run into floating point precision issues. An inch is 0.0254 meters. So the physics engine trying to calculate such a small penetration becomes highly inaccurate.

The result of these two situations is why an tiny scaled object dropped on a table tends to fall right through it.

In order for collisions and physics to work properly you need to scale your objects up and adjust gravity accordingly.

Quietus, that’s exactly what I ended up doing. So far it appears to be working well.

I didn’t get far scripting. When I realized I wanted the chips to all collide with each other and bounce around as they’re moved, it occurred to me that there’s a limit to how much scripting I’ll do in one sitting :wink:

Thanks, both of ye!
-Chilton