[][src]Struct duku::Camera

pub struct Camera {
    pub transform: Transform,
    pub autosize: bool,
    pub fov: u32,
    pub width: f32,
    pub height: f32,
    pub depth: f32,
    pub projection: Projection,
}

The view into a scene.

Example

This example is not tested
let camera = Camera::projection_autosized(90);

duku.draw_on_window(Some(&camera), |target| {
    // draw commands
});

Fields

transform: Transform

the transform of the camera

autosize: bool

autosized cameras change their size based on the framebuffer rendered to

fov: u32

field of view for perspective cameras

width: f32

the width of the camera

height: f32

the height of the camera

depth: f32

the depth of the camera

projection: Projection

the projection type of the camera

Implementations

impl Camera[src]

pub fn perspective(width: f32, height: f32, fov: u32) -> Self[src]

Create a perspective camera

pub fn orthographic(width: f32, height: f32) -> Self[src]

Create a orthographic camera

pub fn perspective_autosized(fov: u32) -> Self[src]

Create a perspective camera that is autosized

pub fn orthographic_autosized() -> Self[src]

Create a orthographic camera that is autosized

pub fn new(
    projection: Projection,
    width: f32,
    height: f32,
    depth: f32,
    fov: u32
) -> Self
[src]

Create a new camera

pub fn fake_orthographic(&mut self, enable: bool)[src]

Convert perspective camera to a zoomed-in orthographic one

Trait Implementations

impl Clone for Camera[src]

impl Debug for Camera[src]

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]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.