[−][src]Struct amethyst_utils::auto_fov::AutoFov
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(&self) -> 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]
fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error> where
__S: Serializer,
[src]
__S: Serializer,
impl<'de> Deserialize<'de> for AutoFov where
AutoFov: Default,
[src]
AutoFov: Default,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
[src]
__D: Deserializer<'de>,
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 add_to_entity(
&self,
entity: Entity,
system_data: &mut Self::SystemData,
_: &[Entity],
_: &[Entity]
) -> Result<(), Error>
[src]
&self,
entity: Entity,
system_data: &mut Self::SystemData,
_: &[Entity],
_: &[Entity]
) -> Result<(), Error>
fn load_sub_assets(
&mut self,
_progress: &mut ProgressCounter,
_system_data: &mut Self::SystemData
) -> Result<bool, Error>
[src]
&mut self,
_progress: &mut ProgressCounter,
_system_data: &mut Self::SystemData
) -> Result<bool, Error>
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]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> DeserializeOwned for T where
T: Deserialize<'de>,
[src]
T: Deserialize<'de>,
impl<T> Serialize for T where
T: Serialize + ?Sized,
[src]
T: Serialize + ?Sized,
fn erased_serialize(&self, serializer: &mut dyn Serializer) -> Result<Ok, Error>
[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]
SS: SubsetOf<SP>,
fn to_subset(&self) -> Option<SS>
[src]
fn is_in_subset(&self) -> bool
[src]
unsafe fn to_subset_unchecked(&self) -> SS
[src]
fn from_subset(element: &SS) -> SP
[src]
impl<T> Resource for T where
T: Any + Send + Sync,
[src]
T: Any + Send + Sync,
impl<T> Any for T where
T: Any,
[src]
T: Any,
fn get_type_id(&self) -> TypeId
[src]
impl<T> TryDefault for T where
T: Default,
[src]
T: Default,
fn try_default() -> Result<T, String>
[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]
T: Send + Sync + 'static,
impl<T> Erased for T
[src]
impl<T> Clone for T where
T: Clone,
[src]
T: Clone,
impl<T> Supports<T> for T
[src]
impl<T> Config for T where
T: Deserialize<'a> + Serialize + Default,
[src]
T: Deserialize<'a> + Serialize + Default,
fn load<P>(path: P) -> T where
P: AsRef<Path>,
[src]
P: AsRef<Path>,
fn load_no_fallback<P>(path: P) -> Result<T, ConfigError> where
P: AsRef<Path>,
[src]
P: AsRef<Path>,
fn load_bytes(bytes: &[u8]) -> Result<T, ConfigError>
[src]
fn write<P>(&self, path: P) -> Result<(), ConfigError> where
P: AsRef<Path>,
[src]
P: AsRef<Path>,
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]
D: AdaptFrom<S, Swp, Dwp, T>,
Dwp: WhitePoint,
Swp: WhitePoint,
T: Component + Float,
fn adapt_into_using<M>(self, method: M) -> D where
M: TransformMatrix<Swp, Dwp, T>,
[src]
M: TransformMatrix<Swp, Dwp, T>,
fn adapt_into(self) -> D
[src]
Convert the source color to the destination color using the bradford method by default Read more