pub struct OrbitCamera {
pub target: Vec3,
pub yaw: f32,
pub pitch: f32,
pub distance: f32,
pub fov_y: f32,
pub near: f32,
pub far: f32,
pub aspect_ratio: f32,
}Fields§
§target: Vec3Point the camera orbits around
yaw: f32Azimuth angle (radians, around Y axis)
pitch: f32Elevation angle (radians, clamped)
distance: f32Distance from target
fov_y: f32Vertical field of view (radians)
near: f32Near clipping plane
far: f32Far clipping plane
aspect_ratio: f32Aspect ratio (width / height)
Implementations§
Source§impl OrbitCamera
impl OrbitCamera
pub fn new(target: Vec3, distance: f32) -> Self
Sourcepub fn view_matrix(&self) -> Mat4
pub fn view_matrix(&self) -> Mat4
View matrix (world -> camera)
Sourcepub fn projection_matrix(&self) -> Mat4
pub fn projection_matrix(&self) -> Mat4
Projection matrix
Sourcepub fn view_projection(&self) -> Mat4
pub fn view_projection(&self) -> Mat4
Combined view-projection matrix
Sourcepub fn fit_to_aabb(&mut self, aabb: Aabb)
pub fn fit_to_aabb(&mut self, aabb: Aabb)
Fit camera to show a bounding box
Sourcepub fn view_front(&mut self)
pub fn view_front(&mut self)
Preset: front view
Sourcepub fn view_right(&mut self)
pub fn view_right(&mut self)
Preset: right view
Trait Implementations§
Source§impl Clone for OrbitCamera
impl Clone for OrbitCamera
Source§fn clone(&self) -> OrbitCamera
fn clone(&self) -> OrbitCamera
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for OrbitCamera
impl Debug for OrbitCamera
Auto Trait Implementations§
impl Freeze for OrbitCamera
impl RefUnwindSafe for OrbitCamera
impl Send for OrbitCamera
impl Sync for OrbitCamera
impl Unpin for OrbitCamera
impl UnsafeUnpin for OrbitCamera
impl UnwindSafe for OrbitCamera
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