Crates.io | bevy_4x_camera |
lib.rs | bevy_4x_camera |
version | 0.1.2 |
source | src |
created_at | 2021-01-12 07:11:38.791914 |
updated_at | 2021-01-23 19:43:29.415003 |
description | A 4X style camera for bevy |
homepage | https://github.com/SarthakSingh31/bevy_4x_camera |
repository | https://github.com/SarthakSingh31/bevy_4x_camera |
max_upload_size | |
id | 340725 |
size | 114,681 |
A 4X style camera for bevy. Demo
Default Key Bindings:
use bevy::{prelude::*, render::camera::PerspectiveProjection};
use bevy_4x_camera::{CameraRigBundle, FourXCameraPlugin};
fn main() {
App::build()
.add_plugins(DefaultPlugins)
.add_plugin(FourXCameraPlugin)
.add_startup_system(setup.system())
.run();
}
fn setup(commands: &mut Commands) {
commands
// camera
.spawn(CameraRigBundle::default())
.with_children(|cb| {
cb.spawn(Camera3dBundle {
// I recommend setting the fov to a low value to get a
// a pseudo-orthographic perspective
perspective_projection: PerspectiveProjection {
fov: 0.1,
..Default::default()
},
transform: Transform::from_translation(Vec3::new(-20.0, 20., 0.0))
.looking_at(Vec3::zero(), Vec3::unit_y()),
..Default::default()
});
});
}
Bevy Version | bevy_4x_camera Version |
---|---|
0.4.0 |
0.1.0 |