Skip to main content

RtCamera

Struct RtCamera 

Source
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.

Source

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 pinhole RtCamera.
Source

pub fn with_thin_lens(self, aperture_radius: f32, focal_distance: f32) -> Self

Configures thin-lens Depth-of-Field optics on this camera.

§Arguments
  • Self - Base camera.
  • f32 - Lens aperture radius in meters (0.0 = sharp pinhole).
  • f32 - Distance to the sharp focal plane in meters.
§Returns
  • Self - Camera with thin-lens depth-of-field parameters.
Source

pub fn from_camera3d(camera: &Camera3D, aspect: f32) -> Self

Converts an existing euv-core Camera3D into a matching RtCamera.

§Arguments
  • &Camera3D - Source 3D viewport camera.
  • f32 - Viewport width-to-height aspect ratio.
§Returns
  • Self - Matching ray-tracing camera.
Source

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., from r2_subpixel_jitter or Halton).
  • [f32; 2] - Uniform lens sample in [0.0, 1.0)^2 for thin-lens DoF.
§Returns
  • Ray3D - Normalized world-space camera ray.
Source

pub fn motion_fingerprint(&self) -> u64

Computes a deterministic bit-exact 64-bit fingerprint of camera pose and optics for temporal accumulation reset detection.

§Arguments
  • &Self - Camera reference.
§Returns
  • u64 - Stable 64-bit hash changing whenever any camera parameter mutates.
Source§

impl RtCamera

Implements impl #impl_generics #name #ty_generics #where_clause.

Source

pub fn get_position(&self) -> Vec3

Source

pub fn get_mut_position(&mut self) -> &mut Vec3

Source

pub fn set_position(&mut self, val: Vec3) -> &mut Self

Source

pub fn get_forward(&self) -> Vec3

Source

pub fn get_mut_forward(&mut self) -> &mut Vec3

Source

pub fn set_forward(&mut self, val: Vec3) -> &mut Self

Source

pub fn get_right(&self) -> Vec3

Source

pub fn get_mut_right(&mut self) -> &mut Vec3

Source

pub fn set_right(&mut self, val: Vec3) -> &mut Self

Source

pub fn get_up(&self) -> Vec3

Source

pub fn get_mut_up(&mut self) -> &mut Vec3

Source

pub fn set_up(&mut self, val: Vec3) -> &mut Self

Source

pub fn get_fov_y_rad(&self) -> f32

Source

pub fn get_mut_fov_y_rad(&mut self) -> &mut f32

Source

pub fn set_fov_y_rad(&mut self, val: f32) -> &mut Self

Source

pub fn get_aspect(&self) -> f32

Source

pub fn get_mut_aspect(&mut self) -> &mut f32

Source

pub fn set_aspect(&mut self, val: f32) -> &mut Self

Source

pub fn get_aperture_radius(&self) -> f32

Source

pub fn get_mut_aperture_radius(&mut self) -> &mut f32

Source

pub fn set_aperture_radius(&mut self, val: f32) -> &mut Self

Source

pub fn get_focal_distance(&self) -> f32

Source

pub fn get_mut_focal_distance(&mut self) -> &mut f32

Source

pub fn set_focal_distance(&mut self, val: f32) -> &mut Self

Trait Implementations§

Source§

impl Clone for RtCamera

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for RtCamera

Source§

impl Debug for RtCamera

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for RtCamera

Default pinhole camera positioned on +Z looking toward the origin.

Source§

fn default() -> Self

Creates a default 16:9 pinhole camera at (0, 1.5, 5.0) looking at (0, 1.0, 0).

§Returns
  • Self - Default RtCamera.
Source§

impl PartialEq for RtCamera

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for RtCamera

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.