pub struct View {
pub field_of_view_x: f64,
pub field_of_view_y: f64,
pub image_height: u32,
pub image_width: u32,
pub view_id: u32,
pub view_position: [f64; 3],
pub view_transform: [[f64; 4]; 4],
}
Expand description
A view in 3D space.
Fields§
§field_of_view_x: f64
The horizontal field of view in radians.
field_of_view_y: f64
The vertical field of view in radians.
image_height: u32
Image height.
image_width: u32
Image width.
view_id: u32
View ID.
view_position: [f64; 3]
View position in world space.
view_transform: [[f64; 4]; 4]
Affine transformation from world space to view space.
It is in column-major order, i.e., M[col][row]
.
§Format
[R_v | T_v]
[... | ...]
[0 0 0 | 1 ]
Implementations§
source§impl View
impl View
Dimension operations
sourcepub const fn aspect_ratio(&self) -> f32
pub const fn aspect_ratio(&self) -> f32
Return the aspect ratio (width / height
).
sourcepub fn resize_max(&mut self, to: u32) -> &mut View
pub fn resize_max(&mut self, to: u32) -> &mut View
Resize the view to the maximum side length of to
.
Trait Implementations§
impl Copy for View
impl StructuralPartialEq for View
Auto Trait Implementations§
impl Freeze for View
impl RefUnwindSafe for View
impl Send for View
impl Sync for View
impl Unpin for View
impl UnwindSafe for View
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§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)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