pub struct Camera3D { /* private fields */ }Expand description
3D perspective camera supporting free-fly, third-person follow, yaw/pitch orbit, and frustum culling.
Implementations§
Source§impl Camera3D
Orientation, movement, and view-projection helpers for Camera3D.
impl Camera3D
Orientation, movement, and view-projection helpers for Camera3D.
Sourcepub fn focal_length_to_fov_deg(
focal_length_mm: f32,
sensor_height_mm: f32,
) -> f32
pub fn focal_length_to_fov_deg( focal_length_mm: f32, sensor_height_mm: f32, ) -> f32
Converts a physical camera focal length and full-frame sensor height in millimeters to vertical FOV degrees.
§Arguments
f32- Lens focal length in millimeters (e.g.,24.0,35.0,50.0,85.0).f32- Camera sensor height in millimeters (24.0for 35mm full-frame).
§Returns
f32- Vertical field of view in degrees clamped to[12.0, 120.0].
Sourcepub fn from_lens(
position: Vec3,
yaw: f32,
pitch: f32,
focal_length_mm: f32,
) -> Self
pub fn from_lens( position: Vec3, yaw: f32, pitch: f32, focal_length_mm: f32, ) -> Self
Constructs a physically based 35mm full-frame Camera3D using lens focal length in millimeters.
§Arguments
Vec3- World-space eye position.f32- Horizontal yaw angle in radians.f32- Vertical pitch angle in radians.f32- Lens focal length in millimeters.
§Returns
Self- Physically configured perspective camera.
Sourcepub fn ev100(aperture_fstop: f32, shutter_seconds: f32, iso: f32) -> f32
pub fn ev100(aperture_fstop: f32, shutter_seconds: f32, iso: f32) -> f32
Computes physical exposure value EV100 from lens aperture (f-stop), shutter speed (seconds), and ISO.
§Arguments
f32- Aperture f-number (e.g.,2.8,4.0,8.0).f32- Shutter exposure time in seconds (e.g.,1.0 / 125.0).f32- Sensor ISO sensitivity (e.g.,100.0).
§Returns
f32- Physical exposure valueEV100.
Sourcepub fn exposure_scale_from_ev100(ev100: f32) -> f32
pub fn exposure_scale_from_ev100(ev100: f32) -> f32
Source§impl Camera3D
impl Camera3D
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_yaw(&self) -> f32
pub fn get_mut_yaw(&mut self) -> &mut f32
pub fn set_yaw(&mut self, val: f32) -> &mut Self
pub fn get_pitch(&self) -> f32
pub fn get_mut_pitch(&mut self) -> &mut f32
pub fn set_pitch(&mut self, val: f32) -> &mut Self
pub fn get_fov_deg(&self) -> f32
pub fn get_mut_fov_deg(&mut self) -> &mut f32
pub fn set_fov_deg(&mut self, val: f32) -> &mut Self
pub fn get_near(&self) -> f32
pub fn get_mut_near(&mut self) -> &mut f32
pub fn set_near(&mut self, val: f32) -> &mut Self
pub fn get_far(&self) -> f32
pub fn get_mut_far(&mut self) -> &mut f32
pub fn set_far(&mut self, val: f32) -> &mut Self
Trait Implementations§
impl Copy for Camera3D
impl StructuralPartialEq for Camera3D
Auto Trait Implementations§
impl Forget for Camera3D
impl Freeze for Camera3D
impl Move for Camera3D
impl RefUnwindSafe for Camera3D
impl Send for Camera3D
impl Sync for Camera3D
impl Unpin for Camera3D
impl UnsafeUnpin for Camera3D
impl UnwindSafe for Camera3D
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