[−][src]Struct tray_rust::film::camera::Camera
Our camera for the ray tracer, has a transformation to position it in world space
Fields
active_at: usize
The frame this camera becomes active on
Methods
impl Camera
[src]
pub fn new(
cam_world: AnimatedTransform,
fov: f32,
dims: (usize, usize),
shutter_size: f32,
active_at: usize
) -> Camera
[src]
cam_world: AnimatedTransform,
fov: f32,
dims: (usize, usize),
shutter_size: f32,
active_at: usize
) -> Camera
Create the camera with some orientation in the world specified by cam_world
and a perspective projection with fov
. The render target dimensions dims
are needed to construct the raster -> camera transform
animation
is used to move the camera ote that this is specified in camera space
where the camera is at the origin looking down the -z axis
pub fn animated_fov(
cam_world: AnimatedTransform,
fovs: Vec<f32>,
fov_knots: Vec<f32>,
fov_spline_degree: usize,
dims: (usize, usize),
shutter_size: f32,
active_at: usize
) -> Camera
[src]
cam_world: AnimatedTransform,
fovs: Vec<f32>,
fov_knots: Vec<f32>,
fov_spline_degree: usize,
dims: (usize, usize),
shutter_size: f32,
active_at: usize
) -> Camera
Create a camera with some orientation in the world specified by cam_world
and an animated perspective projection with fov
. The render target dimensions dims
are needed to construct the raster -> camera transform
animation
is used to move the camera ote that this is specified in camera space
where the camera is at the origin looking down the -z axis
pub fn update_frame(&mut self, start: f32, end: f32)
[src]
Update the camera's shutter open/close time for this new frame
pub fn shutter_time(&self) -> (f32, f32)
[src]
Get the time that the shutter opens and closes at
pub fn generate_ray(&self, px: &(f32, f32), time: f32) -> Ray
[src]
Generate a ray from the camera through the pixel px
Trait Implementations
Auto Trait Implementations
impl Send for Camera
impl Sync for Camera
impl Unpin for Camera
impl UnwindSafe for Camera
impl RefUnwindSafe for Camera
Blanket Implementations
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From<T> for T
[src]
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
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, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,