About This Book

Learn the fundamental and advanced concepts of game programming using step-by-step instructions and examples

Who This Book Is For

If you're a beginner or intermediate programmer with a basic understanding of 3D mathematics, and you want a stronger foundation in 3D graphics and physics, then this book is perfect for you! You'll even learn some of the fundamental concepts in 3D mathematics and software design that lies beneath them both, discovering some techniques and tricks in graphics and physics that you can use in any game development project.

Table of Contents

Chapter 1: Building a Game Application

Application components

Exploring the Bullet and FreeGLUT projects

Exploring Bullet's built-in demo applications

Starting a new project

Building the application layer

Summary

Chapter 2: Rendering and User Input

Rendering the scene

Basic rendering and lighting

Let there be light!

User input and camera control

Summary

Chapter 3: Physics Initialization

The core bullet objects

Creating the Bullet components

Creating our first physics object

Building a custom motion state

Creating a box

Rendering from transform data

Stepping the simulation

Summary

Chapter 4: Object Management and Debug Rendering

Handling multiple objects

Debug rendering

Introducing activation states

The domino effect

Summary

Chapter 5: Raycasting and Constraints

The power of raycasting

Destroying objects

Constraints

Understanding constraints

Summary

Chapter 6: Events, Triggers, and Explosions

Building a collision event system

Building trigger volumes

Force, torque, and impulse

Applying impulses

Summary

Chapter 7: Collision Shapes

Spheres and cylinders

Convex hulls

Compound shapes

Summary

Chapter 8: Collision Filtering

Groups and masks

Summary

Chapter 9: Soft Body Dynamics

Soft body requirements

Summary

What You Will Learn

Develop game applications from scratch; create a window, render the scene, and interact with your game through mouse and keyboard input

Write OpenGL code at a low-level; render objects and understand every line of code you write!

Understand how to keep the graphical and physical components of the simulation isolated for ease of understanding and future changes

Learn how to properly handle the rendering and physics processing of multiple objects

Explore the technologies and concepts behind modern game physics simulation through a practical understanding of Bullet Physics and OpenGL

Build crucial features that are essential to all games; collision events, user input, object control, and trigger volumes

Delve into a robust and modern physics engine game; and understand the challenges and solutions the developers of Bullet built into the library

In Detail

Physics simulation is an integral part of almost all game development projects as it is essential to the rules and feel of the game (gameplay) regardless of the project’s scale. Bullet is a 3D Collision Detection and Rigid Body Dynamics Library for games, and special effects for film and animations. Bullet is integrated into many 3D modelers including Maya, Houdini, Cinema 4D, LightWave, and Blender. It is free for commercial use and open source under the permissive ZLib License.

A comprehensive guide to start building games with the Bullet Physics library. Learn how modern physics engines work by implementing key features such as collision event systems, user input handling, and simulation of soft bodies. Then learn to control it all with forces, constraints, and robust object management. This book will reveal what’s going on under the hood of two modern and feature-rich graphics and physics APIs; OpenGL and Bullet Physics.

This book begins by teaching you to write your first OpenGL application, and then dives in to exploring the many features of the Bullet library in a straightforward manner. Each new feature expands upon the last, teaching you more about how physics is simulated in a video game, and how Bullet gives you the power to control every aspect of your simulation. You will learn how to render simple and complex shapes, apply some basic lighting, and construct a simple yet robust rendering system. From here, you will pull back the veil to see what’s going on underneath Bullet Physics, and learn to implement key game logic features through this widely-used and extensive physics library. After you finish this book, you’ll be armed with a wealth of knowledge to tackle the more advanced aspects of game graphics and physics going forward.

Authors

Chris Dickinson

Chris Dickinson grew up in England with a strong passion for science, mathematics, and, in particular, video games. He received his Master's degree in Physics with Electronics from the University of Leeds in 2005, and then left for California to work in scientific research in the heart of Silicon Valley. Finding that career path unsuitable, he began working in software testing and automation.
For years, he attempted to unravel the magic behind video games and 3D worlds through modding and level design, and was mostly self taught in software development and design. But, realizing that he needed proper tutelage and a stronger grasp of the fundamentals, if he ever wanted to build these complex applications himself, he decided to undertake a Bachelor's in Game and Simulation Programming while simultaneously working full time. He earned his second degree in early 2013 and continues his career in software development/test automation while simultaneously developing independent game projects in his spare time.

Alerts & Offers

Series & Level

We understand your time is important. Uniquely amongst the major publishers, we seek to develop and publish the broadest range of learning and information products on each technology. Every Packt product delivers a specific learning pathway, broadly defined by the Series type. This structured approach enables you to select the pathway which best suits your knowledge level, learning style and task objectives.

Learning

As a new user, these step-by-step tutorial guides will give you all the practical skills necessary to become competent and efficient.

Beginner's Guide

Friendly, informal tutorials that provide a practical introduction using examples, activities, and challenges.

Essentials

Fast paced, concentrated introductions showing the quickest way to put the tool to work in the real world.

Cookbook

A collection of practical self-contained recipes that all users of the technology will find useful for building more powerful and reliable systems.

Blueprints

Guides you through the most common types of project you'll encounter, giving you end-to-end guidance on how to build your specific solution quickly and reliably.

Mastering

Take your skills to the next level with advanced tutorials that will give you confidence to master the tool's most powerful features.

Starting

Accessible to readers adopting the topic, these titles get you into the tool or technology so that you can become an effective user.

Progressing

Building on core skills you already have, these titles share solutions and expertise so you become a highly productive power user.