aboutsummaryrefslogtreecommitdiff
path: root/src/aabb.odin
blob: 9637ec9af285c9543b80899bd60b74fbe831047e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
package demonchime

aabb_hori :: proc(a: Rect, b: Rect) -> bool {
  return a.start.x < b.start.x + b.size.x && b.start.x < a.start.x + a.size.x
}

aabb_vert :: proc(a: Rect, b: Rect) -> bool {
  return a.start.y < b.start.y + b.size.y && b.start.y < a.start.y + a.size.y
}

aabb :: proc(a: Rect, b: Rect) -> bool {
  return aabb_hori(a, b) && aabb_vert(a, b)
}