IsIntersecting tells if two engo.AABBs intersect.
(rect1 engo.AABB, rect2 engo.AABB)
| 613 | |
| 614 | // IsIntersecting tells if two engo.AABBs intersect. |
| 615 | func IsIntersecting(rect1 engo.AABB, rect2 engo.AABB) bool { |
| 616 | if rect1.Max.X > rect2.Min.X && rect1.Min.X < rect2.Max.X && rect1.Max.Y > rect2.Min.Y && rect1.Min.Y < rect2.Max.Y { |
| 617 | return true |
| 618 | } |
| 619 | |
| 620 | return false |
| 621 | } |
| 622 | |
| 623 | // MinimumTranslation tells how much an entity has to move to no longer overlap another entity. |
| 624 | func MinimumTranslation(rect1 engo.AABB, rect2 engo.AABB) engo.Point { |