PDA

View Full Version : per pixel collision for 2d Images possible?



sundar
01-14-2012, 07:12 AM
HI,

I am wondering is per pixel collision or odd shaped collision detection of 2d images possible in proton?

Thanks

Seth
01-14-2012, 11:11 AM
Hi - well, vanilla Proton does not have any collision features - it isn't a game engine.

Proton should be thought of more like SDL, just an abstraction of rendering, file access, audio, etc.

The only place is starts to provide more "engine-like" features is the GUI support (buttons, clicking, input boxes, etc) , which is optimized for mobile. (but works for desktops too, such as supporting cut/paste with the rest of the OS)

It does have ways to access the pixel data of any image loaded for you to look at and do your own pixel based collision or shape build though. (the SoftSurface class can load any texture and let you examine the pixels)

For 2d collision/physics I'd recommended integrating Box2d.. you can setup vertex based shapes. If you use Irrlicht (a real game engine) with Proton it does come with some decent 3d collision stuff.. but you said 2d so that probably wouldn't be what you needed.