[][src]Struct ngen::camera::Camera

pub struct Camera {
    pub eye: P3,
    pub look_at: P3,
    pub up: Vec3,
    pub aspect_ratio: f32,
    pub fov: f32,
    pub near: f32,
    pub far: f32,
    pub perspective: Mat4,
}

A very simple perspective camera.

Fields

eye: P3look_at: P3up: Vec3aspect_ratio: f32fov: f32near: f32far: f32perspective: Mat4

Implementations

impl Camera[src]

pub fn new(eye: P3, look_at: P3, aspect_ratio: f32) -> Self[src]

pub fn from_tiles(tile_width: u32) -> Self[src]

Creates a camera based on how many tiles to display in the screen, where tile width is calculated as (screen_width / tiles_per_x). To keep things simple, we assume as screen size of 1920x1080 for now.

pub fn perspective_transform(&self) -> Mat4[src]

pub fn look_at_transform(&self) -> Mat4[src]

pub fn build_transform(&self) -> Mat4[src]

Trait Implementations

impl Clone for Camera[src]

impl Copy for Camera[src]

Auto Trait Implementations

impl RefUnwindSafe for Camera

impl Send for Camera

impl Sync for Camera

impl Unpin for Camera

impl UnwindSafe for Camera

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> 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.