Skip to main content

Broadphase

Trait Broadphase 

Source
pub trait Broadphase {
    // Required methods
    fn insert(&mut self, id: u64, aabb: Aabb);
    fn update(&mut self, id: u64, aabb: Aabb);
    fn remove(&mut self, id: u64);
    fn overlapping_pairs(&self) -> Vec<(u64, u64)>;
    fn query_aabb(&self, query: &Aabb) -> Vec<u64>;
}
Expand description

Trait for broadphase collision detection structures.

Required Methods§

Source

fn insert(&mut self, id: u64, aabb: Aabb)

Insert an object with the given id and AABB.

Source

fn update(&mut self, id: u64, aabb: Aabb)

Update the AABB for an existing object.

Source

fn remove(&mut self, id: u64)

Remove an object.

Source

fn overlapping_pairs(&self) -> Vec<(u64, u64)>

Return all pairs of overlapping ids.

Source

fn query_aabb(&self, query: &Aabb) -> Vec<u64>

Return all ids whose AABB overlaps the query AABB.

Implementors§