MCPcopy Index your code
hub / github.com/EngoEngine/engo / Remove

Method Remove

quadtree.go:288–304  ·  view source on GitHub ↗
(item AABBer, pRect AABB)

Source from the content-addressed store, hash-verified

286}
287
288func (qt *quadtreeNode) Remove(item AABBer, pRect AABB) {
289 if qt.hasNodes {
290 index := qt.getIndex(pRect)
291 if index != -1 {
292 qt.Nodes[index].Remove(item, pRect)
293 qt.unsplit()
294 return
295 }
296 }
297 for i := 0; i < len(qt.Objects); i++ {
298 if qt.Objects[i].Value == item {
299 qt.Tree.freeQuadtreeNodeData(qt.Objects[i])
300 qt.Objects = append(qt.Objects[:i], qt.Objects[i+1:]...) // Remove the object from the slice
301 return
302 }
303 }
304}
305
306// Remove removes the given item from the quadtree
307func (qt *Quadtree) Remove(item AABBer) {

Callers

nothing calls this directly

Calls 4

getIndexMethod · 0.95
unsplitMethod · 0.95
freeQuadtreeNodeDataMethod · 0.80
RemoveMethod · 0.45

Tested by

no test coverage detected