use super::*;
#[derive(Clone, Data, Debug, New, PartialEq)]
pub struct SpatialHashGrid2D {
#[get(type(copy))]
#[get_mut(pub(crate))]
#[set(pub(crate))]
pub cell_size: f64,
#[get(type(copy), pub(crate))]
#[set(pub(crate))]
#[new(skip)]
#[get_mut(pub(crate))]
pub(crate) inverse_cell_size: f64,
#[get_mut(pub(crate))]
#[new(skip)]
#[set(pub(crate))]
pub cells: SpatialCellMap2D,
}
#[derive(Clone, Data, Debug, New, PartialEq)]
pub struct SpatialHashGrid3D {
#[get(type(copy))]
#[get_mut(pub(crate))]
#[set(pub(crate))]
pub cell_size: f64,
#[get(type(copy), pub(crate))]
#[set(pub(crate))]
#[new(skip)]
#[get_mut(pub(crate))]
pub(crate) inverse_cell_size: f64,
#[get_mut(pub(crate))]
#[new(skip)]
#[set(pub(crate))]
pub cells: SpatialCellMap3D,
}
#[derive(Clone, Copy, Data, Debug, New, PartialEq)]
pub struct QuadTreeEntry2D {
#[get(type(copy))]
#[set(pub(crate))]
#[get_mut(pub(crate))]
pub index: usize,
#[get(type(copy))]
#[get_mut(pub(crate))]
#[set(pub(crate))]
pub min: Vector2D,
#[get(type(copy))]
#[get_mut(pub(crate))]
#[set(pub(crate))]
pub max: Vector2D,
}
#[derive(Clone, Data, Debug, New, PartialEq)]
pub struct QuadTreeNode2D {
#[get(type(copy))]
#[get_mut(pub(crate))]
#[set(pub(crate))]
pub min: Vector2D,
#[get(type(copy))]
#[get_mut(pub(crate))]
#[set(pub(crate))]
pub max: Vector2D,
#[get(type(copy))]
#[get_mut(pub(crate))]
#[set(pub(crate))]
pub depth: usize,
#[set(pub(crate))]
#[get_mut(pub(crate))]
pub children: QuadTreeChildren2D,
#[get(type(copy))]
#[set(pub(crate))]
#[get_mut(pub(crate))]
pub leaf: bool,
#[get(type(copy))]
#[set(pub(crate))]
#[get_mut(pub(crate))]
pub loose: bool,
#[set(pub(crate))]
#[get(pub(crate))]
#[get_mut(pub(crate))]
pub(crate) entries: QuadTreeEntryList2D,
}
#[derive(Clone, Data, Debug, PartialEq)]
pub struct QuadTree2D {
#[get_mut(pub(crate))]
#[set(pub(crate))]
pub nodes: QuadTreeNodeList2D,
#[get(type(copy))]
#[get_mut(pub(crate))]
#[set(pub(crate))]
pub capacity: usize,
#[get(pub(crate), type(copy))]
#[get_mut(pub(crate))]
pub max_depth: usize,
#[get(type(copy))]
#[set(pub(crate))]
#[get_mut(pub(crate))]
pub count: usize,
}