Function avian3d::dynamics::sleeping::mark_sleeping_bodies
source · pub fn mark_sleeping_bodies(
commands: Commands<'_, '_>,
query: Query<'_, '_, (Entity, &RigidBody, &mut LinearVelocity, &mut AngularVelocity, &mut TimeSleeping, &CollidingEntities), (Without<Sleeping>, Without<SleepingDisabled>)>,
rb_query: Query<'_, '_, &RigidBody>,
deactivation_time: Res<'_, DeactivationTime>,
sleep_threshold: Res<'_, SleepingThreshold>,
length_unit: Res<'_, PhysicsLengthUnit>,
time: Res<'_, Time>
)
Expand description
Adds the Sleeping
component to bodies whose linear and anigular velocities have been
under the SleepingThreshold
for a duration indicated by DeactivationTime
.