pub struct FirstPerson { /* private fields */ }
Expand description
Controls for first person camera.
Implementations§
Source§impl FirstPerson
impl FirstPerson
Sourcepub fn default<T: Object>(object: &T) -> Self
pub fn default<T: Object>(object: &T) -> Self
Create FirstPerson
controls with default parameters.
Sourcepub fn pitch_range(&mut self, range: Option<Range<f32>>) -> &mut Self
pub fn pitch_range(&mut self, range: Option<Range<f32>>) -> &mut Self
Sets the pitch range in radians.
Sourcepub fn set_position<P>(&mut self, position: P) -> &mut Self
pub fn set_position<P>(&mut self, position: P) -> &mut Self
Sets the object position.
Sourcepub fn set_move_speed(&mut self, speed: f32) -> &mut Self
pub fn set_move_speed(&mut self, speed: f32) -> &mut Self
Sets the movement speed in world units per second.
Sourcepub fn set_look_speed(&mut self, speed: f32) -> &mut Self
pub fn set_look_speed(&mut self, speed: f32) -> &mut Self
Sets the mouse sensitivity.
Sourcepub fn set_vertical_movement(&mut self, value: bool) -> &mut Self
pub fn set_vertical_movement(&mut self, value: bool) -> &mut Self
Specifies whether controlled object should move along y
axis when looking
down or up.
Sourcepub fn set_vertical_look(&mut self, value: bool) -> &mut Self
pub fn set_vertical_look(&mut self, value: bool) -> &mut Self
Specifies whether controlled object can adjust pitch using mouse.
Sourcepub fn set_axis_forward(&mut self, axis: Option<Key>) -> &mut Self
pub fn set_axis_forward(&mut self, axis: Option<Key>) -> &mut Self
Sets the key axis for moving forward/backward.
Sourcepub fn set_axis_strafing(&mut self, axis: Option<Key>) -> &mut Self
pub fn set_axis_strafing(&mut self, axis: Option<Key>) -> &mut Self
Sets the button for “strafing” left/right.
Sourcepub fn set_axis_vertical(&mut self, axis: Option<Key>) -> &mut Self
pub fn set_axis_vertical(&mut self, axis: Option<Key>) -> &mut Self
Sets button for moving up/down.
Trait Implementations§
Source§impl Clone for FirstPerson
impl Clone for FirstPerson
Source§fn clone(&self) -> FirstPerson
fn clone(&self) -> FirstPerson
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for FirstPerson
impl Debug for FirstPerson
Source§impl PartialEq for FirstPerson
impl PartialEq for FirstPerson
impl StructuralPartialEq for FirstPerson
Auto Trait Implementations§
impl Freeze for FirstPerson
impl !RefUnwindSafe for FirstPerson
impl !Send for FirstPerson
impl !Sync for FirstPerson
impl Unpin for FirstPerson
impl !UnwindSafe for FirstPerson
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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 more