diff --git a/.gitignore b/.gitignore index 1953514..5c7da67 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,4 @@ /target # These are backup files generated by rustfmt -**/*.rs.bk \ No newline at end of file +**/*.rs.bk diff --git a/README.md b/README.md index d86a7bd..32e0c4b 100644 --- a/README.md +++ b/README.md @@ -62,9 +62,10 @@ struct MainCamera; fn main() { App::new() .add_plugins(DefaultPlugins) - .add_startup_system(setup) //.. - .add_system(Dolly::::update_active) + .add_system(Startup, setup) + .add_system(Update, Dolly::::update_active) + .add_system(Update, update_input) //.. .run(); } @@ -81,7 +82,7 @@ fn setup( MainCamera, // The rig component tag Rig::builder() // The rig itself .with(Position::new(Vec3::ZERO)) // Start position - // Adds a driver with method rotate_yaw_pitch + // Adds a driver with the method rotate_yaw_pitch .with(YawPitch::new().yaw_degrees(45.0).pitch_degrees(-30.0)) // Interpolation when the translation is updated, also known as smoothing .with(Smooth::new_position(0.3)) diff --git a/src/dolly_type.rs b/src/dolly_type.rs index 6678649..0eb0b2b 100644 --- a/src/dolly_type.rs +++ b/src/dolly_type.rs @@ -1,6 +1,8 @@ use bevy::prelude::{Component, Deref, DerefMut}; use dolly::{driver::RigDriverTraits, prelude::CameraRig, rig::CameraRigBuilder}; +use crate::dolly; + #[derive(Component, Deref, DerefMut)] pub struct Rig(CameraRig); diff --git a/src/drivers/follow.rs b/src/drivers/follow.rs index 9802d74..1f6a7ea 100644 --- a/src/drivers/follow.rs +++ b/src/drivers/follow.rs @@ -1,5 +1,8 @@ +use crate::{ + dolly::{self, prelude::*}, + prelude::RigDriver, +}; use bevy::prelude::*; -use dolly::{driver::RigDriver, prelude::*}; impl MovableLookAt { pub fn from_position_target(target_position: Vec3) -> Self { diff --git a/src/drivers/fpv.rs b/src/drivers/fpv.rs index daf55ce..0e425c9 100644 --- a/src/drivers/fpv.rs +++ b/src/drivers/fpv.rs @@ -1,3 +1,7 @@ +use crate::{ + dolly, + prelude::{Position, Rotation, YawPitch}, +}; use bevy::prelude::*; use dolly::{driver::RigDriver, prelude::*};