Quadtree<O extends Rect> class

Available Extensions

Constructors

Quadtree(Rect bounds, {int maxObjects = 10, int maxDepth = 4, int depth = 0})

Properties

bounds Rect
final
depth int
final
hashCode int
The hash code for this object.
no setteroverride
maxDepth int
final
maxObjects int
final
nodes Map<Quadrant, Quadtree<O>>
Subnodes of the Quadtree.
final
objects List<O>
Objects contained within the node
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

clear() → void
Clear the Quadtree
getQuadrants(Rect object) List<Quadrant>
Determines which quadrants the object belongs to.
insert(O object) → void
Insert the object into the node. If the node exceeds the capacity, it will split and add all objects to their corresponding subnodes.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
retrieve(Rect bounds) List<O>
Return all objects that could collide with the given object, given bounds.
retrieveAllNodes([Quadtree<O>? quadtree]) List<Rect>
split() → void
Split the node into 4 subnodes (ne, nw, sw, se)
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object o) bool
The equality operator.
override