oa::render::Camera

Semantic camera value. Composes a Transform (placement) with lens parameters (projection shape). get_view_matrix derives from the transform’s position and forward direction. get_projection_matrix uses the lens parameters with Vulkan clip-space conventions (reversed-Y, depth [0, 1]). Donor: oa::Camera / oa::FnCamera.

StRust public API

Declaration

pub struct Camera { /* private fields */ }
Public Rust declaration.

Public Methods

pub const fn transform(&self) -> &Transform
pub fn transform_mut(&mut self) -> &mut Transform
pub fn position(&self) -> Vec3
pub fn set_position(&mut self, position: Vec3)
pub fn look_at(&mut self, target: Vec3)
pub const fn projection(&self) -> CameraProjection
pub const fn fov_y(&self) -> f32
pub fn effective_fov_y(&self) -> f32
pub const fn aspect(&self) -> f32
pub const fn near(&self) -> f32
pub const fn far(&self) -> f32
pub fn set_perspective(&mut self, fov_y: f32, aspect: f32, near: f32, far: f32)
pub fn set_orthographic(&mut self, width: f32, height: f32, near: f32, far: f32)
pub fn set_aspect(&mut self, aspect: f32)
pub fn fit_to_window(&mut self, window_width: f32, window_height: f32)
pub fn set_zoom(&mut self, zoom: f32)
pub const fn zoom(&self) -> f32
pub fn get_view_matrix(&self) -> Mat4
pub fn get_projection_matrix(&self) -> Mat4
pub fn get_view_projection_matrix(&self) -> Mat4
pub fn set_orbit_target(&mut self, target: Vec3)
pub fn set_orbit_distance(&mut self, distance: f32)
pub fn orbit_yaw_pitch(&mut self, yaw_delta: f32, pitch_delta: f32)
pub fn orbit_set_yaw_pitch(&mut self, yaw: f32, pitch: f32)
pub fn validate(&self) -> Result<()>
fn clone(&self) -> Camera
fn fmt(&self, f: &mut Formatter<'_>) -> Result
fn eq(&self, other: &Camera) -> bool

Associated Functions

pub fn new_perspective( position: Vec3, target: Vec3, fov_y: f32, aspect: f32, near: f32, far: f32, ) -> Self
pub fn new_orthographic(width: f32, height: f32, near: f32, far: f32) -> Self
fn default() -> Self

Public Method Documentation

pub const fn transform( &self ) -> &Transform
No public source comment is attached to this declaration.
pub fn transform_mut( &mut self ) -> &mut Transform
No public source comment is attached to this declaration.
pub fn position( &self ) -> Vec3
No public source comment is attached to this declaration.
pub fn set_position( &mut self, position: Vec3 )
No public source comment is attached to this declaration.
pub fn look_at( &mut self, target: Vec3 )
No public source comment is attached to this declaration.
pub const fn projection( &self ) -> CameraProjection
No public source comment is attached to this declaration.
pub const fn fov_y( &self ) -> f32
No public source comment is attached to this declaration.
pub fn effective_fov_y( &self ) -> f32
No public source comment is attached to this declaration.
pub const fn aspect( &self ) -> f32
No public source comment is attached to this declaration.
pub const fn near( &self ) -> f32
No public source comment is attached to this declaration.
pub const fn far( &self ) -> f32
No public source comment is attached to this declaration.
pub fn set_perspective( &mut self, fov_y: f32, aspect: f32, near: f32, far: f32 )
No public source comment is attached to this declaration.
pub fn set_orthographic( &mut self, width: f32, height: f32, near: f32, far: f32 )
No public source comment is attached to this declaration.
pub fn set_aspect( &mut self, aspect: f32 )
No public source comment is attached to this declaration.
pub fn fit_to_window( &mut self, window_width: f32, window_height: f32 )
No public source comment is attached to this declaration.
pub fn set_zoom( &mut self, zoom: f32 )
No public source comment is attached to this declaration.
pub const fn zoom( &self ) -> f32
No public source comment is attached to this declaration.
pub fn get_view_matrix( &self ) -> Mat4
No public source comment is attached to this declaration.
pub fn get_projection_matrix( &self ) -> Mat4
No public source comment is attached to this declaration.
pub fn get_view_projection_matrix( &self ) -> Mat4
No public source comment is attached to this declaration.
pub fn set_orbit_target( &mut self, target: Vec3 )
No public source comment is attached to this declaration.
pub fn set_orbit_distance( &mut self, distance: f32 )
No public source comment is attached to this declaration.
pub fn orbit_yaw_pitch( &mut self, yaw_delta: f32, pitch_delta: f32 )
No public source comment is attached to this declaration.
pub fn orbit_set_yaw_pitch( &mut self, yaw: f32, pitch: f32 )
No public source comment is attached to this declaration.
pub fn validate(&self) -> Result<()>
No public source comment is attached to this declaration.
fn clone( &self ) -> Camera
No public source comment is attached to this declaration.
fn fmt( &self, f: &mut Formatter<'_> ) -> Result
No public source comment is attached to this declaration.
fn eq( &self, other: &Camera ) -> bool
No public source comment is attached to this declaration.
pub fn new_perspective( position: Vec3, target: Vec3, fov_y: f32, aspect: f32, near: f32, far: f32 ) -> Self
No public source comment is attached to this declaration.
pub fn new_orthographic( width: f32, height: f32, near: f32, far: f32 ) -> Self
No public source comment is attached to this declaration.
fn default() -> Self
No public source comment is attached to this declaration.