I am working on a fighting game where sprites are quite large and they use texture packer data.
I get slowdowns when testing for overlaps with FlxCollision.pixelPerfectCheck and I noticed that it is not optimized for atlas sprites.
Before checking for pixel collisions It first checks if the bounds of the sprite collide instead of checking the bounds of the atlas frame.
So when it calculates the rectangle intersection it is usually much larger than necessary and in my case has to loop more often through 3 times more pixels to find the collision.
The atlas frame can be much smaller than the sprite bounds and usually there are no nontransparent pixels outside of it.
I have started writing a new collision class based on FlxCollision.pixelPerfectCheck but I am wondering if there are better solutions.
Thank you.