Struct rhusics::collide::ecs::SpatialCollisionSystem
[−]
[src]
pub struct SpatialCollisionSystem<P, T, D> where
P: Primitive,
P::Aabb: Aabb<Scalar = f32> + Clone + Debug, { /* fields omitted */ }
Collision detection system for use with
specs
.
Will perform spatial sorting of the collision world.
Has support for both broad phase and narrow phase collision detection. Will only do narrow phase if both broad and narrow phase is activated. If no broad phase is set, it will use a DBVT based broad phase that has complexity O(m log2 n), where m is the number of shapes that have a dirty pose.
Can handle any transform component type, as long as the type implements
Transform
, and as long as the
storage is wrapped in
FlaggedStorage
.
Methods
impl<P, T, D> SpatialCollisionSystem<P, T, D> where
P: Primitive + Send + Sync + 'static,
<P::Point as EuclideanSpace>::Diff: Debug,
P::Aabb: Clone + Debug + Send + Sync + 'static + Aabb<Scalar = f32> + Union<P::Aabb, Output = P::Aabb> + Contains<P::Aabb> + SurfaceArea<Scalar = f32>,
T: Transform<P::Point> + Component,
D: HasBound<Bound = P::Aabb>,
[src]
P: Primitive + Send + Sync + 'static,
<P::Point as EuclideanSpace>::Diff: Debug,
P::Aabb: Clone + Debug + Send + Sync + 'static + Aabb<Scalar = f32> + Union<P::Aabb, Output = P::Aabb> + Contains<P::Aabb> + SurfaceArea<Scalar = f32>,
T: Transform<P::Point> + Component,
D: HasBound<Bound = P::Aabb>,
fn new() -> Self
[src]
Create a new collision detection system, with no broad or narrow phase activated.
fn with_narrow_phase<N: NarrowPhase<P, T> + 'static>(self, narrow: N) -> Self
[src]
Specify what narrow phase algorithm to use
fn with_broad_phase<B: BroadPhase<D> + 'static>(self, broad: B) -> Self
[src]
Specify what broad phase algorithm to use
Trait Implementations
impl<'a, P, T, D> System<'a> for SpatialCollisionSystem<P, T, (usize, D)> where
P: Primitive + Send + Sync + 'static,
P::Aabb: Clone + Debug + Send + Sync + 'static + Aabb<Scalar = f32> + Discrete<P::Aabb> + Contains<P::Aabb> + SurfaceArea<Scalar = f32>,
<P::Point as EuclideanSpace>::Diff: Debug + Send + Sync + 'static,
P::Point: Debug + Send + Sync + 'static,
T: Component + Clone + Debug + Transform<P::Point> + Send + Sync + 'static,
&'b T::Storage: Join<Type = &'b T>,
D: Send + Sync + 'static + TreeValue<Bound = P::Aabb> + HasBound<Bound = P::Aabb> + GetEntity,
[src]
P: Primitive + Send + Sync + 'static,
P::Aabb: Clone + Debug + Send + Sync + 'static + Aabb<Scalar = f32> + Discrete<P::Aabb> + Contains<P::Aabb> + SurfaceArea<Scalar = f32>,
<P::Point as EuclideanSpace>::Diff: Debug + Send + Sync + 'static,
P::Point: Debug + Send + Sync + 'static,
T: Component + Clone + Debug + Transform<P::Point> + Send + Sync + 'static,
&'b T::Storage: Join<Type = &'b T>,
D: Send + Sync + 'static + TreeValue<Bound = P::Aabb> + HasBound<Bound = P::Aabb> + GetEntity,
type SystemData = (Entities<'a>, ReadStorage<'a, T>, ReadStorage<'a, NextFrame<T>>, ReadStorage<'a, CollisionShape<P, T>>, Option<FetchMut<'a, Contacts<P::Point>>>, Option<FetchMut<'a, EventHandler<ContactEvent<Entity, P::Point>>>>, FetchMut<'a, DynamicBoundingVolumeTree<D>>)
The resource bundle required to execute this system. Read more
fn run(&mut self, system_data: Self::SystemData)
[src]
Executes the system with the required system data. Read more
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