Struct rhusics_ecs::RigidBodyParts [−][src]
pub struct RigidBodyParts<'a, P, Y, R, V, A, I, B, T> where
T: Pose<P::Point, R> + Clone + Component + Send + Sync + 'static,
P: Primitive + Send + Sync + 'static,
B: Bound<Point = P::Point> + Send + Sync + 'static,
P::Point: EuclideanSpace<Scalar = V::Scalar> + Send + Sync + 'static,
V::Scalar: BaseFloat + Send + Sync + 'static,
V: VectorSpace + Zero + Clone + Send + Sync + 'static,
A: Copy + Zero + Clone + Send + Sync + 'static,
Y: Send + Sync + 'static,
I: Send + Sync + 'static,
R: Rotation<P::Point> + Send + Sync + 'static, { pub shapes: WriteStorage<'a, CollisionShape<P, T, B, Y>>, pub poses: WriteStorage<'a, T>, pub bodies: WriteStorage<'a, RigidBody<V::Scalar>>, pub masses: WriteStorage<'a, Mass<V::Scalar, I>>, pub velocities: WriteStorage<'a, Velocity<V, A>>, pub next_poses: WriteStorage<'a, NextFrame<T>>, pub next_velocities: WriteStorage<'a, NextFrame<Velocity<V, A>>>, pub forces: WriteStorage<'a, ForceAccumulator<V, A>>, // some fields omitted }
SystemData for easier creation of rigid bodies.
Type parameters:
P
: Collision PrimitiveY
: ColliderR
: Rotational quantityV
: Linear velocityA
: Angular velocityI
: InertiaB
: Bounding volumeT
: Transform
Fields
shapes: WriteStorage<'a, CollisionShape<P, T, B, Y>>
Collision shapes
poses: WriteStorage<'a, T>
Body transforms
bodies: WriteStorage<'a, RigidBody<V::Scalar>>
Bodies
masses: WriteStorage<'a, Mass<V::Scalar, I>>
Mass
velocities: WriteStorage<'a, Velocity<V, A>>
Velocity
next_poses: WriteStorage<'a, NextFrame<T>>
Next frame transform
next_velocities: WriteStorage<'a, NextFrame<Velocity<V, A>>>
Next frame velocity
forces: WriteStorage<'a, ForceAccumulator<V, A>>
Forces
Methods
impl<'a, P, Y, R, V, A, I, B, T> RigidBodyParts<'a, P, Y, R, V, A, I, B, T> where
T: Pose<P::Point, R> + Clone + Component + Send + Sync + 'static,
P: Primitive + Send + Sync + 'static,
B: Bound<Point = P::Point> + Send + Sync + 'static,
P::Point: EuclideanSpace<Scalar = V::Scalar> + Send + Sync + 'static,
V::Scalar: BaseFloat + Send + Sync + 'static,
V: VectorSpace + Zero + Clone + Send + Sync + 'static,
A: Copy + Zero + Clone + Send + Sync + 'static,
Y: Send + Sync + 'static,
I: Send + Sync + 'static,
R: Rotation<P::Point> + Send + Sync + 'static,
[src]
impl<'a, P, Y, R, V, A, I, B, T> RigidBodyParts<'a, P, Y, R, V, A, I, B, T> where
T: Pose<P::Point, R> + Clone + Component + Send + Sync + 'static,
P: Primitive + Send + Sync + 'static,
B: Bound<Point = P::Point> + Send + Sync + 'static,
P::Point: EuclideanSpace<Scalar = V::Scalar> + Send + Sync + 'static,
V::Scalar: BaseFloat + Send + Sync + 'static,
V: VectorSpace + Zero + Clone + Send + Sync + 'static,
A: Copy + Zero + Clone + Send + Sync + 'static,
Y: Send + Sync + 'static,
I: Send + Sync + 'static,
R: Rotation<P::Point> + Send + Sync + 'static,
pub fn new(world: &'a World) -> Self
[src]
pub fn new(world: &'a World) -> Self
Extract rigid body storage from World
pub fn static_body(
&mut self,
entity: Entity,
shape: CollisionShape<P, T, B, Y>,
pose: T,
body: RigidBody<V::Scalar>,
mass: Mass<V::Scalar, I>
) -> Result<(), RigidBodyCreationError>
[src]
pub fn static_body(
&mut self,
entity: Entity,
shape: CollisionShape<P, T, B, Y>,
pose: T,
body: RigidBody<V::Scalar>,
mass: Mass<V::Scalar, I>
) -> Result<(), RigidBodyCreationError>
Setup static rigid body for given entity.
pub fn dynamic_body(
&mut self,
entity: Entity,
shape: CollisionShape<P, T, B, Y>,
pose: T,
velocity: Velocity<V, A>,
body: RigidBody<V::Scalar>,
mass: Mass<V::Scalar, I>
) -> Result<(), RigidBodyCreationError>
[src]
pub fn dynamic_body(
&mut self,
entity: Entity,
shape: CollisionShape<P, T, B, Y>,
pose: T,
velocity: Velocity<V, A>,
body: RigidBody<V::Scalar>,
mass: Mass<V::Scalar, I>
) -> Result<(), RigidBodyCreationError>
Setup dynamic rigid body for given entity.
Trait Implementations
impl<'a, P, Y, R, V, A, I, B, T> SystemData<'a> for RigidBodyParts<'a, P, Y, R, V, A, I, B, T> where
T: Pose<P::Point, R> + Clone + Component + Send + Sync + 'static,
P: Primitive + Send + Sync + 'static,
B: Bound<Point = P::Point> + Send + Sync + 'static,
P::Point: EuclideanSpace<Scalar = V::Scalar> + Send + Sync + 'static,
V::Scalar: BaseFloat + Send + Sync + 'static,
V: VectorSpace + Zero + Clone + Send + Sync + 'static,
A: Copy + Zero + Clone + Send + Sync + 'static,
Y: Send + Sync + 'static,
I: Send + Sync + 'static,
R: Rotation<P::Point> + Send + Sync + 'static,
WriteStorage<'a, CollisionShape<P, T, B, Y>>: SystemData<'a>,
WriteStorage<'a, T>: SystemData<'a>,
WriteStorage<'a, RigidBody<V::Scalar>>: SystemData<'a>,
WriteStorage<'a, Mass<V::Scalar, I>>: SystemData<'a>,
WriteStorage<'a, Velocity<V, A>>: SystemData<'a>,
WriteStorage<'a, NextFrame<T>>: SystemData<'a>,
WriteStorage<'a, NextFrame<Velocity<V, A>>>: SystemData<'a>,
WriteStorage<'a, ForceAccumulator<V, A>>: SystemData<'a>,
PhantomData<R>: SystemData<'a>,
[src]
impl<'a, P, Y, R, V, A, I, B, T> SystemData<'a> for RigidBodyParts<'a, P, Y, R, V, A, I, B, T> where
T: Pose<P::Point, R> + Clone + Component + Send + Sync + 'static,
P: Primitive + Send + Sync + 'static,
B: Bound<Point = P::Point> + Send + Sync + 'static,
P::Point: EuclideanSpace<Scalar = V::Scalar> + Send + Sync + 'static,
V::Scalar: BaseFloat + Send + Sync + 'static,
V: VectorSpace + Zero + Clone + Send + Sync + 'static,
A: Copy + Zero + Clone + Send + Sync + 'static,
Y: Send + Sync + 'static,
I: Send + Sync + 'static,
R: Rotation<P::Point> + Send + Sync + 'static,
WriteStorage<'a, CollisionShape<P, T, B, Y>>: SystemData<'a>,
WriteStorage<'a, T>: SystemData<'a>,
WriteStorage<'a, RigidBody<V::Scalar>>: SystemData<'a>,
WriteStorage<'a, Mass<V::Scalar, I>>: SystemData<'a>,
WriteStorage<'a, Velocity<V, A>>: SystemData<'a>,
WriteStorage<'a, NextFrame<T>>: SystemData<'a>,
WriteStorage<'a, NextFrame<Velocity<V, A>>>: SystemData<'a>,
WriteStorage<'a, ForceAccumulator<V, A>>: SystemData<'a>,
PhantomData<R>: SystemData<'a>,
fn setup(res: &mut Resources)
[src]
fn setup(res: &mut Resources)
Sets up the system data for fetching it from the Resources
.
fn fetch(res: &'a Resources) -> Self
[src]
fn fetch(res: &'a Resources) -> Self
Fetches the system data from Resources
. Note that this is only specified for one concrete lifetime 'a
, you need to implement the SystemData
trait for every possible lifetime. Read more
fn reads() -> Vec<ResourceId>
[src]
fn reads() -> Vec<ResourceId>
Returns all read dependencies as fetched from Self::fetch
. Read more
fn writes() -> Vec<ResourceId>
[src]
fn writes() -> Vec<ResourceId>
Returns all write dependencies as fetched from Self::fetch
. Read more
Auto Trait Implementations
impl<'a, P, Y, R, V, A, I, B, T> Send for RigidBodyParts<'a, P, Y, R, V, A, I, B, T> where
<T as Component>::Storage: Send,
impl<'a, P, Y, R, V, A, I, B, T> Send for RigidBodyParts<'a, P, Y, R, V, A, I, B, T> where
<T as Component>::Storage: Send,
impl<'a, P, Y, R, V, A, I, B, T> Sync for RigidBodyParts<'a, P, Y, R, V, A, I, B, T> where
<T as Component>::Storage: Sync,
impl<'a, P, Y, R, V, A, I, B, T> Sync for RigidBodyParts<'a, P, Y, R, V, A, I, B, T> where
<T as Component>::Storage: Sync,