Integrating particles

Particles are a great place to start any physics engine. This is because particles have mass, but not volume. The lack of volume means we don't have to concern ourselves with rotation. In this section, we will create particles and move them using Euler Integration.

Integration is a way to guess where an object will be in some amount of time. In order to guess the new position of an object, we need to know its position, velocity, and all of the forces acting on the object. We first need to integrate acceleration with respect to time; this will yield the velocity of the object. We next integrate velocity with respect to time; this will yield the updated position of the object. The preceding integrations come right from Newton's ...

Get Game Physics Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.