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]
pub fn new(aspect: N, fovy: N, znear: N, zfar: N) -> Self
[src]
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]
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]
Retrieves the inverse of the underlying homogeneous matrix.
pub fn to_homogeneous(&self) -> Matrix4<N>
[src]
Computes the corresponding homogeneous matrix.
pub fn as_matrix(&self) -> &Matrix4<N>
[src]
A reference to the underlying homogeneous transformation matrix.
pub fn unwrap(self) -> Matrix4<N>
[src]
Retrieves the underlying homogeneous matrix.
pub fn aspect(&self) -> N
[src]
Gets the width / height
aspect ratio of the view frustrum.
pub fn fovy(&self) -> N
[src]
Gets the y field of view of the view frustrum.
pub fn znear(&self) -> N
[src]
Gets the near plane offset of the view frustrum.
pub fn zfar(&self) -> N
[src]
Gets the far plane offset of the view frustrum.
pub fn project_point(&self, p: &Point3<N>) -> Point3<N>
[src]
Projects a point. Faster than matrix multiplication.
pub fn unproject_point(&self, p: &Point3<N>) -> Point3<N>
[src]
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]
SB: Storage<N, U3>,
Projects a vector. Faster than matrix multiplication.
pub fn set_aspect(&mut self, aspect: N)
[src]
Updates this perspective matrix with a new width / height
aspect ratio of the view
frustrum.
pub fn set_fovy(&mut self, fovy: N)
[src]
Updates this perspective with a new y field of view of the view frustrum.
pub fn set_znear(&mut self, znear: N)
[src]
Updates this perspective matrix with a new near plane offset of the view frustrum.
pub fn set_zfar(&mut self, zfar: N)
[src]
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]
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> Clone for Perspective3<N>
[src]
fn clone(&self) -> Self
[src]
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl<N: Real> Debug for Perspective3<N>
[src]
fn fmt(&self, f: &mut Formatter) -> Result<(), Error>
[src]
Formats the value using the given formatter. Read more
impl<N: Real> PartialEq for Perspective3<N>
[src]
fn eq(&self, right: &Self) -> bool
[src]
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]
This method tests for !=
.