pub fn new(aspect: T, fovy: T, znear: T, zfar: T) -> Self {
        assert!(
            relative_ne!(zfar, znear),
            "The near-plane and far-plane must not be superimposed."
        );
        assert!(
            !relative_eq!(aspect, T::zero()),
            "The aspect ratio must not be zero."
        );

        let matrix = Matrix4::identity();
        let mut res = Self::from_matrix_unchecked(matrix);

        res.set_fovy(fovy);
        res.set_aspect(aspect);
        res.set_znear_and_zfar(znear, zfar);

        res.matrix[(3, 3)] = T::zero();
        res.matrix[(3, 2)] = -T::one();

        res
    }
/// Creates a new perspective matrix from the aspect ratio, y field of view, and near/far planes.
Creates a new perspective matrix from the aspect ratio, y field of view, and near/far planes.
Creates a new perspective matrix from the aspect ratio y field of view and near / far planes .
pub fn new(aspect: T, fovy: T, znear: T, zfar: T) -> Self {
        assert!(
            relative_ne!(zfar, znear),
            "The near-plane and far-plane must not be superimposed."
        );
        assert!(
            !relative_eq!(aspect, T::zero()),
            "The aspect ratio must not be zero."
        );
        let matrix = Matrix4::identity();
        let mut res = Self::from_matrix_unchecked(matrix);
        res.set_fovy(fovy);
        res.set_aspect(aspect);
        res.set_znear_and_zfar(znear, zfar);
        res.matrix[(3, 3)] = T::zero();
        res.matrix[(3, 2)] = -T::one();
        res
    }
pub fn new ( aspect : T , fovy : T , znear : T , zfar : T ) -> Self { assert ! ( relative_ne ( zfar znear ) " " ) ; assert ! ( relative_eq ( aspect T zero ( ) ) " " ) ; let matrix = Matrix4 :: identity ( ) ; let mut res = Self :: from_matrix_unchecked ( matrix ) ; res . set_fovy ( fovy ) ; res . set_aspect ( aspect ) ; res . set_znear_and_zfar ( znear , zfar ) ; res . matrix [ ( 3 , 3 ) ] = T :: zero ( ) ; res . matrix [ ( 3 , 2 ) ] = - T :: one ( ) ; res }
Creates a new perspective matrix from the aspect ratio, y field of view, and near/far planes.
Creates a new perspective matrix from the aspect ratio y field of view and near / far planes .
aspect
T
fovy
T
znear
T
zfar
T
aspect
T
fovy
T
znear
T
zfar
T