use std::marker::PhantomData;
use bevy::math::bounding::Aabb3d;
use crate::bevy_ryot::Cache;
use crate::position::TilePosition;
mod trajectory;
pub use trajectory::*;
mod traversal;
pub use traversal::*;
mod systems;
pub use systems::*;
#[derive(Debug, Clone, Default)]
pub struct Perspective {
pub traversals: Vec<Traversal>,
}
impl Perspective {
pub fn new(traversals: Vec<Traversal>) -> Self {
Self { traversals }
}
pub fn get_intersections(self) -> Vec<Vec<TilePosition>> {
self.traversals
.into_iter()
.map(|traversal| traversal.get_intersections())
.collect()
}
pub fn get_intersections_with(
self,
aabb_transformer: impl Fn(&TilePosition) -> Aabb3d + Copy,
) -> Vec<Vec<TilePosition>> {
self.traversals
.into_iter()
.map(|traversal| traversal.get_intersections_with(aabb_transformer))
.collect()
}
}
impl<T: Copy + Into<RadialArea>> From<&T> for RadialArea {
fn from(element: &T) -> RadialArea {
(*element).into()
}
}
#[cfg(test)]
mod tests;