[−][src]Struct duku::Camera
The view into a scene.
Examples
let camera = Camera::perspective(90); duku.draw(Some(&camera), |t| { // draw commands });
Fields
position: Vec3
the position of the camera
scale: Vec3
the scale of the camera
rotation: Quat
the rotation of the camera
fov: u32
field of view for perspective cameras
width: Option<f32>
the width of the camera, if width is None
the camera will be automatically sized based
on the render texture or window
height: Option<f32>
the height of the camera, if height is None
the camera will be automatically sized based
on the render texture or window
depth: f32
the depth of the camera
projection: Projection
the projection type of the camera
Implementations
impl Camera
[src]
pub fn perspective(fov: u32) -> Self
[src]
Create a perspective camera that is autosized
pub fn orthographic() -> Self
[src]
Create a orthographic camera that is autosized
pub fn perspective_sized(width: f32, height: f32, fov: u32) -> Self
[src]
Create a perspective camera
pub fn orthographic_sized(width: f32, height: f32) -> Self
[src]
Create a orthographic camera
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
Camera has to have a set height
pub fn move_by(&mut self, amount: impl Into<Vec3>)
[src]
Move camera by specified amount
This moves using global directions
pub fn move_up(&mut self, amount: f32)
[src]
Move camera up by specified amount
This moves using local directions
pub fn move_down(&mut self, amount: f32)
[src]
Move camera down by specified amount
This moves using local directions
pub fn move_right(&mut self, amount: f32)
[src]
Move camera right by specified amount
This moves using local directions
pub fn move_left(&mut self, amount: f32)
[src]
Move camera left by specified amount
This moves using local directions
pub fn move_forward(&mut self, amount: f32)
[src]
Move camera forward by specified amount
This moves using local directions
pub fn move_back(&mut self, amount: f32)
[src]
Move camera back by specified amount
This moves using local directions
pub fn move_around_point(
&mut self,
point: impl Into<Vec3>,
angle: f32,
axis: impl Into<Vec3>
)
[src]
&mut self,
point: impl Into<Vec3>,
angle: f32,
axis: impl Into<Vec3>
)
Move camera rotating it around some point around an axis
pub fn look_dir(&mut self, dir: impl Into<Vec3>)
[src]
Rotate the camera to look in specific direction
pub fn look_at(&mut self, pos: impl Into<Vec3>)
[src]
Rotate the camera to look at specific position
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>,