pub struct ProofCamera {
pub position: Spring3D,
pub target: Spring3D,
pub fov: SpringDamper,
pub shake: TraumaShake,
pub orbital: Option<OrbitalCamera>,
pub path: Option<CinematicPath>,
pub aspect: f32,
pub near: f32,
pub far: f32,
/* private fields */
}Expand description
The main engine camera. Supports free, orbital, and cinematic modes.
Fields§
§position: Spring3D§target: Spring3D§fov: SpringDamper§shake: TraumaShake§orbital: Option<OrbitalCamera>§path: Option<CinematicPath>§aspect: f32§near: f32§far: f32Implementations§
Source§impl ProofCamera
impl ProofCamera
pub fn new(config: &EngineConfig) -> Self
pub fn add_trauma(&mut self, amount: f32)
Sourcepub fn set_position_instant(&mut self, pos: Vec3)
pub fn set_position_instant(&mut self, pos: Vec3)
Teleport the camera instantly (no spring animation).
Sourcepub fn begin_orbital(&mut self, target: Vec3, distance: f32)
pub fn begin_orbital(&mut self, target: Vec3, distance: f32)
Switch to orbital mode around a target.
Sourcepub fn end_orbital(&mut self)
pub fn end_orbital(&mut self)
Exit orbital mode (returns to free camera).
pub fn is_orbital(&self) -> bool
Sourcepub fn orbital_rotate(&mut self, delta_az: f32, delta_el: f32)
pub fn orbital_rotate(&mut self, delta_az: f32, delta_el: f32)
Rotate the orbital camera by delta angles.
Sourcepub fn orbital_zoom(&mut self, delta: f32)
pub fn orbital_zoom(&mut self, delta: f32)
Zoom the orbital camera.
Sourcepub fn begin_path(&mut self, points: Vec<PathPoint>, looping: bool)
pub fn begin_path(&mut self, points: Vec<PathPoint>, looping: bool)
Start a cinematic path sequence.
pub fn is_on_path(&self) -> bool
Sourcepub fn tick(&mut self, dt: f32) -> CameraState
pub fn tick(&mut self, dt: f32) -> CameraState
Advance the camera by dt seconds. Returns the current CameraState.
pub fn on_resize(&mut self, width: u32, height: u32)
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ProofCamera
impl RefUnwindSafe for ProofCamera
impl Send for ProofCamera
impl Sync for ProofCamera
impl Unpin for ProofCamera
impl UnsafeUnpin for ProofCamera
impl UnwindSafe for ProofCamera
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.