Struct gilrs::ff::Effect
[−]
[src]
pub struct Effect { /* fields omitted */ }
Handle to force feedback effect.
Effect
represents force feedback effect that can be played on one or more gamepads. It uses a
form of reference counting, so it can be cheaply cloned. To create new Effect
use
EffectBuilder
.
All methods on can return Error::SendFailed
although it shouldn't normally happen.
Methods
impl Effect
[src]
fn play(&self) -> Result<(), Error>
[src]
Plays effect on all associated gamepads.
fn set_gamepads(&self, ids: &[usize], gilrs: &Gilrs) -> Result<(), Error>
[src]
Changes gamepads that are associated with effect. Effect will be only played on gamepads from last call to this function.
Errors
Returns Error::Disconnected(id)
or Error::FfNotSupported(id)
on first gamepad in ids
that is disconnected or doesn't support force feedback.
fn add_gamepad(&self, gamepad: &Gamepad) -> Result<(), Error>
[src]
Adds gamepad to the list of gamepads associated with effect.
Errors
Returns Error::Disconnected(id)
or Error::FfNotSupported(id)
if gamepad is not connected
or does not support force feedback.
fn set_repeat(&self, repeat: Repeat) -> Result<(), Error>
[src]
Changes what should happen to effect when it ends.
fn set_distance_model(&self, model: DistanceModel) -> Result<(), Error>
[src]
Changes distance model associated with effect.
Errors
Returns Error::InvalidDistanceModel
if model
is not valid. See
DistanceModel
for details.
fn set_position<Vec3f: Into<[f32; 3]>>(
&self,
position: Vec3f
) -> Result<(), Error>
[src]
&self,
position: Vec3f
) -> Result<(), Error>
Changes position of the source of effect.
fn set_gain(&self, gain: f32) -> Result<(), Error>
[src]
Changes gain of the effect. gain
will be clamped to [0.0, f32::MAX].
Trait Implementations
impl PartialEq for Effect
[src]
fn eq(&self, other: &Effect) -> bool
[src]
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
This method tests for !=
.
impl Eq for Effect
[src]
impl Hash for Effect
[src]
fn hash<H: Hasher>(&self, state: &mut H)
[src]
Feeds this value into the given [Hasher
]. Read more
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
Feeds a slice of this type into the given [Hasher
]. Read more
impl Clone for Effect
[src]
fn clone(&self) -> Self
[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