pub struct Pulse {
pub interval: f32,
pub trigger_limit: u32,
pub trigger_on_start: bool,
pub actuation: f32,
/* private fields */
}Expand description
Returns ActionState::Ongoing when input becomes actuated and ActionState::Fired
each Self::interval seconds.
Note: Completed only fires
when the repeat limit is reached or when input is released immediately after being triggered.
Otherwise, Canceled is fired when input is released.
Fields§
§interval: f32Time in seconds between each triggering while input is held.
trigger_limit: u32Number of times the condition can be triggered (0 means no limit).
trigger_on_start: boolWhether to trigger when the input first exceeds the actuation threshold or wait for the first interval.
actuation: f32Trigger threshold.
Implementations§
Source§impl Pulse
impl Pulse
pub fn new(interval: f32) -> Self
pub fn with_trigger_limit(self, trigger_limit: u32) -> Self
pub fn trigger_on_start(self, trigger_on_start: bool) -> Self
pub fn with_actuation(self, actuation: f32) -> Self
Sourcepub fn relative_speed(self, relative: bool) -> Self
pub fn relative_speed(self, relative: bool) -> Self
Enables or disables time dilation.
Trait Implementations§
Source§impl InputCondition for Pulse
impl InputCondition for Pulse
Source§fn evaluate(
&mut self,
_action_map: &ActionMap,
time: &Time<Virtual>,
value: ActionValue,
) -> ActionState
fn evaluate( &mut self, _action_map: &ActionMap, time: &Time<Virtual>, value: ActionValue, ) -> ActionState
Returns calculates state. Read more
Source§fn kind(&self) -> ConditionKind
fn kind(&self) -> ConditionKind
Returns how the condition is combined with others.
impl Copy for Pulse
Auto Trait Implementations§
impl Freeze for Pulse
impl RefUnwindSafe for Pulse
impl Send for Pulse
impl Sync for Pulse
impl Unpin for Pulse
impl UnwindSafe for Pulse
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<I> IntoConditions for Iwhere
I: InputCondition,
impl<I> IntoConditions for Iwhere
I: InputCondition,
Source§fn into_conditions(self) -> impl Iterator<Item = Box<dyn InputCondition>>
fn into_conditions(self) -> impl Iterator<Item = Box<dyn InputCondition>>
Returns an iterator over conditions.
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