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

Method Retrieve

quadtree.go:340–351  ·  view source on GitHub ↗

Retrieve returns all objects that could collide with the given bounding box and passing the given filter function.

(find AABB, filter func(aabb AABBer) bool)

Source from the content-addressed store, hash-verified

338
339// Retrieve returns all objects that could collide with the given bounding box and passing the given filter function.
340func (qt *Quadtree) Retrieve(find AABB, filter func(aabb AABBer) bool) []AABBer {
341 var foundIntersections []AABBer
342
343 potentials := qt.root.Retrieve(find)
344 for _, p := range potentials {
345 if aabbOverlaps(find, p.AABB()) && (filter == nil || filter(p)) {
346 foundIntersections = append(foundIntersections, p)
347 }
348 }
349
350 return foundIntersections
351}
352
353//Clear removes all items from the quadtree
354func (qt *Quadtree) Clear() {

Callers 1

RetrieveMethod · 0.45

Calls 2

aabbOverlapsFunction · 0.85
AABBMethod · 0.65

Tested by

no test coverage detected