QuadTree

Struct QuadTree 

Source
pub struct QuadTree { /* private fields */ }

Implementations§

Source§

impl QuadTree

Source

pub fn new_with_config( bounding_box: Rectangle, config: Config, ) -> QuadtreeResult<Self>

Source

pub fn storage_counts(&self) -> (usize, usize, usize)

Source

pub fn new(bounding_box: Rectangle) -> QuadtreeResult<Self>

Source

pub fn insert( &mut self, value: u32, shape: ShapeEnum, entity_type: Option<u32>, ) -> QuadtreeResult<()>

Source

pub fn insert_rect_extent( &mut self, value: u32, min_x: f32, min_y: f32, max_x: f32, max_y: f32, entity_type: Option<u32>, ) -> QuadtreeResult<()>

Source

pub fn insert_circle_raw( &mut self, value: u32, x: f32, y: f32, radius: f32, entity_type: Option<u32>, ) -> QuadtreeResult<()>

Source

pub fn delete(&mut self, value: u32)

Source

pub fn relocate_batch( &mut self, relocation_requests: &[RelocationRequest], ) -> QuadtreeResult<()>

Source

pub fn relocate( &mut self, value: u32, shape: ShapeEnum, entity_type: EntityTypeUpdate, ) -> QuadtreeResult<()>

Source

pub fn relocate_rect_extent( &mut self, value: u32, min_x: f32, min_y: f32, max_x: f32, max_y: f32, entity_type: EntityTypeUpdate, ) -> QuadtreeResult<()>

Source

pub fn relocate_circle_raw( &mut self, value: u32, x: f32, y: f32, radius: f32, entity_type: EntityTypeUpdate, ) -> QuadtreeResult<()>

Source

pub fn update(&mut self)

Source

pub fn collisions_batch( &mut self, shapes: &[ShapeEnum], ) -> QuadtreeResult<Vec<Vec<u32>>>

Note: touching edges are not treated as collisions.

Source

pub fn collisions_batch_filter( &mut self, shapes: &[ShapeEnum], filter_entity_types: Option<Vec<u32>>, ) -> QuadtreeResult<Vec<Vec<u32>>>

Note: touching edges are not treated as collisions.

Source

pub fn collisions( &mut self, shape: ShapeEnum, collisions: &mut Vec<u32>, ) -> QuadtreeResult<()>

Note: touching edges are not treated as collisions.

Source

pub fn collisions_rect_extent( &mut self, min_x: f32, min_y: f32, max_x: f32, max_y: f32, collisions: &mut Vec<u32>, ) -> QuadtreeResult<()>

Note: touching edges are not treated as collisions.

Source

pub fn collisions_circle_raw( &mut self, x: f32, y: f32, radius: f32, collisions: &mut Vec<u32>, ) -> QuadtreeResult<()>

Note: touching edges are not treated as collisions.

Source

pub fn collisions_filter( &mut self, shape: ShapeEnum, filter_entity_types: Option<Vec<u32>>, collisions: &mut Vec<u32>, ) -> QuadtreeResult<()>

Note: touching edges are not treated as collisions.

Source

pub fn take_query_stats(&mut self) -> QueryStats

Source

pub fn collisions_with<F>( &mut self, shape: ShapeEnum, f: F, ) -> QuadtreeResult<()>
where F: FnMut(u32),

Note: touching edges are not treated as collisions.

Source

pub fn collisions_rect_extent_with<F>( &mut self, min_x: f32, min_y: f32, max_x: f32, max_y: f32, f: F, ) -> QuadtreeResult<()>
where F: FnMut(u32),

Note: touching edges are not treated as collisions.

Source

pub fn collisions_circle_raw_with<F>( &mut self, x: f32, y: f32, radius: f32, f: F, ) -> QuadtreeResult<()>
where F: FnMut(u32),

Note: touching edges are not treated as collisions.

Source

pub fn collisions_with_filter<F>( &mut self, shape: ShapeEnum, filter_entity_types: Option<Vec<u32>>, f: F, ) -> QuadtreeResult<()>
where F: FnMut(u32),

Note: touching edges are not treated as collisions.

Source

pub fn for_each_collision_pair<F>(&mut self, f: F)
where F: FnMut(u32, u32),

Source

pub fn all_node_bounding_boxes(&mut self, bounding_boxes: &mut Vec<Rectangle>)

Source

pub fn all_shapes(&mut self, shapes: &mut Vec<ShapeEnum>)

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V