O'Reilly logo

Beginning Math and Physics for Game Programmers by Wendy Stahler

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Applications in Collision Detection

The preceding section alluded to using circles and spheres for bounding geometry in your game. Certainly you can use other shapes, but the circle and sphere are simple shapes to work with numerically, and the test for collisions between circles and spheres is much faster than any other test. This test might lack precision, but because it's so fast, this test is perfect as the first line of defense. Let's look more closely at how to use these equations to mathematically determine whether two objects have collided.

Let's start with the two-dimensional circle, and then we'll expand the same process to 3D. Quite often, when you have an odd-shaped object such as a car, it's difficult to perform precise collision ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required