Repository: bevyengine/bevy
File: examples/camera/free_cam_controller.rs (Rust)

Code before:
//! This controller has a simple 6-axis control scheme, and mouse controls for camera orientation. There are also
//! bindings for capturing the mouse, both while holding the button and toggle, a run feature that increases the
//! max speed, and scrolling changes the movement speed. All keybinds can be changed by editing the [`FreeCam`]
//! component.
//!
//! | Default Key Binding | Action                 |
//! |:--------------------|:-----------------------|
//! | Mouse               | Look around            |
//! | Left click          | Capture mouse (hold)   |
//! | M                   | Capture mouse (toggle) |
//! | WASD                | Horizontal movement    |
//! | QE                  | Vertical movement      |
//! | Left shift          | Run                    |
//! | Scroll wheel        | Change movement speed  |
//!
//! The movement speed, sensitivity and friction can also be changed by the [`FreeCam`] component.
//!
//! ## Example controls
//!
//! This example also provides a few extra keybinds to change the camera sensitivity, friction (how fast the camera
//! stops), scroll factor (how much scrolling changes speed) and enabling/disabling the controller.
//!
//! | Key Binding | Action                 |
//! |:------------|:-----------------------|
//! | Z           | Decrease sensitivity   |
//! | X           | Increase snsitivity    |
//! | C           | Decrease friction      |
//! | V           | Increase friction      |
//! | F           | Decrease scroll factor |
//! | G           | Increase scroll factor |
//! | B           | Enable/Disable         |

use std::f32::consts::{FRAC_PI_4, PI};

use bevy::{
    camera_controller::free_cam::{FreeCam, FreeCamPlugin},
    color::palettes::tailwind,
    prelude::*,
};

fn main() {
    App::new()
        .add_plugins(DefaultPlugins)
        // Plugin that enables freecam functionality
        .add_plugins(FreeCamPlugin)
        // Example code plugins
        .add_plugins((CameraPlugin, CameraSettingsPlugin, ScenePlugin))
        .run();
}

// Plugin that spawns the camera.

Review comment (suggestion):
```suggestion
//! | X           | Increase sensitivity    |
```

Code after:
//! This controller has a simple 6-axis control scheme, and mouse controls for camera orientation. There are also
//! bindings for capturing the mouse, both while holding the button and toggle, a run feature that increases the
//! max speed, and scrolling changes the movement speed. All keybinds can be changed by editing the [`FreeCam`]
//! component.
//!
//! | Default Key Binding | Action                 |
//! |:--------------------|:-----------------------|
//! | Mouse               | Look around            |
//! | Left click          | Capture mouse (hold)   |
//! | M                   | Capture mouse (toggle) |
//! | WASD                | Horizontal movement    |
//! | QE                  | Vertical movement      |
//! | Left shift          | Run                    |
//! | Scroll wheel        | Change movement speed  |
//!
//! The movement speed, sensitivity and friction can also be changed by the [`FreeCam`] component.
//!
//! ## Example controls
//!
//! This example also provides a few extra keybinds to change the camera sensitivity, friction (how fast the camera
//! stops), scroll factor (how much scrolling changes speed) and enabling/disabling the controller.
//!
//! | Key Binding | Action                 |
//! |:------------|:-----------------------|
//! | Z           | Decrease sensitivity   |
//! | X           | Increase sensitivity    |
//! | C           | Decrease friction      |
//! | V           | Increase friction      |
//! | F           | Decrease scroll factor |
//! | G           | Increase scroll factor |
//! | B           | Enable/Disable         |

use std::f32::consts::{FRAC_PI_4, PI};

use bevy::{
    camera_controller::free_cam::{FreeCam, FreeCamPlugin},
    color::palettes::tailwind,
    prelude::*,
};

fn main() {
    App::new()
        .add_plugins(DefaultPlugins)
        // Plugin that enables freecam functionality
        .add_plugins(FreeCamPlugin)
        // Example code plugins
        .add_plugins((CameraPlugin, CameraSettingsPlugin, ScenePlugin))
        .run();
}

// Plugin that spawns the camera.