If we have n bodies in our simulation, the computational complexity of detecting collisions with pairwise tests is O( n 2), a number that makes computer scientists cringe. In the context of rigid body simulations, a collision happens when the shapes of two rigid bodies are intersecting, or when the distance between these shapes falls below a small tolerance. In the next, and final, installment, we’ll talk more about “solving” these collisions to eliminate interpenetrations.įor a review of the linear algebra concepts referred to in this article, you can refer to the linear algebra crash course in Part I. In Part II, we will cover the collision detection step, which consists of finding pairs of bodies that are colliding among a possibly large number of bodies scattered around a 2D or 3D world. This is where understanding collision physics is particularly important for game developers. In order to more realistically simulate the behavior of solid objects, we have to check if they collide with each other every time they move, and if they do, we have to do something about it, such as applying forces that change their velocities, so that they will move in the opposite direction. Without some additional work, the simulated rigid bodies can go right through each other, or “interpenetrate”, which is undesirable in the majority of cases. In that discussion, however, objects did not interact with each other. In Part I of this series, we explored rigid bodies and their motions. Part III: Constrained Rigid Body Simulation Part I: An Introduction to Rigid Body Dynamics
#MESH ENABLER NO VALID SOLID BODIES SERIES#
This is Part II of our three-part series on video game physics.