Crates.io | bevy_simple_camera_controller |
lib.rs | bevy_simple_camera_controller |
version | 0.2.1 |
source | src |
created_at | 2024-07-17 21:51:36.269584 |
updated_at | 2024-07-20 22:17:59.705787 |
description | Minimalistic camera controller |
homepage | |
repository | https://github.com/miivers/bevy_simple_camera_controller |
max_upload_size | |
id | 1306633 |
size | 155,774 |
Work in progress!
3d camera controller made for Bevy 0.14.0
I am new to rust and Bevy. This project will change as my understanding of both increases.
An attempt to make it easy to add camera controller to a bevy project. The main focus is ease of use.
Capture cursor on focus. Cursor is allways in the middle of the screen (escape to cancel)
Hide cursor.
Move camera with WASD.
Rotate camera with mouse.
mod common;
use bevy_simple_camera_controller::prelude::*;
use bevy::prelude::*;
use common::utils;
fn main() {
let mut app = App::new();
app.add_plugins((
DefaultPlugins,
// 1: Setup camera
FreeFlightControllerBuilder::default().build()
));
app.add_systems(Startup, (
// 2: Create camera
CameraControllerPlugin::create_camera,
utils::setup_example_scene,
));
app.run();
}
Move camera with WASD.
mod common;
use bevy_simple_camera_controller::prelude::*;
use bevy::prelude::*;
use common::utils;
fn main() {
let mut app = App::new();
app.add_plugins((
DefaultPlugins,
// 1: Setup camera
TopDownControllerBuilder::default().build()
));
app.add_systems(Startup, (
// 2: Create camera
CameraControllerPlugin::create_camera,
utils::setup_example_scene,
));
app.run();
}
Rotate camera with mouse
mod common;
use bevy_simple_camera_controller::prelude::*;
use bevy::prelude::*;
use common::utils;
fn main() {
let mut app = App::new();
app.add_plugins((
DefaultPlugins,
// 1: Setup camera
OrbitControllerBuilder::default().
with_grab_cursor().
set_rotation_speed(2.0).
build()
));
app.add_systems(Startup, (
// 2: Create camera
CameraControllerPlugin::create_camera,
// Adds CameraOrbitTag to cube in order to set it as rotation target
utils::setup_example_scene,
));
app.run();
}
Bevy | bevy_simple_camera_controller |
---|---|
0.14 |
0.1.0 |