Struct ggez::graphics::na::Perspective3
[−]
[src]
pub struct Perspective3<N> where
N: Scalar, { /* fields omitted */ }
A 3D perspective projection stored as an homogeneous 4x4 matrix.
Methods
impl<N> Perspective3<N> where
N: Real,
[src]
N: Real,
fn new(aspect: N, fovy: N, znear: N, zfar: N) -> Perspective3<N>
[src]
Creates a new perspective matrix from the aspect ratio, y field of view, and near/far planes.
fn from_matrix_unchecked(
matrix: Matrix<N, U4, U4, <DefaultAllocator as Allocator<N, U4, U4>>::Buffer>
) -> Perspective3<N>
[src]
matrix: Matrix<N, U4, U4, <DefaultAllocator as Allocator<N, U4, U4>>::Buffer>
) -> Perspective3<N>
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.
fn inverse(
&self
) -> Matrix<N, U4, U4, <DefaultAllocator as Allocator<N, U4, U4>>::Buffer>
[src]
&self
) -> Matrix<N, U4, U4, <DefaultAllocator as Allocator<N, U4, U4>>::Buffer>
Retrieves the inverse of the underlying homogeneous matrix.
fn to_homogeneous(
&self
) -> Matrix<N, U4, U4, <DefaultAllocator as Allocator<N, U4, U4>>::Buffer>
[src]
&self
) -> Matrix<N, U4, U4, <DefaultAllocator as Allocator<N, U4, U4>>::Buffer>
Computes the corresponding homogeneous matrix.
fn as_matrix(
&self
) -> &Matrix<N, U4, U4, <DefaultAllocator as Allocator<N, U4, U4>>::Buffer>
[src]
&self
) -> &Matrix<N, U4, U4, <DefaultAllocator as Allocator<N, U4, U4>>::Buffer>
A reference to the underlying homogeneous transformation matrix.
fn unwrap(
self
) -> Matrix<N, U4, U4, <DefaultAllocator as Allocator<N, U4, U4>>::Buffer>
[src]
self
) -> Matrix<N, U4, U4, <DefaultAllocator as Allocator<N, U4, U4>>::Buffer>
Retrieves the underlying homogeneous matrix.
fn aspect(&self) -> N
[src]
Gets the width / height
aspect ratio of the view frustrum.
fn fovy(&self) -> N
[src]
Gets the y field of view of the view frustrum.
fn znear(&self) -> N
[src]
Gets the near plane offset of the view frustrum.
fn zfar(&self) -> N
[src]
Gets the far plane offset of the view frustrum.
fn project_point(&self, p: &Point<N, U3>) -> Point<N, U3>
[src]
Projects a point. Faster than matrix multiplication.
fn unproject_point(&self, p: &Point<N, U3>) -> Point<N, U3>
[src]
Un-projects a point. Faster than multiplication by the matrix inverse.
fn project_vector<SB>(
&self,
p: &Matrix<N, U3, U1, SB>
) -> Matrix<N, U3, U1, <DefaultAllocator as Allocator<N, U3, U1>>::Buffer> where
SB: Storage<N, U3, U1>,
[src]
&self,
p: &Matrix<N, U3, U1, SB>
) -> Matrix<N, U3, U1, <DefaultAllocator as Allocator<N, U3, U1>>::Buffer> where
SB: Storage<N, U3, U1>,
Projects a vector. Faster than matrix multiplication.
fn set_aspect(&mut self, aspect: N)
[src]
Updates this perspective matrix with a new width / height
aspect ratio of the view
frustrum.
fn set_fovy(&mut self, fovy: N)
[src]
Updates this perspective with a new y field of view of the view frustrum.
fn set_znear(&mut self, znear: N)
[src]
Updates this perspective matrix with a new near plane offset of the view frustrum.
fn set_zfar(&mut self, zfar: N)
[src]
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)
[src]
Updates this perspective matrix with new near and far plane offsets of the view frustrum.
Trait Implementations
impl<N> Rand for Perspective3<N> where
N: Rand + Real,
[src]
N: Rand + Real,
fn rand<R>(r: &mut R) -> Perspective3<N> where
R: Rng,
[src]
R: Rng,
impl<N> Copy for Perspective3<N> where
N: Real,
[src]
N: Real,
impl<N> Clone for Perspective3<N> where
N: Real,
[src]
N: Real,
fn clone(&self) -> Perspective3<N>
[src]
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl<N> PartialEq<Perspective3<N>> for Perspective3<N> where
N: Real,
[src]
N: Real,
fn eq(&self, right: &Perspective3<N>) -> bool
[src]
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[src]
This method tests for !=
.
impl<N> Debug for Perspective3<N> where
N: Real,
[src]
N: Real,