Struct nalgebra::OrthoMat3
[−]
[src]
pub struct OrthoMat3<N> { // some fields omitted }
A 3D orthographic projection stored as a 4D matrix.
Reading or modifying its individual properties is costly but applying the transformation is cheap.
Methods
impl<N: BaseFloat> OrthoMat3<N>
fn new(width: N, height: N, znear: N, zfar: N) -> OrthoMat3<N>
Creates a new orthographic projection matrix from the width, heihgt, znear and zfar planes of the view cuboid.
unsafe fn new_with_mat(mat: Mat4<N>) -> OrthoMat3<N>
Creates a new orthographic matrix from a 4D matrix.
This is unsafe because the input matrix is not checked to be a orthographic projection.
fn as_mat<'a>(&'a self) -> &'a Mat4<N>
Returns a reference to the 4D matrix (using homogeneous coordinates) of this projection.
fn width(&self) -> N
The width of the view cuboid.
fn height(&self) -> N
The height of the view cuboid.
fn znear(&self) -> N
The near plane offset of the view cuboid.
fn zfar(&self) -> N
The far plane offset of the view cuboid.
fn set_width(&mut self, width: N)
Sets the width of the view cuboid.
fn set_height(&mut self, height: N)
Sets the height of the view cuboid.
fn set_znear(&mut self, znear: N)
Sets the near plane offset of the view cuboid.
fn set_zfar(&mut self, zfar: N)
Sets the far plane offset of the view cuboid.
fn set_znear_and_zfar(&mut self, znear: N, zfar: N)
Sets the near and far plane offsets of the view cuboid.
fn project_pnt(&self, p: &Pnt3<N>) -> Pnt3<N>
Projects a point.
fn project_vec(&self, p: &Vec3<N>) -> Vec3<N>
Projects a vector.
impl<N: BaseFloat + Clone> OrthoMat3<N>
fn to_mat<'a>(&'a self) -> Mat4<N>
Returns the 4D matrix (using homogeneous coordinates) of this projection.