rust_pathtracer/camera/mod.rs
1pub mod pinhole;
2
3use crate::prelude::*;
4
5/// Trait for abstracting cameras.
6#[allow(unused)]
7pub trait Camera3D : Sync + Send {
8
9 fn new() -> Self where Self: Sized;
10
11 /// Set the origin and center of the camera.
12 fn set(&mut self, origin: F3, center: F3);
13 /// Set the fov of the camera.
14 fn set_fov(&mut self, fov: F);
15
16 /// Generate a ray.
17 fn gen_ray(&self, p: F2, offset: F2, width: F, height: F) -> Ray;
18}