pub trait Sleepable {
// Required methods
fn is_sleeping(&self) -> bool;
fn wake(&mut self);
fn sleep(&mut self);
// Provided method
fn should_sleep(
&self,
speed_sq: Real,
threshold_sq: Real,
accumulated_sleep_time: Real,
time_to_sleep: Real,
) -> bool { ... }
}Expand description
Trait for bodies that can sleep when below activity thresholds.
Required Methods§
Sourcefn is_sleeping(&self) -> bool
fn is_sleeping(&self) -> bool
Whether the body is currently sleeping.