Struct nalgebra::geometry::Perspective3 [−][src]
pub struct Perspective3<N: Scalar> { /* fields omitted */ }
A 3D perspective projection stored as an homogeneous 4x4 matrix.
Methods
impl<N: Real> Perspective3<N>
[src]
impl<N: Real> Perspective3<N>
pub fn new(aspect: N, fovy: N, znear: N, zfar: N) -> Self
[src]
pub fn new(aspect: N, fovy: N, znear: N, zfar: N) -> Self
Creates a new perspective matrix from the aspect ratio, y field of view, and near/far planes.
pub fn from_matrix_unchecked(matrix: Matrix4<N>) -> Self
[src]
pub fn from_matrix_unchecked(matrix: Matrix4<N>) -> Self
Wraps the given matrix to interpret it as a 3D perspective matrix.
It is not checked whether or not the given matrix actually represents an orthographic projection.
pub fn inverse(&self) -> Matrix4<N>
[src]
pub fn inverse(&self) -> Matrix4<N>
Retrieves the inverse of the underlying homogeneous matrix.
pub fn to_homogeneous(&self) -> Matrix4<N>
[src]
pub fn to_homogeneous(&self) -> Matrix4<N>
Computes the corresponding homogeneous matrix.
pub fn as_matrix(&self) -> &Matrix4<N>
[src]
pub fn as_matrix(&self) -> &Matrix4<N>
A reference to the underlying homogeneous transformation matrix.
pub fn unwrap(self) -> Matrix4<N>
[src]
pub fn unwrap(self) -> Matrix4<N>
Retrieves the underlying homogeneous matrix.
pub fn aspect(&self) -> N
[src]
pub fn aspect(&self) -> N
Gets the width / height
aspect ratio of the view frustrum.
pub fn fovy(&self) -> N
[src]
pub fn fovy(&self) -> N
Gets the y field of view of the view frustrum.
pub fn znear(&self) -> N
[src]
pub fn znear(&self) -> N
Gets the near plane offset of the view frustrum.
pub fn zfar(&self) -> N
[src]
pub fn zfar(&self) -> N
Gets the far plane offset of the view frustrum.
pub fn project_point(&self, p: &Point3<N>) -> Point3<N>
[src]
pub fn project_point(&self, p: &Point3<N>) -> Point3<N>
Projects a point. Faster than matrix multiplication.
pub fn unproject_point(&self, p: &Point3<N>) -> Point3<N>
[src]
pub fn unproject_point(&self, p: &Point3<N>) -> Point3<N>
Un-projects a point. Faster than multiplication by the matrix inverse.
pub fn project_vector<SB>(&self, p: &Vector<N, U3, SB>) -> Vector3<N> where
SB: Storage<N, U3>,
[src]
pub fn project_vector<SB>(&self, p: &Vector<N, U3, SB>) -> Vector3<N> where
SB: Storage<N, U3>,
Projects a vector. Faster than matrix multiplication.
pub fn set_aspect(&mut self, aspect: N)
[src]
pub fn set_aspect(&mut self, aspect: N)
Updates this perspective matrix with a new width / height
aspect ratio of the view
frustrum.
pub fn set_fovy(&mut self, fovy: N)
[src]
pub fn set_fovy(&mut self, fovy: N)
Updates this perspective with a new y field of view of the view frustrum.
pub fn set_znear(&mut self, znear: N)
[src]
pub fn set_znear(&mut self, znear: N)
Updates this perspective matrix with a new near plane offset of the view frustrum.
pub fn set_zfar(&mut self, zfar: N)
[src]
pub fn set_zfar(&mut self, zfar: N)
Updates this perspective matrix with a new far plane offset of the view frustrum.
pub fn set_znear_and_zfar(&mut self, znear: N, zfar: N)
[src]
pub fn set_znear_and_zfar(&mut self, znear: N, zfar: N)
Updates this perspective matrix with new near and far plane offsets of the view frustrum.
Trait Implementations
impl<N: Real> Copy for Perspective3<N>
[src]
impl<N: Real> Copy for Perspective3<N>
impl<N: Real> Clone for Perspective3<N>
[src]
impl<N: Real> Clone for Perspective3<N>
fn clone(&self) -> Self
[src]
fn clone(&self) -> Self
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
impl<N: Real> Debug for Perspective3<N>
[src]
impl<N: Real> Debug for Perspective3<N>
fn fmt(&self, f: &mut Formatter) -> Result<(), Error>
[src]
fn fmt(&self, f: &mut Formatter) -> Result<(), Error>
Formats the value using the given formatter. Read more
impl<N: Real> PartialEq for Perspective3<N>
[src]
impl<N: Real> PartialEq for Perspective3<N>
fn eq(&self, right: &Self) -> bool
[src]
fn eq(&self, right: &Self) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
fn ne(&self, other: &Rhs) -> bool
This method tests for !=
.
impl<N: Real> Distribution<Perspective3<N>> for Standard where
Standard: Distribution<N>,
[src]
impl<N: Real> Distribution<Perspective3<N>> for Standard where
Standard: Distribution<N>,
fn sample<'a, R: Rng + ?Sized>(&self, r: &'a mut R) -> Perspective3<N>
[src]
fn sample<'a, R: Rng + ?Sized>(&self, r: &'a mut R) -> Perspective3<N>
Generate a random value of T
, using rng
as the source of randomness.
ⓘImportant traits for DistIter<'a, D, R, T>fn sample_iter<R>(&'a self, rng: &'a mut R) -> DistIter<'a, Self, R, T> where
R: Rng,
[src]
fn sample_iter<R>(&'a self, rng: &'a mut R) -> DistIter<'a, Self, R, T> where
R: Rng,
Create an iterator that generates random values of T
, using rng
as the source of randomness. Read more
Auto Trait Implementations
impl<N> Send for Perspective3<N> where
N: Send,
impl<N> Send for Perspective3<N> where
N: Send,
impl<N> Sync for Perspective3<N> where
N: Sync,
impl<N> Sync for Perspective3<N> where
N: Sync,