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 more