[][src]Struct raytracer::Camera

pub struct Camera { /* fields omitted */ }

This struct allows to position viewer in the scene.

Methods

impl Camera[src]

pub fn new(
    look_from: Vec3,
    look_at: Vec3,
    up: Vec3,
    fov: f32,
    aspect_ratio: f32
) -> Camera
[src]

Camera's constructor.

  • look_from - Camera's position.
  • look_at - The point camera is focusing on.
  • up - Vec3 that describes "up" direction in the world. Generally (0, 1, 0).
  • fov - Vertical field of view in degrees.
  • aspect_ratio - Aspect ratio of image's dimensions: width / height.

pub fn ray(&self, s: f32, t: f32) -> Ray[src]

Emits a Ray for given pixel on virtual camera's canvas.

  • s - Horizontal coordinate on canvas. Must be a value in range [0; 1].
  • t - Vertical coordinate on canvas. Must be a value in range [0; 1].

Auto Trait Implementations

impl Send for Camera

impl Sync for Camera

Blanket Implementations

impl<T> From for T[src]

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

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

type Error = !

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

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

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

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

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.