13

Collision detection

If you are simply creating animated demos then collision detection is not an issue. But as soon as your characters are under user control they can easily walk through walls. It is your job as the programmer to stop this happening without interrupting the flow of the game. Collision detection can be handled in very complex ways using particularly heavy going mathematical approaches. In this chapter we are going to look at some of the simpler ways of handling collisions. First, we will look at a real world problem and some simple solutions to it using easy to code bounding boxes. Next we will look at how basic bounding boxes can introduce errors and how we can deal with these. Then we will look at how many collision ...

Get Real-time 3D Character Animation with Visual C++ 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.