Hacker News new | past | comments | ask | show | jobs | submit login

This is brilliant work and I think their soft-body model is pretty simple and understandable why it "works":

> The basic principles in short: TPE uses soft body physics, bodies are modelled as spheres connected by springs but the springs can be made stiff so that the bodies behave almost like rigid bodies, so you can simulate (fake) both soft and rigid physics. Environment in which bodies are placed is modelled by distance functions, i.e. you can in theory create any environment as long as you can create a function that for any point in space returns the closest point to the environment (functions for basic and some more complex shapes are included in TPE).

You’ll love this then, using a similar mass-spring approach to model vehicle dynamics in a PS1 game: https://youtu.be/pwbwFdWBkU0

There’s a bunch of similar stuff with varying degrees of physical accuracy under Position Based Dynamics and the more physically correct eXtended Position Based dynamics. It’s a fun approach.

Some years ago i experimented with using springs for game physics[0] but while it looked nice with a single dynamic object against a static environment, collisions between dynamic objects quickly fell apart - objects intersected each other in weird ways and something as simple as stacking two boxes with imperfect placement (like a player would do, not the perfect stacking shown in the GIFs in the linked page) wasn't possible.

I did consider using convex volumes for the collision mesh and making checks against the spring ends (point-in-convex is trivial to check) but then i realized that in 3D space convex objects can collide even if both have their vertices outside of each other (consider two cubes that are not aligned to each other having two of their edges touch with one edge being almost perpendicular to the other). The code was already getting too hairy and at that point might as well drop the whole spring idea and do full convex shape collisions with rotation (big can of worms).

Though truth be told, the simplicity of using just springs and spheres is alluring and the issues might be solvable with a large number of spheres (IIRC Nvidia at some point years ago had a physics engine running on GPU where they modeled everything using small spheres). It does help avoid a bunch of stupid bugs that you can easily get with trying to do angular physics [1] :-P

[0] https://www.youtube.com/watch?v=_dnveLj96xQ

[1] https://i.imgur.com/UVS4TYv.gif

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