[][src]Struct screen_13::camera::Perspective

pub struct Perspective { /* fields omitted */ }

A standard perspective camera.

Implementations

impl Perspective[src]

pub fn new(
    eye: Vec3,
    target: Vec3,
    depth: Range<f32>,
    fov: f32,
    aspect_ratio: f32
) -> Self
[src]

Creates a new perspective camera using +y as the default "up" vector.

Arguments

  • eye - Position this camera is pointing from.
  • target - Position this camera is pointing towards.
  • depth - Range of distance this camera can see.
  • fov - Full field of view on the X axis, in degrees.
  • aspect_ratio - Width of the view of this camera divided by height.

pub fn new_view<S: Into<CoordF>>(
    eye: Vec3,
    target: Vec3,
    depth: Range<f32>,
    fov: f32,
    shape: S
) -> Self
[src]

Creates a new perspective camera using +y as the default "up" vector.

Arguments

  • eye - Position this camera is pointing from.
  • target - Position this camera is pointing towards.
  • depth - Range of distance this camera can see.
  • fov - Full field of view on the X axis, in degrees.
  • shape - Defines the aspect ratio of the view of this camera.

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

Returns the width of the view of this camera compared to the height.

pub fn eye(&self) -> Vec3[src]

Returns the position this camera is pointing from.

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

Returns the maximum distance this camera can see.

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

Returns the full field of view of the X axis, in degrees.

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

Returns the minimum distance this camera can see.

pub fn target(&self) -> Vec3[src]

Returns the position this camera is pointing towards.

pub fn up(&self) -> Vec3[src]

Returns the orientation of the view of this camera, which is +y by default.

pub fn set_aspect_ratio(&mut self, val: f32)[src]

Modifies the shape of this camera.

Arguments

  • val - Width of the output of this camera divided by height.

pub fn set_depth(&mut self, val: Range<f32>)[src]

Modifies the near and far planes of this camera, which defines the distance this camera can see.

pub fn set_eye(&mut self, val: Vec3)[src]

Modifies the position which this camera is pointing from.

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

Modifies the field of view of this camera.

pub fn set_target(&mut self, val: Vec3)[src]

Modifies the position which this camera is pointing towards.

pub fn set_up(&mut self, val: Vec3)[src]

Modifies the orientation of the view of this camera.

pub fn set_view<S: Into<CoordF>>(&mut self, shape: S, fov: f32)[src]

Modifies the shape and field of view of this camera.

Arguments

  • shape - Defines the aspect ratio of the view of this camera.
  • fov - Full field of view on the X axis, in degrees.

Trait Implementations

impl Camera for Perspective[src]

impl Clone for Perspective[src]

impl Default for Perspective[src]

Auto Trait Implementations

Blanket Implementations

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

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

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

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

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

impl<T> Pointable for T

type Init = T

The type for initializers.

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

type Output = T

Should always be Self

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

type Owned = T

The resulting type after obtaining ownership.

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.