pub fn new(extent: &Extent2D, znear: f32, zfar: f32) -> Self {
        let proj_mat = extent_to_proj(extent, znear, zfar);
        let view_mat = Mat4f::identity();
        let baked_mat = proj_mat * view_mat;

        Self {
            baked_mat,

            view_mat,
            eye: Vec3f::new(2., 2., 2.),
            target: Vec3f::new(0., 0., 0.),
            up: Vec3f::new(0., 1., 0.),
            forward: Vec3f::new(0., 0., 1.),

            proj_mat,
            extent: *extent,
            znear,
            zfar,
        }
    }
/// Create a new orthographic camera.
Create a new orthographic camera.
Create a new orthographic camera .
pub fn new(extent: &Extent2D, znear: f32, zfar: f32) -> Self {
        let proj_mat = extent_to_proj(extent, znear, zfar);
        let view_mat = Mat4f::identity();
        let baked_mat = proj_mat * view_mat;
        Self {
            baked_mat,
            view_mat,
            eye: Vec3f::new(2., 2., 2.),
            target: Vec3f::new(0., 0., 0.),
            up: Vec3f::new(0., 1., 0.),
            forward: Vec3f::new(0., 0., 1.),
            proj_mat,
            extent: *extent,
            znear,
            zfar,
        }
    }
pub fn new ( extent : & Extent2D , znear : f32 , zfar : f32 ) -> Self { let proj_mat = extent_to_proj ( extent , znear , zfar ) ; let view_mat = Mat4f :: identity ( ) ; let baked_mat = proj_mat * view_mat ; Self { baked_mat , view_mat , eye : Vec3f :: new ( 2. , 2. , 2. ) , target : Vec3f :: new ( 0. , 0. , 0. ) , up : Vec3f :: new ( 0. , 1. , 0. ) , forward : Vec3f :: new ( 0. , 0. , 1. ) , proj_mat , extent : * extent , znear , zfar , } }
Create a new orthographic camera.
Create a new orthographic camera .
extent
&Extent2D
znear
f32
zfar
f32
extent
&Extent2D
znear
f32
zfar
f32