Struct gilrs::ff::EffectBuilder
[−]
[src]
pub struct EffectBuilder { /* fields omitted */ }
Creates new Effect
.
Methods
impl EffectBuilder
[src]
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.
fn add_effect(&mut self, effect: BaseEffect) -> &mut Self
[src]
Adds new BaseEffect
.
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.
fn add_gamepad(&mut self, gamepad: &Gamepad) -> &mut Self
[src]
Adds gamepad to the list of gamepads associated with effect.
fn repeat(&mut self, repeat: Repeat) -> &mut Self
[src]
Changes what should happen to effect when it ends.
fn distance_model(&mut self, model: DistanceModel) -> &mut Self
[src]
Changes distance model associated with effect.
fn position<Vec3f: Into<[f32; 3]>>(&mut self, position: Vec3f) -> &mut Self
[src]
Changes position of the source of effect.
fn gain(&mut self, gain: f32) -> &mut Self
[src]
Changes gain of the effect. gain
will be clamped to [0.0, f32::MAX].
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(&self) -> EffectBuilder
[src]
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl PartialEq for EffectBuilder
[src]
fn eq(&self, __arg_0: &EffectBuilder) -> bool
[src]
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, __arg_0: &EffectBuilder) -> bool
[src]
This method tests for !=
.