pub struct FirstPerson {
pub pos: Point3<World>,
pub heading: SphericalVec<World>,
}Expand description
First-person camera transform.
This is the familiar “FPS” movement mode, based on camera position and heading (look-at vector).
Fields§
§pos: Point3<World>Current position of the camera in world space.
heading: SphericalVec<World>Current heading of the camera in world space.
Implementations§
Source§impl FirstPerson
impl FirstPerson
Sourcepub fn new() -> Self
pub fn new() -> Self
Creates a first-person transform with position in the origin and heading in the direction of the positive x-axis.
Sourcepub fn look_at(&mut self, pt: Point3<World>)
pub fn look_at(&mut self, pt: Point3<World>)
Rotates the camera to center the view on a world-space point.
Sourcepub fn rotate(&mut self, delta_az: Angle, delta_alt: Angle)
pub fn rotate(&mut self, delta_az: Angle, delta_alt: Angle)
Rotates the camera by relative azimuth and altitude.
Trait Implementations§
Source§impl Clone for FirstPerson
impl Clone for FirstPerson
Source§fn clone(&self) -> FirstPerson
fn clone(&self) -> FirstPerson
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for FirstPerson
impl Debug for FirstPerson
Source§impl Default for FirstPerson
Available on crate feature fp only.
impl Default for FirstPerson
Available on crate feature
fp only.Source§fn default() -> Self
fn default() -> Self
Returns FirstPerson::new.
Source§impl Transform for FirstPerson
Available on crate feature fp only.
impl Transform for FirstPerson
Available on crate feature
fp only.Source§fn world_to_view(&self) -> Mat4x4<WorldToView>
fn world_to_view(&self) -> Mat4x4<WorldToView>
Returns the current world-to-view matrix.
impl Copy for FirstPerson
Auto Trait Implementations§
impl Freeze for FirstPerson
impl RefUnwindSafe for FirstPerson
impl Send for FirstPerson
impl Sync for FirstPerson
impl Unpin for FirstPerson
impl UnwindSafe for FirstPerson
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