http://jeffreythompson.org/collision-detection/rect-rect.php
I am trying to figure out the algorithm of the collision detection of the rectangle/rectangle with the rectangles' picture and code. According to Jeff Thompson's collision detection article, valuable r1RightEdge is r1x + r1w.
float r1RightEdge = r1x + r1w;
if (r1RightEdge >= r2x) {
// right edge of r1 is past left edge of r2
}
Is valuable r1RightEdge vertical dot line of the blue rectangle in the picture? If so, why is the valuable r1RightEdge is r1x +r1w instead of r1x+r1h?