Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Why are the boxes always made of jelly in these physics simulations? Stacks/walls of boxes in real life are never that jiggly.


Sometimes it's just wrong parameters (e.g. too low density, too low gravity, ...), but the 'jelly-like' behaviour may also help to keep the simulation stable (sometimes in games you can see the physics simulation explode, e.g. stuff being catapulted with near-infinite speed into space, putting some dampening into the simulation and allowing some 'slack' for resolving object intersections can help to avoid that, but also makes everything feel more jelly-like).


It's due to using a Gauss–Seidel solver which iteratively solves each constraint rather than a global solver that solves all the constraints at once. The reason to use the iterative approach is that global solvers can end up with unbounded runtime or without a solution in some cases. The downside is that some constraints are left unsatisfied after you've run through your fixed set of iterations so it takes time to converge. With big stacks you have a lot of constraints and it can take even more time to converge as errors propagate energy through the stack. You can solve this as a sub-problem by itself and maybe the 'large islands' work will tackle that.

TLDR; with iterative methods stiffness of things depends on the physics timestep size and number of iterations of constraint solving.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: