pub enum Fixed {
Hor(f32),
Ver(f32),
Upp(f32),
}Expand description
Fixed quantity wrt field of view.
- Implements
Defaultand can be created withFixed::default()returningFixed::Ver(FRAC_PI_4). - Implements
From<f32>and can be created withf32::into()returningFixed::Ver().
Variants§
Hor(f32)
Fixed horizontal field of view aka Vert- scaling.
Ver(f32)
Fixed vertical field of view aka Hor+ scaling.
Upp(f32)
Fixed unit per pixel on focus plane at distance from eye of one aka Pixel-based scaling.
Implementations§
Source§impl Fixed
impl Fixed
Sourcepub fn to_hor(self, max: Vec2) -> Self
pub fn to_hor(self, max: Vec2) -> Self
Converts to fixed horizontal field of view wrt maximum position in screen space.
Sourcepub fn to_ver(self, max: Vec2) -> Self
pub fn to_ver(self, max: Vec2) -> Self
Converts to fixed vertical field of view wrt maximum position in screen space.
Sourcepub fn to_upp(self, max: Vec2) -> Self
pub fn to_upp(self, max: Vec2) -> Self
Converts to fixed unit per pixel on focus plane at distance from eye of one wrt maximum position in screen space.
Sourcepub fn max_and_upp(self, zat: f32, max: Vec2) -> (Vec2, f32)
pub fn max_and_upp(self, zat: f32, max: Vec2) -> (Vec2, f32)
Maximum position in camera space and unit per pixel on focus plane wrt distance between eye and target and maximum position in screen space.
Sourcepub const fn into_inner(self) -> f32
pub const fn into_inner(self) -> f32
Underlying quantity.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Fixed
impl<'de> Deserialize<'de> for Fixed
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Copy for Fixed
impl StructuralPartialEq for Fixed
Auto Trait Implementations§
impl Freeze for Fixed
impl RefUnwindSafe for Fixed
impl Send for Fixed
impl Sync for Fixed
impl Unpin for Fixed
impl UnsafeUnpin for Fixed
impl UnwindSafe for Fixed
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