Once again, that's not what I meant. The return CLASS is a rect<T>. IT IS NOT A REAL RECTANGLE!
By the way, what you're saying is the same as what hendu is saying, except I believe that it's been done in the function constrainTo(), which, geometrically, returns the overlap of the two rectangles (I need to double-check that - I could be wrong).
I see what you're trying to say, but I'm talking about a difference in location that I would need to move a rectangle or changing scaling. Hm... I can see this is going to be annoying to explain without presenting a picture. But atm it's late, so I'll do it later. Try this thought experiment: What information would you need to make one rectangle become like another rectangle over a certain period of time. Of course, you may come up with a different solution than I did, but here's the gist of my solution:
box1 has dimensions ulc1 and lrc1. box2, which is being transitioned to, has dimensions ulc2 and lrc2. The speed of transition is Speed. Time is given by timeMs, as usual. Hence, the only thing I need to know is the four axis distances over which the change occurs, which turn out to be:
(ulc2.x - ulc1.x = distULCx)
(ulc2.y - ulc1.y = distULCy)
(lrc2.x - lrc1.x = distLRCx)
(lrc2.y - lrc1.y = distLRCy)
Then the new values of the rectangle-being-changes at timeMs are:
if ( abs( timeMs * Speed ) <= abs(distULCx) )
{ ulc1.x = timeMs * Speed; }
if ( abs( timeMs * Speed ) <= abs(distULCy) )
{ ulc1.y = timeMs * Speed; }
if ( abs( timeMs * Speed ) <= abs(distLRCx) )
{ lrc1.x = timeMs * Speed; }
if ( abs( timeMs * Speed ) <= abs(distLRCy) )
{ lrc1.y = timeMs * Speed; }
I figure it's easiest to find the values distULCx, distULCy, distLRCx, and distLRCy with the following:
(ulc2 - ulc1 => distULCx, distULCy)
(lrc2 - lrc1 => distLRCx, distLRCy)
which, of course, is a rect<T> class return, which is what I give above in the functions in my first post.
So now I ask again, if you're not going to call it "difference" (even though it's the POSITIONAL DIFFERENCE between the corners of two rectangles), what WOULD you call it?????