Genbox / VelcroPhysics

High performance 2D collision detection system with realistic physics responses.
MIT License
672 stars 114 forks source link

Body collision filters #31

Open Genbox opened 7 years ago

Genbox commented 7 years ago

There is already collision filters on fixtures, and bodies contain collision filters as a wrapper for it's fixtures. This proposal is about creating a filter for bodies much like there is for fixtures (no wrapper).

A body is just a point in space and has no real concept of a geometry until fixtures attach shapes to the body. Adding a body filter would mean we break this concept a little bit by filtering on the total geometry (all shapes) of a body in the collision broad phase. We could further speed up processing by merging AABBs together for each shape in a body and check against that instead of each AABB.