2nd Edition
Game Physics Engine Development How to Build a Robust Commercial-Grade Physics Engine for your Game
Physics is really important to game programmers who need to know how to add physical realism to their games. They need to take into account the laws of physics when creating a simulation or game engine, particularly in 3D computer graphics, for the purpose of making the effects appear more real to the observer or player.The game engine needs to recognize the physical properties of objects that artists create, and combine them with realistic motion.
The physics ENGINE is a computer program that you work into your game that simulates Newtonian physics and predict effects under different conditions. In video games, the physics engine uses real-time physics to improve realism.
This is the only book in its category to take readers through the process of building a complete game-ready physics engine from scratch. The Cyclone game engine featured in the book was written specifically for this book and has been utilized in iPhone application development and Adobe Flash projects. There is a good deal of master-class level information available, but almost nothing in any format that teaches the basics in a practical way. The second edition includes NEW and/or revised material on collision detection, 2D physics, casual game physics for Flash games, more references, a glossary, and end-of-chapter exercises. The companion website will include the full source code of the Cyclone physics engine, along with example applications that show the physics system in operation.
Introduction
What is Game Physics?
What is a Physics Engine?
Approaches to Physics Engines
The Mathematics of Physics Engines
The Source Code in the Book
How the Book is Structured
PART I Particle Physics
The Mathematics of Particles
Vectors
Calculus
Summary
Exercises
The Laws of Motion
The Particle
The First Two Laws
The Integrator
Summary
Exercises
The Particle Physics Engine
Ballistics
Fireworks
Summary
Projects
PART II Mass Aggregate Physics
Adding General Forces
D’Alembert’s Principle
Force Generators
Built-In Gravity and Damping
Summary
Exercises
Springs and Spring-Like Things
Hook’s Law
Spring-Like Force Generators
Stiff Springs
Summary
Exercises
Hard Constraints
Simple Collision Resolution
Collision Processing
The Contact Resolver Algorithm
Collision-Like Things
Summary
Exercises
The Mass Aggregate Physics Engine
Overview of the Engine
Using the Physics Engine
Summary
Projects
PART III Rigid-Body Physics
The Mathematics of Rotations
Rotating Objects in 2D
Orientation in 3D
Angular Velocity and Acceleration
Implementing the Mathematics
Summary
Exercises
Laws of Motion for Rigid Bodies
The Rigid Body
Newton-2 for Rotation
D’Alembert for Rotation
The Rigid-Body Integration
Summary
Exercises
The Rigid-Body Physics Engine
Overview of the Engine
Using the Physics Engine
Summary
Projects
PART IV Collision Detection
Collision Detection
The Collision Detection Pipeline
Broad-Phase Collision Detection
Bounding Volume Hierarchies
Spatial Partitioning
Summary
Exercises
Generating Contacts
Collision Geometry
Contact Generation
Simple Collision Algorithms
Separating Axis Tests
Coherence
Summary
Exercises
PART V Contact Physics
Collision Resolution
Impulse and Impulsive Torque
Collision Impulses
Resolving Interpenetration
The Collision Resolution Process
Summary
Exercises
Resting Contacts and Friction
Resting Forces
Microcollisions
Types of Friction
Implementing Friction
Friction and Sequential Contact Resolution
Summary
Exercises
Stability and Optimization
Stability
Optimizations
Summary
Putting It All Together
Overview of the Engine
Using the Physics Engine
Limitations of the Engine
Summary
Projects
PART VI Further Topics in Physics
Physics in Two Dimensions
2D or 3D?
Vector Mathematics
Particle and Mass Aggregate Physics
The Mathematics of Rotation
Rigid-Body Dynamics
Collision Detection
Collision Response
Summary
Projects
Other Programming Languages
ActionScript 3
C
Java
C#
Other Scripting Languages
Other Types of Physics
Simultaneous Contact Resolution
Reduced Coordinate Approaches
Summary
Appendix A Useful Inertia Tensors
Discrete Masses
Continuous Masses
Common Shapes
Cuboid
Sphere
Cylinder
Cone
Hemisphere
Moments of Inertia in 2D
Common 2D Shapes
Appendix B Useful Friction Coefficients
Appendix C Mathematics Summary
Vectors
Quaternions
Matrices
Integration
Physics
Other Forumlas
Biography
Ian Millington is a partner of IPR Ventures, a consulting company developing next-generation AI technologies for entertainment, modeling, and simulation. Previously he founded Mindlathe Ltd, the largest specialist AI middleware company in computer games, working with on a huge range of game genres and technologies. He has a long background in AI, including PhD research in complexity theory and natural computing. He has published academic and professional papers and articles on topics ranging from paleontology to hypertext.
Praise for 1st edition:
"The first game physics book to emphasize building an actual engine...his book fills a gap by demonstrating how you actually build a physics engine." - Dave Eberly, President, Geometric Tools.
"A competent programmer with sufficient mathematical sophistication could build a physics engine just from the text and equations--even without the accompanying source code. You can't say this about a lot of books!" - Philip J. Schneider, Industrial Light & Magic.