bevy_simple_camera_controller 0.1.0

Minimalistic camera controller
Documentation

bevy_simple_camera_controller

Work in progress! Made for Bevy 0.14.0
I am new to rust and Bevy. This project will change as my understanding of bouth increases.

An attempt to make it easy to add camera controller to a bevy project. The main focus is ease of use.

Currently only support keyboard and mouse.

Features

  • Free flight camera style
  • Keyboard input for movement (default = wasd)
  • Mouse input for rotate
  • Change keybinding for movement
  • Capture input (optional, default = on) - user input is disabled until user clicks window

Example

use bevy_simple_camera_controller::free_camera::*;
use bevy::prelude::*;
use common::utils;


fn main() {
    let mut app = App::new();

        app.add_plugins((
            DefaultPlugins,
            FreeCameraPlugin::default() // 1: Add camera plugin
        ));

        app.add_systems(Startup, (
            create_camera, // 2: Creates a default Camera3dBundle  (This is optionally, you can do this manually)
            utils::setup_scene
        ));

        app.run();
}

fn create_camera(mut commands: Commands) {
    commands.spawn((Camera3dBundle {
        transform: Transform::from_xyz(-2.5, 4.5, 9.0).looking_at(Vec3::ZERO, Vec3::Y), // Camera position and look at position
        ..default()
    },
    CameraTag
    ));
}

Compatibility

Bevy bevy_simple_camera_controller
0.14 0.1.0