[][src]Struct bevy_fly_camera::FlyCamera

pub struct FlyCamera {
    pub speed: f32,
    pub max_speed: f32,
    pub sensitivity: f32,
    pub friction: f32,
    pub pitch: f32,
    pub yaw: f32,
    pub velocity: Vec3,
    pub key_forward: KeyCode,
    pub key_backward: KeyCode,
    pub key_left: KeyCode,
    pub key_right: KeyCode,
    pub key_up: KeyCode,
    pub key_down: KeyCode,
    pub enabled: bool,
}

A set of options for initializing a FlyCamera. Attach this component to a Camera3dComponents bundle to control it with your mouse and keyboard.

Example

fn setup(mut commands: Commands) {
	commands
		.spawn(Camera3dComponents::default())
		.with(FlyCamera::default());
}

Fields

speed: f32

The speed the FlyCamera moves at. Defaults to 1.0

max_speed: f32

The maximum speed the FlyCamera can move at. Defaults to 0.5

sensitivity: f32

The sensitivity of the FlyCamera's motion based on mouse movement. Defaults to 3.0

friction: f32

The amount of deceleration to apply to the camera's motion. Defaults to 1.0

pitch: f32

The current pitch of the FlyCamera in degrees. This value is always up-to-date, enforced by FlyCameraPlugin

yaw: f32

The current pitch of the FlyCamera in degrees. This value is always up-to-date, enforced by FlyCameraPlugin

velocity: Vec3

The current velocity of the FlyCamera. This value is always up-to-date, enforced by FlyCameraPlugin

key_forward: KeyCode

Key used to move forward. Defaults to W

key_backward: KeyCode

Key used to move backward. Defaults to `S

key_left: KeyCode

Key used to move left. Defaults to A

key_right: KeyCode

Key used to move right. Defaults to D

key_up: KeyCode

Key used to move up. Defaults to Space

key_down: KeyCode

Key used to move forward. Defaults to LShift

enabled: bool

If false, disable keyboard control of the camera. Defaults to true

Trait Implementations

impl Default for FlyCamera[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Any for T where
    T: Any

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Component for T where
    T: 'static + Send + Sync

impl<T> Downcast for T where
    T: Any

impl<T> DowncastSync for T where
    T: Send + Sync + Any

impl<T> From<T> for T[src]

impl<T> FromResources for T where
    T: Default

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Resource for T where
    T: 'static + Send + Sync

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,