Struct nalgebra::Perspective3
[−]
[src]
pub struct Perspective3<N> { /* fields omitted */ }
A 3D perspective projection stored without any matrix.
This maps a frustrum cube to the unit cube with corners varying from (-1, -1, -1)
to
(1, 1, 1)
. Reading or modifying its individual properties is cheap but applying the
transformation is costly.
Methods
impl<N: BaseFloat> Perspective3<N>
[src]
fn new(aspect: N, fovy: N, znear: N, zfar: N) -> Perspective3<N>
Creates a new 3D perspective projection.
fn to_matrix(&self) -> Matrix4<N>
Builds a 4D projection matrix (using homogeneous coordinates) for this projection.
fn to_perspective_matrix(&self) -> PerspectiveMatrix3<N>
Build a PerspectiveMatrix3
representing this projection.
impl<N: BaseFloat + Clone> Perspective3<N>
[src]
fn aspect(&self) -> N
Gets the width / height
aspect ratio.
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)
Sets the width / height
aspect ratio of the view frustrum.
This method does not build any matrix.
fn set_fovy(&mut self, fovy: N)
Sets the y field of view of the view frustrum.
This method does not build any matrix.
fn set_znear(&mut self, znear: N)
Sets the near plane offset of the view frustrum.
This method does not build any matrix.
fn set_zfar(&mut self, zfar: N)
Sets the far plane offset of the view frustrum.
This method does not build any matrix.
fn project_point(&self, p: &Point3<N>) -> Point3<N>
Projects a point.
fn project_vector(&self, p: &Vector3<N>) -> Vector3<N>
Projects a vector.
Trait Implementations
impl<N: Eq> Eq for Perspective3<N>
[src]
impl<N: PartialEq> PartialEq for Perspective3<N>
[src]
fn eq(&self, __arg_0: &Perspective3<N>) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, __arg_0: &Perspective3<N>) -> bool
This method tests for !=
.
impl<N: Encodable> Encodable for Perspective3<N>
[src]
impl<N: Decodable> Decodable for Perspective3<N>
[src]
fn decode<__DN: Decoder>(__arg_0: &mut __DN) -> Result<Perspective3<N>, __DN::Error>
impl<N: Clone> Clone for Perspective3<N>
[src]
fn clone(&self) -> Perspective3<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