WHAT’S IN THIS CHAPTER?
- Introducing the different types of physics objects
- Learning about the most popular physics shapes supported by the Bullet physics library
- Setting up a 3D physical world
- Understanding how collision callbacks are working and how to use them for game logic code
- Implementing a 2D physics game similar to Angry Birds (a popular game developed by Rovio Mobile Ltd.)
- Learning about the .bullet file format and how to export it from Blender
- Implementing a 3D physics-based pinball machine using physics constraints
Since the beginning of this book, you have been focusing only on graphics. It is indeed an important part of your app, but games are not all about graphics! In this chapter, you will learn how to integrate real-time 2D and 3D physics inside your apps.
You will discover how to use the Bullet physics library for collision detection as well as for rigid and soft body dynamics. Bullet is open source and cross-platform, and can freely be used for commercial software. You can find more information about Bullet at http://bulletphysics.org, where you can also download the full SDK and have access to the latest API and documentation.
TYPES OF PHYSICAL OBJECTS
Bullet supports multiple physical object types, which will allow you to make your geometries respond in a specific way during real-time physics simulation. Before adding any type of physical body to your scene, you should first analyze what type of physical object it is in order ...