pub struct Camera {}Fields§
§fov_y: f32§aspect: f32§near: f32§far: f32§position: Vec3Position shifts all points prior to the camera transform; this is what we adjust with move keys.
orientation: Quaternion§proj_mat: Mat4We store the projection matrix here since it only changes when we change the camera cfg.
fog_density: f32These are in distances from the camera. E scale within band. 1.0 is a good baseline.
fog_power: f32Curve steepness, e.g. 4–8. Higher means more of a near “wall” with heavy far fade.
fog_start: f32distance where fog begins
fog_end: f32Distance where fog reaches full strength
fog_color: [f32; 3]§edge_cueing: f32Strength of edge cueing (silhouette darkening). 0.0 = off, 1.0 = full effect. Controlled at startup via GraphicsSettings::edge_cueing.
halo_expansion: f32World-space expansion along normals used in the depth-aware halo prepass. 0.0 = disabled. Set from GraphicsSettings::depth_aware_halos.
Implementations§
Source§impl Camera
impl Camera
pub fn to_bytes(&self) -> [u8; 128]
Sourcepub fn update_proj_mat(&mut self)
pub fn update_proj_mat(&mut self)
Updates the projection matrix based on the projection parameters. Run this after updating the parameters.
Sourcepub fn view_mat(&self) -> Mat4
pub fn view_mat(&self) -> Mat4
Calculate the view matrix: This is a translation of the negative coordinates of the camera’s position, applied before the camera’s rotation.
pub fn view_size(&self, far: bool) -> (f32, f32)
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Camera
impl RefUnwindSafe for Camera
impl Send for Camera
impl Sync for Camera
impl Unpin for Camera
impl UnsafeUnpin for Camera
impl UnwindSafe for Camera
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
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>
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>
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)
&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)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<R, P> ReadPrimitive<R> for P
impl<R, P> ReadPrimitive<R> for P
Source§fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
ReadEndian::read_from_little_endian().