Physics simulation in games (or simply game physics) is a vast topic, and in this post we'll cover only a tiny part of it; yet certainly an interesting one! Let's understand what Verlet integration is by implementing a simple 2D cloth simulation with C++.
Physics in games is always fun, isn't it? Have you ever ditched the main quest of a level just to blow something up? I know I have.
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.
This article is divided into the following sections:
The basics of physics simulation
A quick review of differentiation and integration
and Numerical integration in the context of motion
Euler Integration
Verlet Integration
JavaScript implementation of Verlet integration
... continue reading