You are not logged in.
Hello,
Has anyone tried to implement a pixel-perfect collision system? I was looking over internet, most of the sites talk about a library which is rigth now down (sucks) I understand the theory, i could implement it to the easiest case (non-rotated, non-scaled graphics) but not for rotated/scaled graphics. I also don't know how to make a bitmask from an image (ok, i know it in theory, but not in C++), also my way would be very slow, so i was thinking in a batch process and hardcoded them into the program.
Any idea on the topic? where i should start looking for? thanks!
Offline
Hello,
You dont need to use pixel collision every time before you can use bounding box.
After for the pixel collision and like you said you need to a bitmask for each sprite.
I dont know how to use a virtual screen so you need to copy your bitmask on the screen when the bounding box detect a collision and check every pixel before to put the real sprite
The idea is:
If bounding box detect collision{
put your mask on the screen
check every pixel
do what you want
}
put your sprite to delete the mask
i hope it help
Offline
as i said i already know the theory, but i'm getting a bit lost when sprites are rotated or escaled...
Offline
Maybe the answer from Redshade on this page could help you: http://grrlib.santo.fr/forum/viewtopic.php?id=40
Offline
I already done my own pixel-perfect collision algorithm, it's pretty simple since i only check point vs object, but it's ok. If anyone want i could clean the code a bit and put it online.
Offline