Struct aabb_tree::AabbTree [] [src]

pub struct AabbTree<T, P = f32, A = MinMaxTuple<f32>> where P: Float + FromPrimitive,
        A: Into<MinMaxTuple<P>> + From<MinMaxTuple<P>> + Clone
{ /* fields omitted */ }

A dynamic spatial tree. Data is arranged in a binary tree which allows fast positional queries. The proxies returned from the various methods are leaves in the tree.

Panics

AABB operations are checked for validity and will panic in debug mode if aabb.is_valid() returns false.

Methods

impl<T, P, A> AabbTree<T, P, A> where P: Float + FromPrimitive,
        A: Into<MinMaxTuple<P>> + From<MinMaxTuple<P>> + Clone
[src]

Returns a new AABB

Creates a new node in the tree.

Destroy a node in the tree. Does not deallocate memory, nodes can be reutilized on later create_proxy calls.

Panics

Panics if the proxy_id is not valid (either was destroyed already or is not a leaf). Use proxies returned by create_proxy to avoid problems.

Changes the AABB of a node, might trigger a tree rebalance if the new AABB doesn't fit within the node's parent AABB.

Panics

Panics if the proxy_id is not valid (either was destroyed already or is not a leaf). Use proxies returned by create_proxy to avoid problems.

Returns a reference to the user data associated with the proxy_id. Returns None if the proxy_id is invalid.

Returns a mutable reference to the user data associated with the proxy_id. Returns None if the proxy_id is invalid.

Searchs the tree for every node that overlaps with aabb and calls the callback with the node's proxy id as a parameter. The callback returns a boolean value indicating wether the query should continue or not. The method is a specialized version of AabbTree::query, where search is defined as |other_aabb| other_aabb.overlaps(aabb)

Searchs the AABB using a generic search function. search receives the current AABB being analyzed and should return true if that AABB is within your search constraints. Once a leaf node is found and search returns true for that node, callback will be called with the node's proxy id as a parameter. The callback returns a boolean value indicating wether the query should continue or not.

Trait Implementations

impl<T: Clone, P: Clone, A: Clone> Clone for AabbTree<T, P, A> where P: Float + FromPrimitive,
        A: Into<MinMaxTuple<P>> + From<MinMaxTuple<P>> + Clone
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl<T, P, A> Debug for AabbTree<T, P, A> where T: Debug,
        P: Float + FromPrimitive + Debug,
        A: Into<MinMaxTuple<P>> + From<MinMaxTuple<P>> + Clone + Debug
[src]

Formats the value using the given formatter.