[−][src]Struct screen_13::camera::Perspective
A standard perspective camera.
Implementations
impl Perspective
[src]
pub fn new(
eye: Vec3,
target: Vec3,
depth: Range<f32>,
fov: f32,
aspect_ratio: f32
) -> Self
[src]
eye: Vec3,
target: Vec3,
depth: Range<f32>,
fov: f32,
aspect_ratio: f32
) -> Self
Creates a new perspective camera using +y as the default "up" vector.
Arguments
eye
- Position this camera is pointing from.target
- Position this camera is pointing towards.depth
- Range of distance this camera can see.fov
- Full field of view on the X axis, in degrees.aspect_ratio
- Width of the view of this camera divided by height.
pub fn new_view<S: Into<CoordF>>(
eye: Vec3,
target: Vec3,
depth: Range<f32>,
fov: f32,
shape: S
) -> Self
[src]
eye: Vec3,
target: Vec3,
depth: Range<f32>,
fov: f32,
shape: S
) -> Self
Creates a new perspective camera using +y as the default "up" vector.
Arguments
eye
- Position this camera is pointing from.target
- Position this camera is pointing towards.depth
- Range of distance this camera can see.fov
- Full field of view on the X axis, in degrees.shape
- Defines the aspect ratio of the view of this camera.
pub fn aspect_ratio(&self) -> f32
[src]
Returns the width of the view of this camera compared to the height.
pub fn eye(&self) -> Vec3
[src]
Returns the position this camera is pointing from.
pub const fn far(&self) -> f32
[src]
Returns the maximum distance this camera can see.
pub fn fov(&self) -> f32
[src]
Returns the full field of view of the X axis, in degrees.
pub const fn near(&self) -> f32
[src]
Returns the minimum distance this camera can see.
pub fn target(&self) -> Vec3
[src]
Returns the position this camera is pointing towards.
pub fn up(&self) -> Vec3
[src]
Returns the orientation of the view of this camera, which is +y by default.
pub fn set_aspect_ratio(&mut self, val: f32)
[src]
Modifies the shape of this camera.
Arguments
val
- Width of the output of this camera divided by height.
pub fn set_depth(&mut self, val: Range<f32>)
[src]
Modifies the near and far planes of this camera, which defines the distance this camera can see.
pub fn set_eye(&mut self, val: Vec3)
[src]
Modifies the position which this camera is pointing from.
pub fn set_fov(&mut self, val: f32)
[src]
Modifies the field of view of this camera.
pub fn set_target(&mut self, val: Vec3)
[src]
Modifies the position which this camera is pointing towards.
pub fn set_up(&mut self, val: Vec3)
[src]
Modifies the orientation of the view of this camera.
pub fn set_view<S: Into<CoordF>>(&mut self, shape: S, fov: f32)
[src]
Modifies the shape and field of view of this camera.
Arguments
shape
- Defines the aspect ratio of the view of this camera.fov
- Full field of view on the X axis, in degrees.
Trait Implementations
impl Camera for Perspective
[src]
pub fn depth(&self) -> &Range<f32>
[src]
pub fn eye(&self) -> Vec3
[src]
pub fn overlaps_cone(&self, c: Cone) -> bool
[src]
pub fn overlaps_point(&self, p: Vec3) -> bool
[src]
pub fn overlaps_sphere(&self, s: Sphere) -> bool
[src]
pub fn project_point(&self, p: Vec3) -> Vec3
[src]
pub fn projection(&self) -> Mat4
[src]
pub fn unproject_point(&self, p: Vec3) -> Vec3
[src]
pub fn view(&self) -> Mat4
[src]
pub fn view_inv(&self) -> Mat4
[src]
pub fn corners(&self) -> [Vec3; 8]
[src]
impl Clone for Perspective
[src]
pub fn clone(&self) -> Perspective
[src]
pub fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Default for Perspective
[src]
Auto Trait Implementations
impl RefUnwindSafe for Perspective
[src]
impl Send for Perspective
[src]
impl Sync for Perspective
[src]
impl Unpin for Perspective
[src]
impl UnwindSafe for Perspective
[src]
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> Pointable for T
pub const ALIGN: usize
type Init = T
The type for initializers.
pub unsafe fn init(init: <T as Pointable>::Init) -> usize
pub unsafe fn deref<'a>(ptr: usize) -> &'a T
pub unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T
pub unsafe fn drop(ptr: usize)
impl<T> Same<T> for T
[src]
type Output = T
Should always be Self
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>,