8 bool AABB::Intersects(const AABB &other, Collision &coll) const {
9 if (Bottom() < other.Top()) return false;
10 if (other.Bottom() < Top()) return false;
11 if (Right() < other.Left()) return false;
12 if (other.Right() < Left()) return false;
15 diff.lt = max(lt, other.lt);
16 diff.rb = min(rb, other.rb);
17 const Vector<float> sdiff = diff.Size();
19 if (sdiff.x < sdiff.y) {
20 coll.pos.y = diff.Center().y;
23 if (Center().x < other.Center().x) {
26 coll.depth.x = other.Left() - Right();
30 coll.depth.x = other.Right() - Left();
33 coll.pos.x = diff.Center().x;
36 if (Center().y < other.Center().y) {
37 coll.pos.y = Bottom();
39 coll.depth.y = other.Top() - Bottom();
43 coll.depth.y = other.Bottom() - Top();