[−][src]Struct ngen::camera::Camera
A very simple perspective camera.
Fields
eye: P3
look_at: P3
up: Vec3
aspect_ratio: f32
fov: f32
near: f32
far: f32
perspective: Mat4
Implementations
impl Camera
[src]
pub fn new(eye: P3, look_at: P3, aspect_ratio: f32) -> Self
[src]
pub fn from_tiles(tile_width: u32) -> Self
[src]
Creates a camera based on how many tiles to display in the screen, where tile width is calculated as (screen_width / tiles_per_x). To keep things simple, we assume as screen size of 1920x1080 for now.
pub fn perspective_transform(&self) -> Mat4
[src]
pub fn look_at_transform(&self) -> Mat4
[src]
pub fn build_transform(&self) -> Mat4
[src]
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for Camera
impl Send for Camera
impl Sync for Camera
impl Unpin for Camera
impl UnwindSafe for Camera
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,