Trait maths_rs::mat::MatProjection
source · 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§
sourcefn get_frustum_planes(&self) -> [Vec4<T>; 6]
fn get_frustum_planes(&self) -> [Vec4<T>; 6]
returns 6 frustum planes as Vec4’s in the form .xyz = normal, .w = plane distance
sourcefn get_frustum_corners(&self) -> [Vec3<T>; 8]
fn get_frustum_corners(&self) -> [Vec3<T>; 8]
returns 8 points which are the corners of the frustum first 4 near, second 4 far
sourcefn create_ortho_matrix(left: T, right: T, bottom: T, top: T, near: T, far: T) -> Self
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
sourcefn create_perspective_projection_lh_yup(fov: T, aspect: T, near: T, far: T) -> Self
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
sourcefn create_perspective_projection_rh_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
returns a perespective projection matrix (right hand coordinate system with y-up) from fov (radians), aspect ratio and near - far depth