pub struct Camera {
pub position: [f64; 3],
pub forward: [f64; 3],
pub right: [f64; 3],
pub up: [f64; 3],
pub fov_y: f64,
pub aspect: f64,
pub near: f64,
pub aperture: f64,
pub focus_dist: f64,
}Expand description
Perspective camera model for primary ray generation.
Fields§
§position: [f64; 3]Camera position in world space.
forward: [f64; 3]Normalized forward direction.
right: [f64; 3]Normalized right direction.
up: [f64; 3]Normalized up direction.
fov_y: f64Vertical field of view in radians.
aspect: f64Image aspect ratio (width/height).
near: f64Distance to the near plane.
aperture: f64Lens aperture radius (0 = pinhole).
focus_dist: f64Focus distance.
Implementations§
Source§impl Camera
impl Camera
Sourcepub fn look_at(
eye: [f64; 3],
target: [f64; 3],
world_up: [f64; 3],
fov_y_deg: f64,
aspect: f64,
aperture: f64,
focus_dist: f64,
) -> Self
pub fn look_at( eye: [f64; 3], target: [f64; 3], world_up: [f64; 3], fov_y_deg: f64, aspect: f64, aperture: f64, focus_dist: f64, ) -> Self
Create a new perspective camera with look-at setup.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Camera
impl RefUnwindSafe for Camera
impl Send for Camera
impl Sync for Camera
impl Unpin for Camera
impl UnsafeUnpin for Camera
impl UnwindSafe for Camera
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more