pub struct RtCamera { /* private fields */ }Expand description
Pinhole and Thin-Lens Depth-of-Field camera generating jittered primary rays for anti-aliasing and bokeh defocus.
Implementations§
Source§impl RtCamera
Look-at construction, thin-lens depth of field, jittered ray generation, and motion hashing for RtCamera.
impl RtCamera
Look-at construction, thin-lens depth of field, jittered ray generation, and motion hashing for RtCamera.
Sourcepub fn look_at(
position: Vec3,
target: Vec3,
world_up: Vec3,
fov_y_deg: f32,
aspect: f32,
) -> Self
pub fn look_at( position: Vec3, target: Vec3, world_up: Vec3, fov_y_deg: f32, aspect: f32, ) -> Self
Constructs a pinhole camera looking from position toward target.
§Arguments
Vec3- World-space eye position.Vec3- World-space look target.Vec3- World-space up reference vector.f32- Vertical field of view in degrees.f32- Viewport aspect ratio (width / height).
§Returns
Self- Configured pinholeRtCamera.
Sourcepub fn with_thin_lens(self, aperture_radius: f32, focal_distance: f32) -> Self
pub fn with_thin_lens(self, aperture_radius: f32, focal_distance: f32) -> Self
Sourcepub fn from_camera3d(camera: &Camera3D, aspect: f32) -> Self
pub fn from_camera3d(camera: &Camera3D, aspect: f32) -> Self
Sourcepub fn generate_ray(
&self,
pixel: [u32; 2],
resolution: [u32; 2],
pixel_jitter: [f32; 2],
lens_sample: [f32; 2],
) -> Ray3D
pub fn generate_ray( &self, pixel: [u32; 2], resolution: [u32; 2], pixel_jitter: [f32; 2], lens_sample: [f32; 2], ) -> Ray3D
Generates a world-space primary ray for pixel (px, py) with sub-pixel anti-aliasing jitter and thin-lens aperture sampling.
§Arguments
&Self- Camera reference.[u32; 2]- Integer pixel coordinates[px, py].[u32; 2]- Viewport resolution[width, height].[f32; 2]- Sub-pixel offset in[0.0, 1.0)^2(e.g., fromr2_subpixel_jitteror Halton).[f32; 2]- Uniform lens sample in[0.0, 1.0)^2for thin-lens DoF.
§Returns
Ray3D- Normalized world-space camera ray.
Sourcepub fn motion_fingerprint(&self) -> u64
pub fn motion_fingerprint(&self) -> u64
Source§impl RtCamera
Implements impl #impl_generics #name #ty_generics #where_clause.
impl RtCamera
Implements impl #impl_generics #name #ty_generics #where_clause.
pub fn get_position(&self) -> Vec3
pub fn get_mut_position(&mut self) -> &mut Vec3
pub fn set_position(&mut self, val: Vec3) -> &mut Self
pub fn get_forward(&self) -> Vec3
pub fn get_mut_forward(&mut self) -> &mut Vec3
pub fn set_forward(&mut self, val: Vec3) -> &mut Self
pub fn get_right(&self) -> Vec3
pub fn get_mut_right(&mut self) -> &mut Vec3
pub fn set_right(&mut self, val: Vec3) -> &mut Self
pub fn get_up(&self) -> Vec3
pub fn get_mut_up(&mut self) -> &mut Vec3
pub fn set_up(&mut self, val: Vec3) -> &mut Self
pub fn get_fov_y_rad(&self) -> f32
pub fn get_mut_fov_y_rad(&mut self) -> &mut f32
pub fn set_fov_y_rad(&mut self, val: f32) -> &mut Self
pub fn get_aspect(&self) -> f32
pub fn get_mut_aspect(&mut self) -> &mut f32
pub fn set_aspect(&mut self, val: f32) -> &mut Self
pub fn get_aperture_radius(&self) -> f32
pub fn get_mut_aperture_radius(&mut self) -> &mut f32
pub fn set_aperture_radius(&mut self, val: f32) -> &mut Self
pub fn get_focal_distance(&self) -> f32
pub fn get_mut_focal_distance(&mut self) -> &mut f32
pub fn set_focal_distance(&mut self, val: f32) -> &mut Self
Trait Implementations§
impl Copy for RtCamera
impl StructuralPartialEq for RtCamera
Auto Trait Implementations§
impl Forget for RtCamera
impl Freeze for RtCamera
impl Move for RtCamera
impl RefUnwindSafe for RtCamera
impl Send for RtCamera
impl Sync for RtCamera
impl Unpin for RtCamera
impl UnsafeUnpin for RtCamera
impl UnwindSafe for RtCamera
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more