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 8. Collision Filtering

Collision filtering is an act of informing the physics engine to ignore collisions between specific types of objects. This could either be an optimization to minimize physics processing activity, or an essential component of gameplay. Either way, the mechanism to implement this in Bullet is the same, and we will explore how to implement such a system in this chapter using groups and masks

Groups and masks

The code to implement collision filtering is absolutely trivial, but it requires a good amount of explanation before it can be fully appreciated and understood.

Note

Continue from here using the Chapter8_CollisionFiltering project files.

When we call the addRigidBody() function on our world object, there is an overloaded ...

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