MCPcopy Create free account
hub / github.com/EngoEngine/engo / aabbOverlaps

Function aabbOverlaps

quadtree.go:27–50  ·  view source on GitHub ↗
(a, b AABB)

Source from the content-addressed store, hash-verified

25}
26
27func aabbOverlaps(a, b AABB) bool {
28 // a is left of b
29 if a.Max.X < b.Min.X {
30 return false
31 }
32
33 // a is right of b
34 if a.Min.X > b.Max.X {
35 return false
36 }
37
38 // a is above b
39 if a.Max.Y < b.Min.Y {
40 return false
41 }
42
43 // a is below b
44 if a.Min.Y > b.Max.Y {
45 return false
46 }
47
48 // The two overlap
49 return true
50}
51
52func aabbWidth(x AABB) float32 {
53 return x.Max.X - x.Min.X

Callers 1

RetrieveMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected