Struct rhusics_ecs::SpatialSortingSystem
source · pub struct SpatialSortingSystem<P, T, D, B, Y = ()> { /* private fields */ }
Expand description
Spatial sorting system for use with
specs
.
Will perform spatial sorting of the collision world. Uses a Dynamic Bounding Volume Tree for sorting. Will update entries in the tree where the pose is dirty.
Can handle any transform component type, as long as the type implements
Transform
, and as long as the
storage is wrapped in
FlaggedStorage
Type parameters:
P
: Primitive type, needs to implementPrimitive
.T
: Transform type, needs to implementTransform
and haveFlaggedStorage
.D
: Type of values stored in the DBVT, needs to implementTreeValue
andFrom<(Entity, CollisionShape)>
B
: Bounding volumeY
: Shape type, seeCollider
System Function:
fn(Entities, T, NextFrame<T>, CollisionShape) -> (CollisionShape, DynamicBoundingVolumeTree<D>)
Implementations
sourceimpl<P, T, D, B, Y> SpatialSortingSystem<P, T, D, B, Y>
impl<P, T, D, B, Y> SpatialSortingSystem<P, T, D, B, Y>
Trait Implementations
sourceimpl<P: Debug, T: Debug, D: Debug, B: Debug, Y: Debug> Debug for SpatialSortingSystem<P, T, D, B, Y>
impl<P: Debug, T: Debug, D: Debug, B: Debug, Y: Debug> Debug for SpatialSortingSystem<P, T, D, B, Y>
sourceimpl<'a, P, T, Y, D, B> System<'a> for SpatialSortingSystem<P, T, D, B, Y>where
P: Primitive + ComputeBound<B> + Send + Sync + 'static,
B: Clone + Debug + Send + Sync + Union<B, Output = B> + Bound<Point = P::Point> + Contains<B> + SurfaceArea<Scalar = <P::Point as EuclideanSpace>::Scalar> + 'static,
P::Point: Debug,
<P::Point as EuclideanSpace>::Scalar: BaseFloat + Send + Sync + 'static,
<P::Point as EuclideanSpace>::Diff: Debug + Send + Sync,
T: Component + Clone + Debug + Transform<P::Point> + Send + Sync,
T::Storage: Tracked,
Y: Default + Send + Sync + 'static,
D: Send + Sync + 'static + TreeValue<Bound = B> + From<(Entity, B)>,
impl<'a, P, T, Y, D, B> System<'a> for SpatialSortingSystem<P, T, D, B, Y>where
P: Primitive + ComputeBound<B> + Send + Sync + 'static,
B: Clone + Debug + Send + Sync + Union<B, Output = B> + Bound<Point = P::Point> + Contains<B> + SurfaceArea<Scalar = <P::Point as EuclideanSpace>::Scalar> + 'static,
P::Point: Debug,
<P::Point as EuclideanSpace>::Scalar: BaseFloat + Send + Sync + 'static,
<P::Point as EuclideanSpace>::Diff: Debug + Send + Sync,
T: Component + Clone + Debug + Transform<P::Point> + Send + Sync,
T::Storage: Tracked,
Y: Default + Send + Sync + 'static,
D: Send + Sync + 'static + TreeValue<Bound = B> + From<(Entity, B)>,
type SystemData = (Read<'a, EntitiesRes, DefaultProvider>, Storage<'a, T, Fetch<'a, MaskedStorage<T>>>, Storage<'a, NextFrame<T>, Fetch<'a, MaskedStorage<NextFrame<T>>>>, Storage<'a, CollisionShape<P, T, B, Y>, FetchMut<'a, MaskedStorage<CollisionShape<P, T, B, Y>>>>, Write<'a, DynamicBoundingVolumeTree<D>, DefaultProvider>)
type SystemData = (Read<'a, EntitiesRes, DefaultProvider>, Storage<'a, T, Fetch<'a, MaskedStorage<T>>>, Storage<'a, NextFrame<T>, Fetch<'a, MaskedStorage<NextFrame<T>>>>, Storage<'a, CollisionShape<P, T, B, Y>, FetchMut<'a, MaskedStorage<CollisionShape<P, T, B, Y>>>>, Write<'a, DynamicBoundingVolumeTree<D>, DefaultProvider>)
The resource bundle required to execute this system. Read more
sourcefn run(&mut self, (entities, poses, next_poses, shapes, tree): Self::SystemData)
fn run(&mut self, (entities, poses, next_poses, shapes, tree): Self::SystemData)
Executes the system with the required system
data. Read more
sourcefn running_time(&self) -> RunningTime
fn running_time(&self) -> RunningTime
Returns a hint how long the system needs for running.
This is used to optimize the way they’re executed (might
allow more parallelization). Read more
sourcefn accessor<'b>(&'b self) -> AccessorCow<'a, 'b, Self>
fn accessor<'b>(&'b self) -> AccessorCow<'a, 'b, Self>
Return the accessor from the
SystemData
.Auto Trait Implementations
impl<P, T, D, B, Y = ()> !RefUnwindSafe for SpatialSortingSystem<P, T, D, B, Y>
impl<P, T, D, B, Y> Send for SpatialSortingSystem<P, T, D, B, Y>where
B: Send,
D: Send,
P: Send,
T: Send,
Y: Send,
impl<P, T, D, B, Y> Sync for SpatialSortingSystem<P, T, D, B, Y>where
B: Sync,
D: Sync,
P: Sync,
T: Sync,
Y: Sync,
impl<P, T, D, B, Y> Unpin for SpatialSortingSystem<P, T, D, B, Y>where
B: Unpin,
D: Unpin,
P: Unpin,
T: Unpin,
Y: Unpin,
impl<P, T, D, B, Y = ()> !UnwindSafe for SpatialSortingSystem<P, T, D, B, Y>
Blanket Implementations
impl<T> Any for Twhere
T: Any,
impl<T> Any for Twhere
T: Any,
fn get_type_id(&self) -> TypeId
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<T> Pointable for T
impl<T> Pointable for T
sourceimpl<'a, T> RunWithPool<'a> for Twhere
T: System<'a>,
impl<'a, T> RunWithPool<'a> for Twhere
T: System<'a>,
sourcefn run(&mut self, res: &'a Resources, _: &ThreadPool)
fn run(&mut self, res: &'a Resources, _: &ThreadPool)
Runs the system/group of systems. Possibly in parallel depending
on how the structure is set up. Read more