pub struct EditorCamera {
pub position: Vec3,
pub target: Vec3,
pub up: Vec3,
pub fov_deg: f32,
pub aspect: f32,
pub near: f32,
pub far: f32,
pub orbit_yaw: f32,
pub orbit_pitch: f32,
pub orbit_dist: f32,
}Fields§
§position: Vec3§target: Vec3§up: Vec3§fov_deg: f32§aspect: f32§near: f32§far: f32§orbit_yaw: f32§orbit_pitch: f32§orbit_dist: f32Implementations§
Source§impl EditorCamera
impl EditorCamera
pub fn new(aspect: f32) -> Self
pub fn view_matrix(&self) -> Mat4
pub fn proj_matrix(&self) -> Mat4
pub fn view_proj(&self) -> Mat4
pub fn frustum(&self) -> Frustum
Sourcepub fn update_orbit(&mut self)
pub fn update_orbit(&mut self)
Update camera position from orbit parameters
pub fn orbit(&mut self, delta_yaw: f32, delta_pitch: f32)
pub fn zoom(&mut self, delta: f32)
pub fn pan(&mut self, delta: Vec3)
Source§impl EditorCamera
impl EditorCamera
pub fn preset_top_down(center: Vec3) -> Self
pub fn preset_horizon(center: Vec3) -> Self
pub fn clamp_to_terrain( &mut self, hmap: &Heightmap, cell_size: f32, height_scale: f32, min_height_above: f32, )
Trait Implementations§
Source§impl Clone for EditorCamera
impl Clone 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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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.