
A 4X style camera for bevy. Demo
Default Key Bindings:
- W / A / S / D / Array Keys / Mouse Left - Move along the horizontal plane
- Q / E / Mouse Right - Rotate around the center
- Mouse Wheel - Zoom
Example
```rust
use bevy::{prelude::*, render::camera::PerspectiveProjection};
use bevy4xcamera::{CameraRigBundle, FourXCameraPlugin};
fn main() {
App::build()
.addplugins(DefaultPlugins)
.addplugin(FourXCameraPlugin)
.addstartupsystem(setup.system())
.run();
}
fn setup(
commands: &mut Commands,
mut meshes: ResMut>,
mut materials: ResMut>,
) {
commands
// camera
.spawn(CameraRigBundle::default())
.withchildren(|cb| {
cb.spawn(Camera3dBundle {
// I recommend setting the fov to a low value to get a
// a pseudo-orthographic perspective
perspectiveprojection: PerspectiveProjection {
fov: 0.1,
..Default::default()
},
transform: Transform::fromtranslation(Vec3::new(-20.0, 20., 0.0))
.lookingat(Vec3::zero(), Vec3::unit_y()),
..Default::default()
});
});
}
```
Version Matching
| Bevy Version | bevy_4x_camera
Version |
| ------------ | ------------------------ |
| 0.4.0
| 0.1.0
|