[][src]Struct amethyst_rendy::camera::Perspective

pub struct Perspective { /* fields omitted */ }

An appropriate orthographic projection for the coordinate space used by Amethyst. Because we use vulkan coordinates internally and within the rendering engine, normal nalgebra projection objects (Perspective3) are incorrect for our use case.

This implementation provides an interface with feature parity to nalgebra, but retaining the vulkan coordinate space.

The projection matrix is right-handed and has a depth range of 0 to 1

Methods

impl Perspective[src]

pub fn new(aspect: f32, fov: f32, z_near: f32, z_far: f32) -> Self[src]

Creates a new Perspective projection with the provided arguments.

Arguments

  • aspect - Aspect Ratio represented as a f32 ratio.
  • fov - Field of View represented in degrees
  • z_near - Near clip plane distance
  • z_far - Far clip plane distance

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

Returns the aspect ratio in radians

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

Returns the y-axis value of the FOV as a ratio.

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

Returns the near-clip value.

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

Returns the far-clip value.

pub fn set_aspect(&mut self, aspect: f32)[src]

Sets the aspect ratio represented in radians.

NOTE

This causes changes to both the fov and aspect ratio matrix elements.

pub fn set_fov(&mut self, fov: f32)[src]

Sets the aspect ratio represented as a f32 ratio.

NOTE

This causes changes to both the fov and aspect ratio matrix elements.

pub fn set_fov_and_aspect(&mut self, fov: f32, aspect: f32)[src]

Sets the aspect ratio represented as a ratio as well as the FOV represented in radians.

NOTE

This causes changes to both the fov and aspect ratio matrix elements.

pub fn set_near(&mut self, near: f32)[src]

Sets the near-clip value

NOTE

This causes changes to both the near and far ratio matrix elements.

pub fn set_far(&mut self, far: f32)[src]

Sets the far-clip value.

NOTE

This causes changes to both the near and far ratio matrix elements.

pub fn set_near_and_far(&mut self, z_near: f32, z_far: f32)[src]

Sets the near and far clip values.

pub fn as_matrix(&self) -> &Matrix4<f32>[src]

Returns a reference to the inner matrix representation of this projection.

pub fn as_matrix_mut(&mut self) -> &mut Matrix4<f32>[src]

Returns a mutable reference to the inner matrix representation of this projection.

Trait Implementations

impl Copy for Perspective[src]

impl Clone for Perspective[src]

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

Performs copy-assignment from source. Read more

impl PartialEq<Perspective> for Perspective[src]

impl From<Perspective> for Projection[src]

impl Debug for Perspective[src]

impl Serialize for Perspective[src]

impl<'de> Deserialize<'de> for Perspective[src]

Auto Trait Implementations

impl Unpin for Perspective

impl Sync for Perspective

impl Send for Perspective

impl UnwindSafe for Perspective

impl RefUnwindSafe for Perspective

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<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> DeserializeOwned for T where
    T: Deserialize<'de>, 
[src]

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.

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

impl<T> Erased for T[src]

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

impl<T> Scalar for T where
    T: Copy + PartialEq<T> + Any + Debug
[src]

fn is<T>() -> bool where
    T: Scalar
[src]

Tests if Self the same as the type T Read more

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> Event for T where
    T: Send + Sync + 'static, 
[src]

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