Get the latest tech news
Verlet Integration and Cloth Physics Simulation (2022)
Physics simulation in games is a super vast and interesting topic! This article explores how Verlet integration can be used to simulate 2D cloth physics with JavaScript and C++.
But even more fun than watching objects bounce around the screen is to understand how we can use simple concepts from high-school mathematics to simulate those physics laws with code. If you remember all this stuff from university or even from the 2D Game Physics Programming course here at pikuma.com, then I think you can skip the following section and continue from the part titled"Numerical Integration of Equations of Motion". I'll also show you how mouse inputs are handled to drag and tear the cloth, and thus you'll also learn a bit about SDL(Simple DirectMedia Layer) if you've never worked with this library before.
Or read this on Hacker News