pub struct EditorCamera {
pub position: Vec3,
pub yaw: f32,
pub pitch: f32,
pub move_speed: f32,
pub look_sensitivity: f32,
pub fov_degrees: f32,
pub near: f32,
pub far: f32,
pub active: bool,
}Expand description
Free-fly camera that is completely independent of the game camera. Controlled by WASD + mouse look in the editor viewport.
Fields§
§position: Vec3§yaw: f32§pitch: f32§move_speed: f32§look_sensitivity: f32§fov_degrees: f32§near: f32§far: f32§active: boolWhether the camera is currently being piloted (right-mouse held).
Implementations§
Source§impl EditorCamera
impl EditorCamera
pub fn new() -> Self
Sourcepub fn translate(&mut self, input: Vec3, dt: f32)
pub fn translate(&mut self, input: Vec3, dt: f32)
Move the camera in local space. input is (right, up, forward) signed.
Sourcepub fn view_matrix(&self) -> Mat4
pub fn view_matrix(&self) -> Mat4
Build a view matrix (row-major, compatible with glam).
Sourcepub fn projection_matrix(&self, aspect: f32) -> Mat4
pub fn projection_matrix(&self, aspect: f32) -> Mat4
Build a projection matrix.
Trait Implementations§
Source§impl Clone for EditorCamera
impl Clone for EditorCamera
Source§fn clone(&self) -> EditorCamera
fn clone(&self) -> EditorCamera
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 EditorCamera
impl Debug for EditorCamera
Auto Trait Implementations§
impl Freeze for EditorCamera
impl RefUnwindSafe for EditorCamera
impl Send for EditorCamera
impl Sync for EditorCamera
impl Unpin for EditorCamera
impl UnsafeUnpin for EditorCamera
impl UnwindSafe for EditorCamera
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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.