#[repr(C)]
pub struct SDL_HapticCondition { pub type_: Uint16, pub direction: SDL_HapticDirection, pub length: Uint32, pub delay: Uint16, pub button: Uint16, pub interval: Uint16, pub right_sat: [Uint16; 3], pub left_sat: [Uint16; 3], pub right_coeff: [Sint16; 3], pub left_coeff: [Sint16; 3], pub deadband: [Uint16; 3], pub center: [Sint16; 3], }
Expand description

\brief A structure containing a template for a Condition effect.

The struct handles the following effects:

  • ::SDL_HAPTIC_SPRING: Effect based on axes position.
  • ::SDL_HAPTIC_DAMPER: Effect based on axes velocity.
  • ::SDL_HAPTIC_INERTIA: Effect based on axes acceleration.
  • ::SDL_HAPTIC_FRICTION: Effect based on axes movement.

Direction is handled by condition internals instead of a direction member. The condition effect specific members have three parameters. The first refers to the X axis, the second refers to the Y axis and the third refers to the Z axis. The right terms refer to the positive side of the axis and the left terms refer to the negative side of the axis. Please refer to the ::SDL_HapticDirection diagram for which side is positive and which is negative.

\sa SDL_HapticDirection \sa SDL_HAPTIC_SPRING \sa SDL_HAPTIC_DAMPER \sa SDL_HAPTIC_INERTIA \sa SDL_HAPTIC_FRICTION \sa SDL_HapticEffect

Fields§

§type_: Uint16

< ::SDL_HAPTIC_SPRING, ::SDL_HAPTIC_DAMPER, ::SDL_HAPTIC_INERTIA or ::SDL_HAPTIC_FRICTION

§direction: SDL_HapticDirection

< Direction of the effect - Not used ATM.

§length: Uint32

< Duration of the effect.

§delay: Uint16

< Delay before starting the effect.

§button: Uint16

< Button that triggers the effect.

§interval: Uint16

< How soon it can be triggered again after button.

§right_sat: [Uint16; 3]

< Level when joystick is to the positive side; max 0xFFFF.

§left_sat: [Uint16; 3]

< Level when joystick is to the negative side; max 0xFFFF.

§right_coeff: [Sint16; 3]

< How fast to increase the force towards the positive side.

§left_coeff: [Sint16; 3]

< How fast to increase the force towards the negative side.

§deadband: [Uint16; 3]

< Size of the dead zone; max 0xFFFF: whole axis-range when 0-centered.

§center: [Sint16; 3]

< Position of the dead zone.

Trait Implementations§

source§

impl Clone for SDL_HapticCondition

source§

fn clone(&self) -> SDL_HapticCondition

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Copy for SDL_HapticCondition

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

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

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.