What if i use pixel collision check inside a hitbox(actually not hitbox, just a rect) collision check? Is this makes better performance or not?
Pixel Collision Performance Question
Flashpunk does a hitbox check first before using any of the more specialized checks. You’d actually be potentially decreasing performance.
but i’ve looked at declaration of pixelmask collision check, i could not see any flashpunk filter, it is using adobe.flash hittest directly. Maybe i miss something…
The basic Mask class checks the bounding box before calling the specific logic, like collideGrid() or collidePixelmask(). It doesn’t use Hitbox directly, but it’s the same thing.
Trust me on this; I’ve been porting Flashpunk to C# and I’m intimately acquainted with its inner workings…
I’ve been porting FlashPunk to Haxe as an exercise and can confirm what @jacobalbano said. That optimization is already in place.
(yeah I know there’s an HaxePunk already, infact it ended up quite similar)
I would be thouroughly intrested in having a look at that C# port if at all possible.
I’m loving it! I’m gonna take a much closer look at this soon, right now I have some pressing matters to attend to before my attention is free, but thats just awesome. If its ok, can I contact you later about some details concerning possible application of this in some other projects I’m working on? P.S. this is fairly off topic, but I figured original question has been resolved.