[][src]Struct amethyst_utils::auto_fov::AutoFov

pub struct AutoFov { /* fields omitted */ }

A component describing the behavior of the camera in accordance with the screen dimensions

Methods

impl AutoFov[src]

pub fn new() -> Self[src]

Creates a new instance with the default values for all fields

pub fn base_fovx(&self) -> f32[src]

The horizontal FOV value at the aspect ratio in the field base_aspect_ratio

This value should be between the min_fovx and max_fovx values. Value in radians. Defaults to 1.861684535, which is the horizontal FOV value when the vertial FOV and aspect ratio for a camera is set to 1.0471975512(60 deg) and 16/9, respectively.

pub fn fovx_growth_rate(&self) -> f32[src]

The factor determining how sensitive the FOV change should be

Defaults to 1.0.

pub fn fixed_growth_rate(&self) -> bool[src]

If the FOV grow rate specified in the field fovx_growth_rate should be applied as-is

Defaults to false. When false, the fovx_growth_rate field is multiplied with the camera's current vertical FOV value.

pub fn base_aspect_ratio(&self) -> (usize, usize)[src]

The aspect ratio when the camera's horizontal FOV is identical to base_fovx

Defaults to (16, 9).

pub fn min_fovx(&self) -> f32[src]

The minimum value the horizontal FOV can have

This value should be larger than 0. Defaults to 0.1.

pub fn max_fovx(&self) -> f32[src]

The maximum value the horizontal FOV can have

This value should be larger than 0. Defaults to PI. The rendered view will be stretched if the screen aspect ratio keeps growing after the point where the camera's horizontal FOV reaches this maximum value.

pub fn set_base_fovx(&mut self, base_fovx: f32)[src]

Sets base_fovx to the given value

This function panics if the given value is not between min_fovx and max_fovx.

pub fn set_fovx_growth_rate(&mut self, fovx_growth_rate: f32)[src]

Sets fovx_growth_rate to the given value

pub fn set_fixed_growth_rate(&mut self, fix: bool, new_growth_rate: Option<f32>)[src]

Sets fixed_growth_rate to the given value

You can optionally give the new fovx_growth_rate value to be set.

pub fn set_base_aspect_ratio(&mut self, horizontal: usize, vertical: usize)[src]

Sets base_aspect_ratio to the given value

This function panics if the horizontal or vertical ratio value is zero.

pub fn set_min(&mut self, min: f32)[src]

Sets min_fovx to the given value

This function panics if the given min_fovx is not larger than zero or is larger than max_fovx.

pub fn set_max(&mut self, max: f32)[src]

Sets max_fovx to the given value

This function panics if the given max_fovx is smaller than min_fovx.

pub fn set_min_max(&mut self, min: f32, max: f32)[src]

Sets min_fovx and max_fovx to the given vaues

This function panics if the given min_fovx is not larger than zero, or if the given max_fovx is smaller than the given min_fovx.

pub fn new_fovx(&self, current_aspect_ratio: f32, fovy: f32) -> f32[src]

Computes the new horizontal FOV from the current screen aspect ratio and vertical FOV

Trait Implementations

impl Default for AutoFov[src]

impl Clone for AutoFov[src]

fn clone_from(&mut self, source: &Self)1.0.0[src]

Performs copy-assignment from source. Read more

impl Debug for AutoFov[src]

impl Serialize for AutoFov[src]

impl<'de> Deserialize<'de> for AutoFov where
    AutoFov: Default
[src]

impl<'pfd> PrefabData<'pfd> for AutoFov[src]

type SystemData = WriteStorage<'pfd, AutoFov>

SystemData needed to perform the load

type Result = ()

The result type returned by the load operation

fn load_sub_assets(
    &mut self,
    _progress: &mut ProgressCounter,
    _system_data: &mut Self::SystemData
) -> Result<bool, Error>
[src]

Trigger asset loading for any sub assets. Read more

impl Component for AutoFov[src]

type Storage = HashMapStorage<Self>

Associated storage type for this component.

Auto Trait Implementations

impl Unpin for AutoFov

impl Sync for AutoFov

impl Send for AutoFov

impl UnwindSafe for AutoFov

impl RefUnwindSafe for AutoFov

Blanket Implementations

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> DeserializeOwned for T where
    T: Deserialize<'de>, 
[src]

impl<T> Serialize for T where
    T: Serialize + ?Sized
[src]

impl<T> Same<T> for T[src]

type Output = T

Should always be Self

impl<SS, SP> SupersetOf<SS> for SP where
    SS: SubsetOf<SP>, 
[src]

impl<T> Resource for T where
    T: Any + Send + Sync
[src]

impl<T> Any for T where
    T: Any
[src]

impl<T> TryDefault for T where
    T: Default
[src]

fn unwrap_default() -> Self[src]

Calls try_default and panics on an error case.

impl<T> Event for T where
    T: Send + Sync + 'static, 
[src]

impl<T> Erased for T[src]

impl<T> Clone for T where
    T: Clone
[src]

impl<T> Supports<T> for T[src]

impl<T> Config for T where
    T: Deserialize<'a> + Serialize + Default
[src]

impl<S, D, Swp, Dwp, T> AdaptInto<D, Swp, Dwp, T> for S where
    D: AdaptFrom<S, Swp, Dwp, T>,
    Dwp: WhitePoint,
    Swp: WhitePoint,
    T: Component + Float
[src]

fn adapt_into(self) -> D[src]

Convert the source color to the destination color using the bradford method by default Read more

impl<T> SetParameter for T[src]

fn set<T>(&mut self, value: T) -> <T as Parameter<Self>>::Result where
    T: Parameter<Self>, 
[src]

Sets value as a parameter of self.