[][src]Struct rpt::Camera

pub struct Camera {
    pub eye: DVec3,
    pub direction: DVec3,
    pub up: DVec3,
    pub fov: f64,
    pub aperture: f64,
    pub focal_distance: f64,
}

A simple thin-lens perspective camera

Fields

eye: DVec3

Location of the camera

direction: DVec3

Direction that the camera is facing

up: DVec3

Direction of "up" for screen, must be orthogonal to direction

fov: f64

Field of view in the longer direction as an angle in radians, in (0, pi)

aperture: f64

Aperture radius for depth-of-field effects

focal_distance: f64

Focal distance, if aperture radius is nonzero

Implementations

impl Camera[src]

pub fn look_at(eye: DVec3, center: DVec3, up: DVec3, fov: f64) -> Self[src]

Perspective camera looking at a point, with a given field of view

pub fn focus(self, focal_point: DVec3, aperture: f64) -> Self[src]

Focus the camera on a position, with simulated depth-of-field

pub fn cast_ray(&self, x: f64, y: f64, rng: &mut StdRng) -> Ray[src]

Cast a ray, where (x, y) are normalized to the standard [-1, 1] box

Trait Implementations

impl Clone for Camera[src]

impl Copy for Camera[src]

impl Debug for Camera[src]

impl Default 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> Pointable for T

type Init = T

The type for initializers.

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<SS, SP> SupersetOf<SS> for SP where
    SS: SubsetOf<SP>, 

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<V, T> VZip<V> for T where
    V: MultiLane<T>,