[][src]Struct tray_rust::film::camera::Camera

pub struct Camera {
    pub active_at: usize,
    // some fields omitted
}

Our camera for the ray tracer, has a transformation to position it in world space

Fields

active_at: usize

The frame this camera becomes active on

Methods

impl Camera[src]

pub fn new(
    cam_world: AnimatedTransform,
    fov: f32,
    dims: (usize, usize),
    shutter_size: f32,
    active_at: usize
) -> Camera
[src]

Create the camera with some orientation in the world specified by cam_world and a perspective projection with fov. The render target dimensions dims are needed to construct the raster -> camera transform animation is used to move the camera ote that this is specified in camera space where the camera is at the origin looking down the -z axis

pub fn animated_fov(
    cam_world: AnimatedTransform,
    fovs: Vec<f32>,
    fov_knots: Vec<f32>,
    fov_spline_degree: usize,
    dims: (usize, usize),
    shutter_size: f32,
    active_at: usize
) -> Camera
[src]

Create a camera with some orientation in the world specified by cam_world and an animated perspective projection with fov. The render target dimensions dims are needed to construct the raster -> camera transform animation is used to move the camera ote that this is specified in camera space where the camera is at the origin looking down the -z axis

pub fn update_frame(&mut self, start: f32, end: f32)[src]

Update the camera's shutter open/close time for this new frame

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

Get the time that the shutter opens and closes at

pub fn generate_ray(&self, px: &(f32, f32), time: f32) -> Ray[src]

Generate a ray from the camera through the pixel px

Trait Implementations

impl Clone for Camera[src]

impl Debug for Camera[src]

Auto Trait Implementations

impl Send for Camera

impl Sync for Camera

impl Unpin for Camera

impl UnwindSafe for Camera

impl RefUnwindSafe for Camera

Blanket Implementations

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

impl<T> From<T> for 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.

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> SetParameter for T[src]