Struct nalgebra::geometry::PerspectiveBase
[−]
[src]
pub struct PerspectiveBase<N: Scalar, S: Storage<N, U4, U4>> { /* fields omitted */ }
A 3D perspective projection stored as an homogeneous 4x4 matrix.
Methods
impl<N, S> PerspectiveBase<N, S> where
N: Real,
S: OwnedStorage<N, U4, U4>,
S::Alloc: OwnedAllocator<N, U4, U4, S>,
[src]
N: Real,
S: OwnedStorage<N, U4, U4>,
S::Alloc: OwnedAllocator<N, U4, U4, S>,
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.
fn from_matrix_unchecked(matrix: SquareMatrix<N, U4, S>) -> 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.
impl<N, S> PerspectiveBase<N, S> where
N: Real,
S: Storage<N, U4, U4>,
[src]
N: Real,
S: Storage<N, U4, U4>,
fn as_matrix(&self) -> &SquareMatrix<N, U4, S>
A reference to the underlying homogeneous transformation matrix.
fn unwrap(self) -> SquareMatrix<N, U4, S>
Retrieves the underlying homogeneous matrix.
fn inverse(&self) -> OwnedSquareMatrix<N, U4, S::Alloc>
Retrieves the inverse of the underlying homogeneous matrix.
fn to_homogeneous(&self) -> OwnedSquareMatrix<N, U4, S::Alloc>
Computes the corresponding homogeneous matrix.
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 project_point<SB>(
&self,
p: &PointBase<N, U3, SB>
) -> OwnedPoint<N, U3, SB::Alloc> where
SB: Storage<N, U3, U1>,
&self,
p: &PointBase<N, U3, SB>
) -> OwnedPoint<N, U3, SB::Alloc> where
SB: Storage<N, U3, U1>,
Projects a point. Faster than matrix multiplication.
fn unproject_point<SB>(
&self,
p: &PointBase<N, U3, SB>
) -> OwnedPoint<N, U3, SB::Alloc> where
SB: Storage<N, U3, U1>,
&self,
p: &PointBase<N, U3, SB>
) -> OwnedPoint<N, U3, SB::Alloc> where
SB: Storage<N, U3, U1>,
Un-projects a point. Faster than multiplication by the matrix inverse.
fn project_vector<SB>(
&self,
p: &ColumnVector<N, U3, SB>
) -> OwnedColumnVector<N, U3, SB::Alloc> where
SB: Storage<N, U3, U1>,
&self,
p: &ColumnVector<N, U3, SB>
) -> OwnedColumnVector<N, U3, SB::Alloc> where
SB: Storage<N, U3, U1>,
Projects a vector. Faster than matrix multiplication.
impl<N, S> PerspectiveBase<N, S> where
N: Real,
S: StorageMut<N, U4, U4>,
[src]
N: Real,
S: StorageMut<N, U4, U4>,
fn set_aspect(&mut self, aspect: N)
Updates this perspective matrix with a new width / height
aspect ratio of the view
frustrum.
fn set_fovy(&mut self, fovy: N)
Updates this perspective with a new y field of view of the view frustrum.
fn set_znear(&mut self, znear: N)
Updates this perspective matrix with a new near plane offset of the view frustrum.
fn set_zfar(&mut self, zfar: N)
Updates this perspective matrix with a new far plane offset of the view frustrum.
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: Debug + Scalar, S: Debug + Storage<N, U4, U4>> Debug for PerspectiveBase<N, S>
[src]
impl<N: Clone + Scalar, S: Clone + Storage<N, U4, U4>> Clone for PerspectiveBase<N, S>
[src]
fn clone(&self) -> PerspectiveBase<N, S>
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
impl<N: Copy + Scalar, S: Copy + Storage<N, U4, U4>> Copy for PerspectiveBase<N, S>
[src]
impl<N, S> Eq for PerspectiveBase<N, S> where
N: Scalar + Eq,
S: Storage<N, U4, U4>,
[src]
N: Scalar + Eq,
S: Storage<N, U4, U4>,
impl<N, S> PartialEq for PerspectiveBase<N, S> where
N: Scalar,
S: Storage<N, U4, U4>,
[src]
N: Scalar,
S: Storage<N, U4, U4>,
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
This method tests for !=
.
impl<N, S> Rand for PerspectiveBase<N, S> where
N: Real + Rand,
S: OwnedStorage<N, U4, U4>,
S::Alloc: OwnedAllocator<N, U4, U4, S>,
[src]
N: Real + Rand,
S: OwnedStorage<N, U4, U4>,
S::Alloc: OwnedAllocator<N, U4, U4, S>,