title: How to determine if two rectangles overlap (At angle)
body: <p>I want to determine if two rectangles overlap (Not intersect). I know how to do this for axis aligned rectangles, but in this case I have one rectangle that isn't always axis aligned (aka rotated on its center). <a href="https://math.stackexchange.com/questions/1278665/how-to-check-if-two-rectangles-intersect-rectangles-can-be-rotated">This post</a> shows how to calculate two rectangles intersecting, but it won't classify one rectangle inside another as seen in <a href="https://i.stack.imgur.com/cOXJo.png" rel="nofollow noreferrer">this picture</a> because they are overlapping, not intersecting.</p>
  
  <p>In my case one of the rectangles is axis aligned (The black box) and the other one rotates (red box) so that might make this easier.</p>
  
  <p>I think I'll need multiple cases to determine if they overlap. The first, easy, case would be to check if any of the red vertices are inside the black box. Then I can check if any of the red/black edges intersect. I'm not sure how I can cover the case shown above and if there's a simpler way to do this.</p>
  
  <p>Extra details: This is for my graphics software clipper (Can't use hardware clipping in this case) where the Black box is my window/viewport, the red box is the "sprite" and anything outside the black box is clipped/not-rendered I am using an orthoganal/2D projection. In the end I'll have two functions, one for detecting if a sprite in outside of the window/viewport (What I'm asking in this question) and later I'll make a function to crop the sprite to within the window/viewport using Sutherland–Hodgman algorithm.</p>
  
  <p>EDIT:</p>
  
  <p><a href="https://gamedev.stackexchange.com/questions/25397/obb-vs-obb-collision-detection">This</a> is post does generally describe how to do SAT, however it doesn't go into specifics. How do I generate normals? Are "Corners" the screen coordinates or distance from the center of the shape? I've tried adapting their code for my purposes, but I can't figure out how to perform a SAT test with a list of vertexes (Screen x and y) per shape/rectangle</p>