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
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.