diff --git a/collision/rtree.go b/collision/rtree.go index 8bf9a169..49d84616 100644 --- a/collision/rtree.go +++ b/collision/rtree.go @@ -22,6 +22,10 @@ type Rtree struct { height int } +func (tree *Rtree) Size() int { + return tree.size +} + // NewTree creates a new R-tree instance. func newTree(MinChildren, MaxChildren int) *Rtree { rt := Rtree{MinChildren: MinChildren, MaxChildren: MaxChildren} @@ -307,6 +311,7 @@ func (tree *Rtree) Delete(obj *Space) bool { for i, e := range n.entries { if e.obj == obj { ind = i + break } } if ind < 0 {