Mouse control. Drag small red box inside the big blue box. Finds if an Axis Aligned Bounding Box (AABB) is fully hidden behind (occluded) when both are rotating. Used in render engines to find & remove (culling) redundant draw moves that slows render times #aabb #rotated #occlusion #culling
First checks if the small circle is fully inside big circle (small grey circle turns pink) using basic distance calculations; if inside check that red bounding box is fully inside blue bounding box, then the red bounding box turns white. It works by 1. Axis aligning the blue bounding box points at 0 rotation 2. Transpose the red points by blues original rotation 3. Get new min & max XY of red 4. Use AABB calculation on the re-aligned bounding boxes Turn on debug to visualize. This was a little tricky to transpose & debug until I added the enclosing circles but happy with the performance. The sqrt distance calculations don't effect performance. Anyone know how to get min/max with branchless code? I update the minmax values 6 to 10 times, while SAT always does it 6 times eg: @chooper-beta https://scratch.mit.edu/projects/119532336