[−][src]Struct raytracer::Camera
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]
look_from: Vec3,
look_at: Vec3,
up: Vec3,
fov: f32,
aspect_ratio: f32
) -> Camera
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
Blanket Implementations
impl<T> From for T
[src]
impl<T, U> Into for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = !
🔬 This is a nightly-only experimental API. (
try_from
)The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T> Borrow for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,