Struct aabb_quadtree::QuadTree [] [src]

pub struct QuadTree<T> { /* fields omitted */ }

The main QuadTree structure. Mainly supports inserting, removing, and querying objects in 3d space.

Methods

impl<T> QuadTree<T>
[src]

[src]

Constructs a new QuadTree with customizable options.

  • size: the enclosing space for the quad-tree.
  • allow_duplicates: if false, the quadtree will remove objects that have the same bounding box.
  • min_children: the minimum amount of children that a tree node will have.
  • max_children: the maximum amount of children that a tree node will have before it gets split.
  • max_depth: the maximum depth that the tree can grow before it stops.

[src]

Constructs a new QuadTree with customizable options.

  • size: the enclosing space for the quad-tree. ### Defauts
  • allow_duplicates: true
  • min_children: 4
  • max_children: 16
  • max_depth: 8

[src]

Inserts an element with the provided bounding box.

[src]

Returns an ItemId for the first element that was inserted into the tree.

[src]

Inserts an element into the tree.

[src]

Retrieves an element by looking it up from the ItemId.

[src]

Returns an iterator of (element, bounding-box, id) for each element whose bounding box intersects with bounding_box.

[src]

Attempts to remove the item with id item_id from the tree. If that item was present, it returns a tuple of (element, bounding-box)

[src]

Returns an iterator over all the items in the tree.

[src]

Calls f repeatedly for every node in the tree with these arguments

  • &Rect: The boudning box of that tree node
  • usize: The current depth
  • bool: True if the node is a leaf-node, False if the node is a branch node.

[src]

Returns the number of elements in the tree

[src]

Returns true if the tree is empty.

[src]

Returns the enclosing bounding-box for the entire tree.

Trait Implementations

impl<T: Debug> Debug for QuadTree<T>
[src]

[src]

Formats the value using the given formatter.

impl<T: Clone> Clone for QuadTree<T>
[src]

[src]

Returns a copy of the value. Read more

1.0.0
[src]

Performs copy-assignment from source. Read more