pub trait MatProjection<T> {
    // Required methods
    fn get_frustum_planes(&self) -> [Vec4<T>; 6];
    fn get_frustum_corners(&self) -> [Vec3<T>; 8];
    fn create_ortho_matrix(
        left: T,
        right: T,
        bottom: T,
        top: T,
        near: T,
        far: T
    ) -> Self;
    fn create_perspective_projection_lh_yup(
        fov: T,
        aspect: T,
        near: T,
        far: T
    ) -> Self;
    fn create_perspective_projection_rh_yup(
        fov: T,
        aspect: T,
        near: T,
        far: T
    ) -> Self;
}
Expand description

trait for 4x4 projection matrices

Required Methods§

source

fn get_frustum_planes(&self) -> [Vec4<T>; 6]

returns 6 frustum planes as Vec4’s in the form .xyz = normal, .w = plane distance

source

fn get_frustum_corners(&self) -> [Vec3<T>; 8]

returns 8 points which are the corners of the frustum first 4 near, second 4 far

source

fn create_ortho_matrix(left: T, right: T, bottom: T, top: T, near: T, far: T) -> Self

returns an orthogrpahic projection matrix defined by left, right, top, bottom edges and near - far depth range

source

fn create_perspective_projection_lh_yup(fov: T, aspect: T, near: T, far: T) -> Self

returns a perespective projection matrix (left hand coordinate system with y-up) from fov (radians), aspect ratio and near - far depth

source

fn create_perspective_projection_rh_yup(fov: T, aspect: T, near: T, far: T) -> Self

returns a perespective projection matrix (right hand coordinate system with y-up) from fov (radians), aspect ratio and near - far depth

Implementors§

source§

impl<T> MatProjection<T> for Mat4<T>where T: Float + FloatOps<T>, Vec3<T>: FloatOps<T>,