← All projects Graphics, simulation, and math

Soft Body Simulation

Physics tech demo

A cube of 125 mass points held together by springs, integrated with RK4, wobbling the way a real soft object does.

C++RK4Numerical methods

The cube is not a mesh. It is 125 individual mass points, each carrying its own force, velocity, position, and mass, and every one of them gets its position and velocity updated with the RK4 method once per frame. RK4 is what keeps the motion stable instead of exploding after a few seconds.

Holding it together is a spring data structure I designed to connect any two mass points efficiently. In the demo the springs are the yellow lines and the mass points are the purple dots, so you can watch the structure stretch, compress, and settle back rather than just seeing a surface move.

The demo

← Goal Oriented Action Planning with Smart Objects Bezier Curve Generator →