Struct gilrs::ff::Direction [] [src]

pub struct Direction {
    pub angle: u16,
}

Direction of force feedback effect.

Angle is represented by value from 0 to u16::MAX, which map to [0, 2π].

use std::u16::MAX;
use std::f32::consts::PI;

let direction = Direction { angle: MAX / 2 };
assert_eq!(direction, Direction::from_radians(PI));
assert_eq!(direction, Direction::from_vector([-1.0, 0.0]));

Fields

Methods

impl Direction
[src]

Trait Implementations

impl Copy for Direction
[src]

impl Clone for Direction
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl PartialEq for Direction
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

impl Debug for Direction
[src]

Formats the value using the given formatter.

impl Default for Direction
[src]

Returns the "default value" for a type. Read more

impl From<[f32; 2]> for Direction
[src]

Performs the conversion.