[][src]Struct gilrs::ff::EffectBuilder

pub struct EffectBuilder { /* fields omitted */ }

Creates new Effect.

Methods

impl EffectBuilder
[src]

pub fn new() -> Self
[src]

Creates new builder with following defaults: no gamepads, no base effects, repeat set to infinitely, no distance model, position in (0.0, 0.0, 0.0) and gain 1.0. Use finish() to create new effect.

pub fn add_effect(&mut self, effect: BaseEffect) -> &mut Self
[src]

Adds new BaseEffect.

pub fn gamepads(&mut self, ids: &[usize]) -> &mut Self
[src]

Changes gamepads that are associated with effect. Effect will be only played on gamepads from last call to this function.

pub fn add_gamepad(&mut self, gamepad: &Gamepad) -> &mut Self
[src]

Adds gamepad to the list of gamepads associated with effect.

pub fn repeat(&mut self, repeat: Repeat) -> &mut Self
[src]

Changes what should happen to effect when it ends.

pub fn distance_model(&mut self, model: DistanceModel) -> &mut Self
[src]

Changes distance model associated with effect.

pub fn position<Vec3f: Into<[f32; 3]>>(&mut self, position: Vec3f) -> &mut Self
[src]

Changes position of the source of effect.

pub fn gain(&mut self, gain: f32) -> &mut Self
[src]

Changes gain of the effect. gain will be clamped to [0.0, f32::MAX].

pub fn finish(&mut self, gilrs: &mut Gilrs) -> Result<Effect, Error>
[src]

Validates all parameters and creates new effect.

Errors

Returns Error::Disconnected(id) or Error::FfNotSupported(id) on first gamepad in ids that is disconnected or doesn't support force feedback.

Returns Error::InvalidDistanceModel if model is not valid. See DistanceModel for details.

Trait Implementations

impl Clone for EffectBuilder
[src]

fn clone_from(&mut self, source: &Self)
1.0.0
[src]

Performs copy-assignment from source. Read more

impl PartialEq<EffectBuilder> for EffectBuilder
[src]

impl Debug for EffectBuilder
[src]

Auto Trait Implementations

Blanket Implementations

impl<T> From for T
[src]

impl<T, U> Into for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

impl<T, U> TryFrom for T where
    T: From<U>, 
[src]

type Error = !

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

impl<T> Borrow for T where
    T: ?Sized
[src]

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

impl<T> BorrowMut for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]