Struct nalgebra::geometry::Perspective3 [−][src]
pub struct Perspective3<T: Scalar> { /* fields omitted */ }
Expand description
A 3D perspective projection stored as a homogeneous 4x4 matrix.
Implementations
impl<T: RealField> Perspective3<T>
[src]
impl<T: RealField> Perspective3<T>
[src]pub fn new(aspect: T, fovy: T, znear: T, zfar: T) -> Self
[src]
pub fn new(aspect: T, fovy: T, znear: T, zfar: T) -> 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<T>) -> Self
[src]
pub fn from_matrix_unchecked(matrix: Matrix4<T>) -> 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 a perspective projection.
pub fn to_homogeneous(&self) -> Matrix4<T>
[src]
pub fn to_homogeneous(&self) -> Matrix4<T>
[src]Computes the corresponding homogeneous matrix.
pub fn as_matrix(&self) -> &Matrix4<T>
[src]
pub fn as_matrix(&self) -> &Matrix4<T>
[src]A reference to the underlying homogeneous transformation matrix.
pub fn as_projective(&self) -> &Projective3<T>
[src]
pub fn as_projective(&self) -> &Projective3<T>
[src]A reference to this transformation seen as a Projective3
.
pub fn to_projective(&self) -> Projective3<T>
[src]
pub fn to_projective(&self) -> Projective3<T>
[src]This transformation seen as a Projective3
.
pub fn into_inner(self) -> Matrix4<T>
[src]
pub fn into_inner(self) -> Matrix4<T>
[src]Retrieves the underlying homogeneous matrix.
pub fn unwrap(self) -> Matrix4<T>
[src]
👎 Deprecated: use .into_inner()
instead
pub fn unwrap(self) -> Matrix4<T>
[src]use .into_inner()
instead
Retrieves the underlying homogeneous matrix. Deprecated: Use Perspective3::into_inner instead.
pub fn project_point(&self, p: &Point3<T>) -> Point3<T>
[src]
pub fn project_point(&self, p: &Point3<T>) -> Point3<T>
[src]Projects a point. Faster than matrix multiplication.
pub fn unproject_point(&self, p: &Point3<T>) -> Point3<T>
[src]
pub fn unproject_point(&self, p: &Point3<T>) -> Point3<T>
[src]Un-projects a point. Faster than multiplication by the matrix inverse.
pub fn project_vector<SB>(&self, p: &Vector<T, U3, SB>) -> Vector3<T> where
SB: Storage<T, U3>,
[src]
pub fn project_vector<SB>(&self, p: &Vector<T, U3, SB>) -> Vector3<T> where
SB: Storage<T, U3>,
[src]Projects a vector. Faster than matrix multiplication.
pub fn set_aspect(&mut self, aspect: T)
[src]
pub fn set_aspect(&mut self, aspect: T)
[src]Updates this perspective matrix with a new width / height
aspect ratio of the view
frustum.
pub fn set_fovy(&mut self, fovy: T)
[src]
pub fn set_fovy(&mut self, fovy: T)
[src]Updates this perspective with a new y field of view of the view frustum.
pub fn set_znear(&mut self, znear: T)
[src]
pub fn set_znear(&mut self, znear: T)
[src]Updates this perspective matrix with a new near plane offset of the view frustum.
pub fn set_zfar(&mut self, zfar: T)
[src]
pub fn set_zfar(&mut self, zfar: T)
[src]Updates this perspective matrix with a new far plane offset of the view frustum.
pub fn set_znear_and_zfar(&mut self, znear: T, zfar: T)
[src]
pub fn set_znear_and_zfar(&mut self, znear: T, zfar: T)
[src]Updates this perspective matrix with new near and far plane offsets of the view frustum.
Trait Implementations
impl<T: RealField> Clone for Perspective3<T>
[src]
impl<T: RealField> Clone for Perspective3<T>
[src]impl<T: RealField> Debug for Perspective3<T>
[src]
impl<T: RealField> Debug for Perspective3<T>
[src]impl<T: RealField> From<Perspective3<T>> for Matrix4<T>
[src]
impl<T: RealField> From<Perspective3<T>> for Matrix4<T>
[src]fn from(pers: Perspective3<T>) -> Self
[src]
fn from(pers: Perspective3<T>) -> Self
[src]Performs the conversion.
impl<T: RealField> PartialEq<Perspective3<T>> for Perspective3<T>
[src]
impl<T: RealField> PartialEq<Perspective3<T>> for Perspective3<T>
[src]impl<T: RealField> Copy for Perspective3<T>
[src]
Auto Trait Implementations
impl<T> RefUnwindSafe for Perspective3<T> where
T: RefUnwindSafe,
T: RefUnwindSafe,
impl<T> Send for Perspective3<T> where
T: Send,
T: Send,
impl<T> Sync for Perspective3<T> where
T: Sync,
T: Sync,
impl<T> Unpin for Perspective3<T> where
T: Unpin,
T: Unpin,
impl<T> UnwindSafe for Perspective3<T> where
T: UnwindSafe,
T: UnwindSafe,
Blanket Implementations
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]pub fn borrow_mut(&mut self) -> &mut T
[src]
pub fn borrow_mut(&mut self) -> &mut T
[src]Mutably borrows from an owned value. Read more
impl<SS, SP> SupersetOf<SS> for SP where
SS: SubsetOf<SP>,
[src]
impl<SS, SP> SupersetOf<SS> for SP where
SS: SubsetOf<SP>,
[src]pub fn to_subset(&self) -> Option<SS>
[src]
pub fn to_subset(&self) -> Option<SS>
[src]The inverse inclusion map: attempts to construct self
from the equivalent element of its
superset. Read more
pub fn is_in_subset(&self) -> bool
[src]
pub fn is_in_subset(&self) -> bool
[src]Checks if self
is actually part of its subset T
(and can be converted to it).
pub fn to_subset_unchecked(&self) -> SS
[src]
pub fn to_subset_unchecked(&self) -> SS
[src]Use with care! Same as self.to_subset
but without any property checks. Always succeeds.
pub fn from_subset(element: &SS) -> SP
[src]
pub fn from_subset(element: &SS) -> SP
[src]The inclusion map: converts self
to the equivalent element of its superset.
impl<T> ToOwned for T where
T: Clone,
[src]
impl<T> ToOwned for T where
T: Clone,
[src]type Owned = T
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn to_owned(&self) -> T
[src]Creates owned data from borrowed data, usually by cloning. Read more
pub fn clone_into(&self, target: &mut T)
[src]
pub fn clone_into(&self, target: &mut T)
[src]🔬 This is a nightly-only experimental API. (toowned_clone_into
)
recently added
Uses borrowed data to replace owned data, usually by cloning. Read more
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,