pub struct Orientation { /* private fields */ }Expand description
Tracks the controller’s orientation from its motion samples.
Implementations§
Source§impl Orientation
impl Orientation
Sourcepub const DEFAULT_GAIN: f32 = 0.06
pub const DEFAULT_GAIN: f32 = 0.06
How strongly the accelerometer corrects the gyroscope once the filter has settled.
pub fn new() -> Orientation
Sourcepub fn set_gain(&mut self, gain: f32)
pub fn set_gain(&mut self, gain: f32)
Sets how strongly the accelerometer corrects the gyroscope. Higher values remove drift faster but let hand movement disturb pitch and roll more.
Sourcepub fn update_sample(&mut self, sample: &ImuSample)
pub fn update_sample(&mut self, sample: &ImuSample)
Feeds one sample. Samples must arrive in order.
Sourcepub fn step(&mut self, gyro: [f32; 3], accel: [f32; 3], dt: f32)
pub fn step(&mut self, gyro: [f32; 3], accel: [f32; 3], dt: f32)
Advances the filter by dt seconds with one gyroscope (rad/s) and accelerometer reading.
Sourcepub fn quaternion(&self) -> Quat
pub fn quaternion(&self) -> Quat
The current orientation: the rotation from the controller’s frame to the world frame.
Trait Implementations§
Source§impl Clone for Orientation
impl Clone for Orientation
Source§impl Debug for Orientation
impl Debug for Orientation
Source§impl Default for Orientation
impl Default for Orientation
Source§fn default() -> Orientation
fn default() -> Orientation
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Forget for Orientation
impl Freeze for Orientation
impl Move for Orientation
impl RefUnwindSafe for Orientation
impl Send for Orientation
impl Sync for Orientation
impl Unpin for Orientation
impl UnsafeUnpin for Orientation
impl UnwindSafe for Orientation
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more