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

Function IsIntersecting

common/collision.go:615–621  ·  view source on GitHub ↗

IsIntersecting tells if two engo.AABBs intersect.

(rect1 engo.AABB, rect2 engo.AABB)

Source from the content-addressed store, hash-verified

613
614// IsIntersecting tells if two engo.AABBs intersect.
615func 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.
624func MinimumTranslation(rect1 engo.AABB, rect2 engo.AABB) engo.Point {

Callers 1

OverlapsMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected