pub struct CameraParameters {
pub intrinsics: CameraIntrinsics,
pub extrinsics: CameraExtrinsics,
}Expand description
Combined camera parameters (intrinsics + extrinsics).
Fields§
§intrinsics: CameraIntrinsicsIntrinsic parameters (FoV, aspect ratio).
extrinsics: CameraExtrinsicsExtrinsic parameters (position, orientation).
Implementations§
Source§impl CameraParameters
impl CameraParameters
Sourcepub fn new(intrinsics: CameraIntrinsics, extrinsics: CameraExtrinsics) -> Self
pub fn new(intrinsics: CameraIntrinsics, extrinsics: CameraExtrinsics) -> Self
Creates new camera parameters.
Sourcepub fn from_vectors(
position: Vec3,
look_dir: Vec3,
up_dir: Vec3,
fov_vertical_degrees: f32,
aspect_ratio: f32,
) -> Self
pub fn from_vectors( position: Vec3, look_dir: Vec3, up_dir: Vec3, fov_vertical_degrees: f32, aspect_ratio: f32, ) -> Self
Creates camera parameters from vectors.
Sourcepub fn look_at(
position: Vec3,
target: Vec3,
up: Vec3,
fov_vertical_degrees: f32,
aspect_ratio: f32,
) -> Self
pub fn look_at( position: Vec3, target: Vec3, up: Vec3, fov_vertical_degrees: f32, aspect_ratio: f32, ) -> Self
Creates camera parameters for looking at a target.
Sourcepub fn camera_frame(&self) -> (Vec3, Vec3, Vec3)
pub fn camera_frame(&self) -> (Vec3, Vec3, Vec3)
Gets the camera frame as (look, up, right).
Sourcepub fn fov_vertical_degrees(&self) -> f32
pub fn fov_vertical_degrees(&self) -> f32
Gets the vertical field of view in degrees.
Sourcepub fn aspect_ratio(&self) -> f32
pub fn aspect_ratio(&self) -> f32
Gets the aspect ratio (width / height).
Sourcepub fn view_matrix(&self) -> Mat4
pub fn view_matrix(&self) -> Mat4
Gets the view matrix.
Sourcepub fn projection_matrix(&self, near: f32, far: f32) -> Mat4
pub fn projection_matrix(&self, near: f32, far: f32) -> Mat4
Gets the projection matrix.
Trait Implementations§
Source§impl Clone for CameraParameters
impl Clone for CameraParameters
Source§fn clone(&self) -> CameraParameters
fn clone(&self) -> CameraParameters
Returns a duplicate of the value. Read more
1.0.0 · 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 CameraParameters
impl Debug for CameraParameters
Source§impl Default for CameraParameters
impl Default for CameraParameters
Source§fn default() -> CameraParameters
fn default() -> CameraParameters
Returns the “default value” for a type. Read more
impl Copy for CameraParameters
Auto Trait Implementations§
impl Freeze for CameraParameters
impl RefUnwindSafe for CameraParameters
impl Send for CameraParameters
impl Sync for CameraParameters
impl Unpin for CameraParameters
impl UnsafeUnpin for CameraParameters
impl UnwindSafe for CameraParameters
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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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 moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<R, P> ReadPrimitive<R> for P
impl<R, P> ReadPrimitive<R> for P
Source§fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
Read this value from the supplied reader. Same as
ReadEndian::read_from_little_endian().