Per Pixel Collision - Code explanation

前端 未结 3 846
死守一世寂寞
死守一世寂寞 2021-01-14 19:37

I\'m currently trying to understand per pixel collision detection.

This is the code I don\'t understand:

static bool IntersectPixels(Rectangle rectan         


        
3条回答
  •  甜味超标
    2021-01-14 20:36

    for (int y = top; y < bottom; y++) loops over the lines of the resulting rectangle from top to bottom, and for (int x = left; x < right; x++) loops over pixels inside each line, left to right.

提交回复
热议问题