Collision Detection and Object Representation in 3D

In Chapter 8, we discussed the relationship between object representation and collision detection. We strive to make our game-world objects as independent from their graphical representation as possible. Instead, we'd like to define them in terms of their bounding shape, position, and orientation. Position and orientation are not much of a problem: we can express the former as a Vector3 and the latter as the rotation around the x-, y-, and z-axes (minding the potential gimbal lock problem mentioned in the last chapter.) Let's take a look at bounding shapes.

Bounding Shapes in 3D

In terms of bounding shapes, we again have a ton of options. Figure 11–12 shows some of the more popular bounding ...

Get Beginning Android 4 Games Development 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.