O'Reilly logo

Learning Game Physics with Bullet Physics and OpenGL by Chris Dickinson

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

Chapter 6. Events, Triggers, and Explosions

Almost every game needs some form of event system that informs the game logic about collisions that have occurred between objects, and many of these events are triggered by invisible volumes of space that react when certain game objects enter them. In this chapter, we'll learn how to build these features and then apply them by simulating an explosion!

Building a collision event system

In a game such as Angry Birds, we would want to know when a breakable object such as a pig or piece of wood has collided with something, so that we can determine the amount of damage that was dealt, and whether or not the object should be destroyed, which in turn spawns some particle effects and increments the player's score. ...

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