Struct nalgebra::geometry::Orthographic3
source · pub struct Orthographic3<N: Real> { /* private fields */ }
Expand description
A 3D orthographic projection stored as an homogeneous 4x4 matrix.
Implementations§
source§impl<N: Real> Orthographic3<N>
impl<N: Real> Orthographic3<N>
sourcepub fn new(left: N, right: N, bottom: N, top: N, znear: N, zfar: N) -> Self
pub fn new(left: N, right: N, bottom: N, top: N, znear: N, zfar: N) -> Self
Creates a new orthographic projection matrix.
sourcepub fn from_matrix_unchecked(matrix: Matrix4<N>) -> Self
pub fn from_matrix_unchecked(matrix: Matrix4<N>) -> Self
Wraps the given matrix to interpret it as a 3D orthographic matrix.
It is not checked whether or not the given matrix actually represents an orthographic projection.
sourcepub fn from_fov(aspect: N, vfov: N, znear: N, zfar: N) -> Self
pub fn from_fov(aspect: N, vfov: N, znear: N, zfar: N) -> Self
Creates a new orthographic projection matrix from an aspect ratio and the vertical field of view.
sourcepub fn inverse(&self) -> Matrix4<N>
pub fn inverse(&self) -> Matrix4<N>
Retrieves the inverse of the underlying homogeneous matrix.
sourcepub fn to_homogeneous(&self) -> Matrix4<N>
pub fn to_homogeneous(&self) -> Matrix4<N>
Computes the corresponding homogeneous matrix.
sourcepub fn as_matrix(&self) -> &Matrix4<N>
pub fn as_matrix(&self) -> &Matrix4<N>
A reference to the underlying homogeneous transformation matrix.
sourcepub fn as_projective(&self) -> &Projective3<N>
pub fn as_projective(&self) -> &Projective3<N>
A reference to this transformation seen as a Projective3
.
sourcepub fn to_projective(&self) -> Projective3<N>
pub fn to_projective(&self) -> Projective3<N>
This transformation seen as a Projective3
.
sourcepub fn project_point(&self, p: &Point3<N>) -> Point3<N>
pub fn project_point(&self, p: &Point3<N>) -> Point3<N>
Projects a point. Faster than matrix multiplication.
sourcepub fn unproject_point(&self, p: &Point3<N>) -> Point3<N>
pub fn unproject_point(&self, p: &Point3<N>) -> Point3<N>
Un-projects a point. Faster than multiplication by the underlying matrix inverse.
sourcepub fn project_vector<SB>(&self, p: &Vector<N, U3, SB>) -> Vector3<N>where
SB: Storage<N, U3>,
pub fn project_vector<SB>(&self, p: &Vector<N, U3, SB>) -> Vector3<N>where
SB: Storage<N, U3>,
Projects a vector. Faster than matrix multiplication.
sourcepub fn set_bottom(&mut self, bottom: N)
pub fn set_bottom(&mut self, bottom: N)
Sets the smallest y-coordinate of the view cuboid.
sourcepub fn set_left_and_right(&mut self, left: N, right: N)
pub fn set_left_and_right(&mut self, left: N, right: N)
Sets the view cuboid coordinates along the x
axis.
sourcepub fn set_bottom_and_top(&mut self, bottom: N, top: N)
pub fn set_bottom_and_top(&mut self, bottom: N, top: N)
Sets the view cuboid coordinates along the y
axis.
sourcepub fn set_znear_and_zfar(&mut self, znear: N, zfar: N)
pub fn set_znear_and_zfar(&mut self, znear: N, zfar: N)
Sets the near and far plane offsets of the view cuboid.
Trait Implementations§
source§impl<N: Real> Clone for Orthographic3<N>
impl<N: Real> Clone for Orthographic3<N>
source§impl<N: Real> Debug for Orthographic3<N>
impl<N: Real> Debug for Orthographic3<N>
source§impl<N: Real> Distribution<Orthographic3<N>> for Standardwhere
Standard: Distribution<N>,
impl<N: Real> Distribution<Orthographic3<N>> for Standardwhere
Standard: Distribution<N>,
source§impl<N: Real> From<Orthographic3<N>> for Matrix4<N>
impl<N: Real> From<Orthographic3<N>> for Matrix4<N>
source§fn from(orth: Orthographic3<N>) -> Self
fn from(orth: Orthographic3<N>) -> Self
source§impl<N: Real> PartialEq<Orthographic3<N>> for Orthographic3<N>
impl<N: Real> PartialEq<Orthographic3<N>> for Orthographic3<N>
impl<N: Real> Copy for Orthographic3<N>
Auto Trait Implementations§
impl<N> RefUnwindSafe for Orthographic3<N>where
N: RefUnwindSafe,
impl<N> Send for Orthographic3<N>
impl<N> Sync for Orthographic3<N>
impl<N> Unpin for Orthographic3<N>where
N: Unpin,
impl<N> UnwindSafe for Orthographic3<N>where
N: UnwindSafe,
Blanket Implementations§
source§impl<T> Rand for Twhere
Standard: Distribution<T>,
impl<T> Rand for Twhere
Standard: Distribution<T>,
source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self
from the equivalent element of its
superset. Read moresource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self
is actually part of its subset T
(and can be converted to it).source§unsafe fn to_subset_unchecked(&self) -> SS
unsafe fn to_subset_unchecked(&self) -> SS
self.to_subset
but without any property checks. Always succeeds.source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self
to the equivalent element of its superset.