Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

C++ 2D pixel perfect collision detection libraries?

what are the libraries available to do this which integrate with SDL and QT4 . Are there any existing packages in SDL or QT which allow for easy implementation of this?. I am looking for for an easy to use library that would allow me to have a functionality like this

http://www.coreyoneil.com/portfolio/index.php?project=5

a link to the Api/class example/tutorial which implements pixel-perfect collision detection in your stated library is what i am looking for.

Edit: Please check the above link to understand what i mean by pixel perfect.

like image 498
Aditya P Avatar asked Feb 28 '11 06:02

Aditya P


4 Answers

Qt does provide collision test in its QGraphicsItem class. It supoorts path-based shapes. I am not sure if it works with your pixel requirement.

like image 101
Stephen Chu Avatar answered Nov 20 '22 09:11

Stephen Chu


Take a look at this GameDev related post(Reni2D is C with OpenGL so it should fit OK with SDL).

In HAAF's engine they advertise it as coming soon, so maybe it's worth checking it out also.

like image 38
celavek Avatar answered Nov 20 '22 09:11

celavek


I recomend you this Allegro Perfect Collision

Allegro.cc has a great helpful comunity.

Good luck!

like image 22
Hernán Eche Avatar answered Nov 20 '22 09:11

Hernán Eche


PoxelColl provides pixel-perfect collision detection, and supports basic transformations like rotation and scaling. A C++11 port is supported, so it should be compatible with SDL and QT.

like image 1
PoxelColl Avatar answered Nov 20 '22 11:11

PoxelColl