Struct three::controls::first_person::Builder
source · pub struct Builder { /* private fields */ }
Expand description
Constructs custom FirstPerson
controls.
Implementations
sourceimpl Builder
impl Builder
sourcepub fn yaw(&mut self, yaw: f32) -> &mut Self
pub fn yaw(&mut self, yaw: f32) -> &mut Self
Set the initial yaw angle in radians.
Default is 0.0.
sourcepub fn pitch(&mut self, pitch: f32) -> &mut Self
pub fn pitch(&mut self, pitch: f32) -> &mut Self
Set the initial pitch angle in radians.
Defaults to 0.0.
sourcepub fn pitch_range(&mut self, range: Option<Range<f32>>) -> &mut Self
pub fn pitch_range(&mut self, range: Option<Range<f32>>) -> &mut Self
Set the initial pitch range in radians.
Defaults to Some(-PI / 2.0 .. PI / 2.0)
.
sourcepub fn position<P>(&mut self, position: P) -> &mut Selfwhere
P: Into<Point3<f32>>,
pub fn position<P>(&mut self, position: P) -> &mut Selfwhere
P: Into<Point3<f32>>,
Set the initial position.
Defaults to the world origin.
sourcepub fn move_speed(&mut self, speed: f32) -> &mut Self
pub fn move_speed(&mut self, speed: f32) -> &mut Self
Setup the movement speed in world units per second.
Defaults to 1.0 world units per second.
sourcepub fn look_speed(&mut self, speed: f32) -> &mut Self
pub fn look_speed(&mut self, speed: f32) -> &mut Self
Setup mouse sensitivity.
Defaults to 0.5
sourcepub fn vertical_movement(&mut self, value: bool) -> &mut Self
pub fn vertical_movement(&mut self, value: bool) -> &mut Self
Setup whether controlled object should move along y
axis when looking
down or up.
Defaults to true.
sourcepub fn vertical_look(&mut self, value: bool) -> &mut Self
pub fn vertical_look(&mut self, value: bool) -> &mut Self
Setup whether controlled object can adjust pitch using mouse.
Defaults to true.
sourcepub fn axis_forward(&mut self, axis: Option<Key>) -> &mut Self
pub fn axis_forward(&mut self, axis: Option<Key>) -> &mut Self
Setup key axis for moving forward/backward.
Defaults to W
and S
keys.
sourcepub fn axis_strafing(&mut self, axis: Option<Key>) -> &mut Self
pub fn axis_strafing(&mut self, axis: Option<Key>) -> &mut Self
Setup button for “strafing” left/right.
Defaults to A
and D
keys.
sourcepub fn axis_vertical(&mut self, axis: Option<Key>) -> &mut Self
pub fn axis_vertical(&mut self, axis: Option<Key>) -> &mut Self
Setup button for moving up/down.
Defaults to None
.
sourcepub fn build(&mut self) -> FirstPerson
pub fn build(&mut self) -> FirstPerson
Finalize builder and create new FirstPerson
controls.
Trait Implementations
impl StructuralPartialEq for Builder
Auto Trait Implementations
impl !RefUnwindSafe for Builder
impl !Send for Builder
impl !Sync for Builder
impl Unpin for Builder
impl !UnwindSafe for Builder
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<T> Pointable for T
impl<T> Pointable for T
impl<T> SetParameter for T
impl<T> SetParameter for T
fn set<T>(&mut self, value: T) -> <T as Parameter<Self>>::Resultwhere
T: Parameter<Self>,
fn set<T>(&mut self, value: T) -> <T as Parameter<Self>>::Resultwhere
T: Parameter<Self>,
value
as a parameter of self
.