pub struct Motion {
pub updated: bool,
pub key_mask: usize,
pub pos: Vector3<f64>,
pub phi: f64,
pub theta: f64,
pub speed: f64,
pub sens: f64,
pub fov: f64,
pub fov_sens: f64,
}Fields§
§updated: bool§key_mask: usize§pos: Vector3<f64>§phi: f64§theta: f64§speed: f64§sens: f64§fov: f64§fov_sens: f64Implementations§
Source§impl Motion
impl Motion
pub fn new(pos: Vector3<f64>, ori: Rotation3<f64>) -> Self
pub fn set_speed(&mut self, speed: f64)
pub fn set_sensitivity(&mut self, sens: f64)
pub fn pos(&self) -> Vector3<f64>
pub fn ori(&self) -> Rotation3<f64>
pub fn was_updated(&self) -> bool
pub fn step(&mut self, dt: Duration)
Trait Implementations§
Source§impl EventHandler for Motion
impl EventHandler for Motion
fn handle_keys(&mut self, _state: &WindowState, event: &Event) -> Result<()>
fn handle_mouse( &mut self, state: &WindowState, ms: &MouseState, rms: &RelativeMouseState, ) -> Result<()>
Auto Trait Implementations§
impl Freeze for Motion
impl RefUnwindSafe for Motion
impl Send for Motion
impl Sync for Motion
impl Unpin for Motion
impl UnwindSafe for Motion
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
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> SetParameter for T
impl<T> SetParameter for T
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self is actually part of its subset T (and can be converted to it).Source§unsafe fn to_subset_unchecked(&self) -> SS
unsafe fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.