avian3d::dynamics::sleeping

Function mark_sleeping_bodies

source
pub fn mark_sleeping_bodies(
    commands: Commands<'_, '_>,
    query: Query<'_, '_, (Entity, &RigidBody, &mut LinearVelocity, &mut AngularVelocity, &mut TimeSleeping), (Without<Sleeping>, Without<SleepingDisabled>)>,
    collisions: Res<'_, Collisions>,
    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.