affablemattress / 2d-soft-body

A soft-body simulation written in C++. Soft bodies consist of equidistant point masses joined by spring-damper couples. Uses Velocity Verlet method to numerically solve for positions and velocities.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

2d-soft-body

A soft-body simulation written in C++. 2D bodies consist of point masses joined by spring-damper couples. Uses Velocity Verlet method to numerically solve for positions and velocities.

Velocity Verlet causes a ton of energy drift which is compensated by the dampers if the damping coefficient is large enough. If the damping coefficient is set to a very small value or zero, energy drift will cause the soft body to be very unstable. To fix this issue I might implement a higher order integrator instead of Velovity Verlet in the future.

Uses raylib as the graphics API/OpenGL wrapper and raygui for the UI.

About

A soft-body simulation written in C++. Soft bodies consist of equidistant point masses joined by spring-damper couples. Uses Velocity Verlet method to numerically solve for positions and velocities.

License:GNU General Public License v3.0


Languages

Language:C 97.6%Language:C++ 2.3%Language:CMake 0.1%