pub struct CameraController {
pub free_fly: bool,
pub move_speed: f32,
pub sprint_multiplier: f32,
pub mouse_sensitivity: f32,
pub player_radius: f32,
pub bounds_min: [f32; 3],
pub bounds_max: [f32; 3],
pub follow: Option<FollowController>,
}Expand description
First-person / fly-through controller settings carried on a Camera3D.
A Camera3D whose controller is set (the default) is driven each frame by
the internal camera controller, which turns mouse/keyboard input into a
camera orientation and a movement intent. Set controller to null for a
camera driven by something else (a CameraShot / Scene cutscene).
Fields§
§free_fly: boolDirect 6-DoF flight mode. WASD moves along the camera’s full forward
vector (yaw + pitch) and jump rises along world +Y; the controller
writes the new position straight onto Camera3D, bypassing the physics
step and the bounds box. Used for inspector / fly-through cameras (the
default, e.g. the cn add foo.glb scaffold). Set false for the
FPS-style ground walker.
move_speed: f32Walk / fly speed in world units per second.
sprint_multiplier: f32Sprint multiplier applied when the sprint key is held.
mouse_sensitivity: f32Mouse look sensitivity in radians per pixel.
player_radius: f32Margin kept between the camera and the bounds box (world units).
bounds_min: [f32; 3]AABB minimum corner the camera centre must stay inside [x, y, z].
bounds_max: [f32; 3]AABB maximum corner the camera centre must stay inside [x, y, z].
follow: Option<FollowController>Third-person follow settings; see FollowController.
When set, the camera orbits the followed character and WASD steers the
character instead of the camera (free_fly and the bounds box are
ignored). null (the default) keeps the first-person / fly modes.
Trait Implementations§
Source§impl Clone for CameraController
impl Clone for CameraController
Source§fn clone(&self) -> CameraController
fn clone(&self) -> CameraController
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for CameraController
impl Debug for CameraController
Source§impl Default for CameraController
impl Default for CameraController
Source§fn default() -> CameraController
fn default() -> CameraController
Source§impl<'de> Deserialize<'de> for CameraControllerwhere
CameraController: Default,
impl<'de> Deserialize<'de> for CameraControllerwhere
CameraController: Default,
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<CameraController, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<CameraController, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Source§impl Serialize for CameraController
impl Serialize for CameraController
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Auto Trait Implementations§
impl Freeze for CameraController
impl RefUnwindSafe for CameraController
impl Send for CameraController
impl Sync for CameraController
impl Unpin for CameraController
impl UnsafeUnpin for CameraController
impl UnwindSafe for CameraController
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
impl<S, T> Duplex<S> for Twhere
T: FromSample<S> + ToSample<S>,
Source§impl<S> FromSample<S> for S
impl<S> FromSample<S> for S
fn from_sample_(s: S) -> S
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
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> ⓘ
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> ⓘ
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<F, T> IntoSample<T> for Fwhere
T: FromSample<F>,
impl<F, T> IntoSample<T> for Fwhere
T: FromSample<F>,
fn into_sample(self) -> T
Source§impl<T> Pointable for T
impl<T> Pointable for T
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<R, P> ReadPrimitive<R> for P
impl<R, P> ReadPrimitive<R> for P
Source§fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
ReadEndian::read_from_little_endian().