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
angle: u16
Methods
impl Direction
[src]
fn from_radians(ang: f32) -> Self
fn from_vector(vec: [f32; 2]) -> Self
Trait Implementations
impl Copy for Direction
[src]
impl Clone for Direction
[src]
fn clone(&self) -> Direction
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0
Performs copy-assignment from source
. Read more
impl PartialEq for Direction
[src]
fn eq(&self, __arg_0: &Direction) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, __arg_0: &Direction) -> bool
This method tests for !=
.