I'm writing a platformer engine with XNA and was wondering what method for handling collisions I should use. Would I be seeing some performance issues if I were to try and have PerPixel collisions? Should I be using PerPixel collision handling or rectangle collision handling?
In general, per pixel collision detection is much more expensive; so as much as possible, use rectangle collision handling. (Even for per-pixel, use rectangles first to check for overlap.) When I implemented collision detection in Radiant Wrench, this is precisely what I used.
Alternatively, you can try Flat Red Ball (which I used to use before), which uses polygons for detection (which is quite performant). You can use basic types (rectangle/circle) or create your own polygon from verticies. They don't support per-pixel collisions though.
|show 1 more comment|