Wiki is correct, but hard to read, as usual.
An interval is just a range, i.e. the values of x such that a <= x <= b, where a and b are two numbers, and those comparisons could be strict or not (which is the open/closed aspect i was talking about). It's very useful to consider AABBs in terms of a pair of half open intervals, i.e. a rectangle is a collection of points x,y s.t. a <=x < b and c<=y<d.
Two rectangles intersect if they have a point in common. It's clear from this treatment why adjacent rectangles are not considered to overlap.
You in particular will find it useful, as you are so far using off-by-one methods, and, judging from the
other thread, are having difficulties adapting it to real numbers from integers.
Using the treatment I've described, I hope way becomes more clear. Rather than consider the range [a,b-1], you talk about the range [a,b). Rewrite all your integer algorithms in that form (you should find it is possible without ever adding or subtracting a unit, by being careful with <= vs <), and then it will work for reals, too.
E.g. your intersection algorith probably looks like this:
bool intersect(r1, r2)
{
// Is the max of the r1 less than the min of r2 in the x axis?
if(r1.x + r1.width - 1 < r2.x)
return false;
// etc...
}
Instead do
bool intersect(r1,r2)
{
if(r1.x + r1.width <= r2.x)
return false;
// etc
}
It's clear in the above example that they are substantially the same, but try to keep in mind the underlying intervals [r1.x, r1.x+r1.width) and [r2.x, r2.x+r2.width), and how in the case r1.x+r1.width = r2.x they both go
up to the same point, but only the second interval includes that point, so they are considered not to overlap.