2D Cloth Simulation in C++ with SDL Read the tutorial, where the code and all the underlying theory is explained in great depth at https://pikuma.com/blog/verlet-integration-2d-cloth-physics-simulation Upgrade function implement tearing by distance