pub struct CrumblePlatform { /* private fields */ }Expand description
A timed platform that disappears after contact, then regrows. Hosts exclude absent surfaces from collision and use phase/progress to telegraph the change.
Implementations§
Source§impl CrumblePlatform
impl CrumblePlatform
pub fn new(warning: f32, regrow: f32) -> Result<CrumblePlatform, LoopError>
pub fn phase(&self) -> PlatformPhase
pub fn solid(&self) -> bool
pub fn remaining(&self) -> f32
Sourcepub fn step(&mut self, dt: f32, contact: bool) -> Result<(), LoopError>
pub fn step(&mut self, dt: f32, contact: bool) -> Result<(), LoopError>
At most two transitions per step; regrowth never rearms on stale contact in the same update. Invalid time leaves the platform unchanged.
pub fn reset(&mut self)
Trait Implementations§
Source§impl Clone for CrumblePlatform
impl Clone for CrumblePlatform
Source§fn clone(&self) -> CrumblePlatform
fn clone(&self) -> CrumblePlatform
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for CrumblePlatform
impl Debug for CrumblePlatform
impl Copy for CrumblePlatform
Auto Trait Implementations§
impl Freeze for CrumblePlatform
impl RefUnwindSafe for CrumblePlatform
impl Send for CrumblePlatform
impl Sync for CrumblePlatform
impl Unpin for CrumblePlatform
impl UnwindSafe for CrumblePlatform
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