pub struct SleepTest {
pub dormant_frames: Vec<u32>,
pub sleep_states: Vec<SleepState>,
}Expand description
Tests whether a rigid body should transition to or from sleeping.
Fields§
§dormant_frames: Vec<u32>Per-body consecutive dormant frame counter.
sleep_states: Vec<SleepState>Per-body current sleep state.
Implementations§
Source§impl SleepTest
impl SleepTest
Sourcepub fn update(
&mut self,
states: &[RigidBodyState],
params: &SleepParams,
) -> usize
pub fn update( &mut self, states: &[RigidBodyState], params: &SleepParams, ) -> usize
Update sleep states for all bodies given the current states.
Returns the number of bodies that transitioned to sleep this step.
Sourcepub fn sleeping_count(&self) -> usize
pub fn sleeping_count(&self) -> usize
Return the number of sleeping bodies.
Auto Trait Implementations§
impl Freeze for SleepTest
impl RefUnwindSafe for SleepTest
impl Send for SleepTest
impl Sync for SleepTest
impl Unpin for SleepTest
impl UnsafeUnpin for SleepTest
impl UnwindSafe for SleepTest
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more