pub struct CameraPath {
pub positions: KeyframeTrack<Vec3>,
pub targets: KeyframeTrack<Vec3>,
pub fov: KeyframeTrack<f32>,
pub elapsed: f32,
pub speed: f32,
pub looping: bool,
}Expand description
A smooth camera path through a list of positions and targets.
Uses KeyframeTrack<Vec3> internally for both position and look-at target.
Fields§
§positions: KeyframeTrack<Vec3>§targets: KeyframeTrack<Vec3>§fov: KeyframeTrack<f32>§elapsed: f32§speed: f32§looping: boolImplementations§
Source§impl CameraPath
impl CameraPath
pub fn new(speed: f32, looping: bool) -> Self
Sourcepub fn add_waypoint(
&mut self,
time: f32,
position: Vec3,
target: Vec3,
fov: f32,
)
pub fn add_waypoint( &mut self, time: f32, position: Vec3, target: Vec3, fov: f32, )
Add a camera waypoint: position, look-at target, fov at given time.
pub fn tick(&mut self, dt: f32)
pub fn position(&self) -> Vec3
pub fn target(&self) -> Vec3
pub fn fov(&self) -> f32
pub fn is_done(&self) -> bool
Auto Trait Implementations§
impl Freeze for CameraPath
impl RefUnwindSafe for CameraPath
impl Send for CameraPath
impl Sync for CameraPath
impl Unpin for CameraPath
impl UnsafeUnpin for CameraPath
impl UnwindSafe for CameraPath
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more