[−][src]Struct duku::Camera
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]
projection: Projection,
width: f32,
height: f32,
depth: f32,
fov: u32
) -> Self
Create a new camera
pub fn fake_orthographic(&mut self, enable: bool)
[src]
Convert perspective camera to a zoomed-in orthographic one
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,
pub 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.
pub fn to_owned(&self) -> T
[src]
pub 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.
pub 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>,