diff --git a/src/camera.rs b/src/camera.rs new file mode 100644 index 0000000..db441f1 --- /dev/null +++ b/src/camera.rs @@ -0,0 +1,85 @@ +use crate::prelude::*; + +/// Menu Plugin; empty struct for Plugin impl +pub(crate) struct CameraPlugin; + +impl Plugin for CameraPlugin { + fn build(&self, app: &mut App) { + app.add_systems(Update, editor_fly_camera); + } +} + +#[derive(Component)] +pub(crate) struct FlyCamera; + +/// Fly camera system for moving around like a drone +fn editor_fly_camera( + mut cameras: Query<(&Camera, &mut Transform), With>, + windows: Query<&Window>, + primary_window: Query>, + keys: Res>, + mut cursor_events: EventReader, + time: Res