Brian Carter
Brian Carter

Reputation: 157

Is there an easy way to do Per-Pixel collision detection on iPhone/UIKit?

I'm quickly prototyping an iPad game and have been using frame-based collision detection. It's very much needing per pixel collision detection. Is there an easy way to implement this or any guides I could look at to hacking together my own? Google only brings up people in my similar predicament which does not bode well.

Upvotes: 0

Views: 470

Answers (1)

Rajavanya Subramaniyan
Rajavanya Subramaniyan

Reputation: 2155

Ok. We had a game where we needed this.

One solution which worked was doing glreadpixel. But on the 3G, after a point when we added more objects in the game it became a bottleneck. 3GS, iPad and new iPhone/iPod should perform a lot better. Remember to read more, as glReadPixel is very costly and blocking call. But experimenting won't hurt.

Later we chose to use our own collision maps with curves and lines to do terrain collision. Similar to Box2d.

Upvotes: 1

Related Questions