ray_tracer/camera/
mod.rs

1use crate::float::Float;
2use crate::vector::Vec3;
3use crate::ray::Ray;
4
5pub mod perspective;
6
7pub enum CameraLock {
8    Direction,
9    LookAt
10}
11
12pub trait Camera<T>
13    where T: Float
14{
15    fn get_position(&self) -> &Vec3<T>;
16    fn set_position(&mut self, position: &[T]);
17
18    fn get_direction(&self) -> &Vec3<T>;
19    fn set_direction(&mut self, direction: &[T]);
20
21    fn get_lookat(&self) -> &Vec3<T>;
22    fn set_lookat(&mut self, lookat: &[T]);
23
24    fn get_up(&self) -> &Vec3<T>;
25    fn set_up(&mut self, up: &[T]);
26
27    fn get_aperture(&self) -> T;
28    fn set_aperture(&mut self, aperture: T);
29
30    fn get_focus(&self) -> T;
31    fn set_focus(&mut self, focus: T);
32
33    fn get_aspect(&self) -> T;
34    fn set_aspect(&mut self, aspect: T);
35
36    fn get_fov(&self) -> T;
37    fn set_fov(&mut self, fov: T);
38
39    fn get_ray(&self, r: T, s: T) -> Ray<T>;
40}