Struct nalgebra::PerspectiveMatrix3
[−]
[src]
pub struct PerspectiveMatrix3<N> { /* fields omitted */ }
A 3D perspective projection stored as a 4D matrix.
This maps a frustrum to the unit cube with corners varying from (-1, -1, -1)
to
(1, 1, 1)
. Reading or modifying its individual properties is costly but applying the
transformation is cheap.
Methods
impl<N: BaseFloat> PerspectiveMatrix3<N>
[src]
fn new(aspect: N, fovy: N, znear: N, zfar: N) -> PerspectiveMatrix3<N>
Creates a new perspective matrix from the aspect ratio, y field of view, and near/far planes.
unsafe fn new_with_matrix(matrix: Matrix4<N>) -> PerspectiveMatrix3<N>
Creates a new perspective projection matrix from a 4D matrix.
This is unsafe because the input matrix is not checked to be a perspective projection.
fn as_matrix<'a>(&'a self) -> &'a Matrix4<N>
Returns a reference to the 4D matrix (using homogeneous coordinates) of this projection.
fn aspect(&self) -> N
Gets the width / height
aspect ratio of the view frustrum.
fn fovy(&self) -> N
Gets the y field of view of the view frustrum.
fn znear(&self) -> N
Gets the near plane offset of the view frustrum.
fn zfar(&self) -> N
Gets the far plane offset of the view frustrum.
fn set_aspect(&mut self, aspect: N)
Updates this projection matrix with a new width / height
aspect ratio of the view
frustrum.
fn set_fovy(&mut self, fovy: N)
Updates this projection with a new y field of view of the view frustrum.
fn set_znear(&mut self, znear: N)
Updates this projection matrix with a new near plane offset of the view frustrum.
fn set_zfar(&mut self, zfar: N)
Updates this projection matrix with a new far plane offset of the view frustrum.
fn set_znear_and_zfar(&mut self, znear: N, zfar: N)
Updates this projection matrix with new near and far plane offsets of the view frustrum.
fn project_point(&self, p: &Point3<N>) -> Point3<N>
Projects a point.
fn project_vector(&self, p: &Vector3<N>) -> Vector3<N>
Projects a vector.
impl<N: BaseFloat + Clone> PerspectiveMatrix3<N>
[src]
fn to_matrix<'a>(&'a self) -> Matrix4<N>
Returns the 4D matrix (using homogeneous coordinates) of this projection.
Trait Implementations
impl<N: Eq> Eq for PerspectiveMatrix3<N>
[src]
impl<N: PartialEq> PartialEq for PerspectiveMatrix3<N>
[src]
fn eq(&self, __arg_0: &PerspectiveMatrix3<N>) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, __arg_0: &PerspectiveMatrix3<N>) -> bool
This method tests for !=
.
impl<N: Encodable> Encodable for PerspectiveMatrix3<N>
[src]
impl<N: Decodable> Decodable for PerspectiveMatrix3<N>
[src]
fn decode<__DN: Decoder>(__arg_0: &mut __DN) -> Result<PerspectiveMatrix3<N>, __DN::Error>
impl<N: Clone> Clone for PerspectiveMatrix3<N>
[src]
fn clone(&self) -> PerspectiveMatrix3<N>
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0
Performs copy-assignment from source
. Read more