Struct FlyCamera
pub struct FlyCamera {
pub position: [f64; 3],
pub velocity: [f64; 3],
pub yaw_rad: f64,
pub pitch_rad: f64,
pub move_speed: f64,
pub drag: f64,
}Expand description
6-DOF Free-flight camera with velocity damping for editor, debug, and free inspection.
Fields§
§position: [f64; 3]§velocity: [f64; 3]§yaw_rad: f64§pitch_rad: f64§move_speed: f64§drag: f64Implementations§
§impl FlyCamera
impl FlyCamera
pub fn orientation_basis(&self) -> ([f64; 3], [f64; 3], [f64; 3])
pub fn orientation_basis(&self) -> ([f64; 3], [f64; 3], [f64; 3])
Computes unit forward, right, and up vectors from current orientation.
pub fn update(&mut self, wish_dir: [f64; 3], dt: f64)
pub fn update(&mut self, wish_dir: [f64; 3], dt: f64)
Advances flycam position with smooth drag.
wish_dir: Local input direction [forward/back, right/left, up/down].
Trait Implementations§
impl Copy for FlyCamera
impl StructuralPartialEq for FlyCamera
Auto Trait Implementations§
impl Freeze for FlyCamera
impl RefUnwindSafe for FlyCamera
impl Send for FlyCamera
impl Sync for FlyCamera
impl Unpin for FlyCamera
impl UnsafeUnpin for FlyCamera
impl UnwindSafe for FlyCamera
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