pub fn update_view_projection(&self, camera:&Camera2d) {
        if self.children_number() == 0 { return }

        let trans_cam  = camera.transform_matrix().try_inverse();
        let trans_cam  = trans_cam.expect("Camera's matrix is not invertible.");
        let trans_cam  = trans_cam.map(eps);
        let trans_cam  = inverse_y_translation(trans_cam);
        let half_dim   = camera.screen().height / 2.0;
        let fovy_slope = camera.half_fovy_slope();
        let near       = half_dim / fovy_slope;

        match camera.projection() {
            Projection::Perspective{..} => {
                js::setup_perspective(&self.data.dom,&near.into());
                setup_camera_perspective(&self.data.view_projection_dom,near,&trans_cam);
            },
            Projection::Orthographic => {
                setup_camera_orthographic(&self.data.view_projection_dom,&trans_cam);
            }
        }
    }
/// Update the objects to match the new camera's point of view. This function should be called
/// only after camera position change.
Update the objects to match the new camera's point of view. This function should be called
only after camera position change.
Update the objects to match the new camera ' s point of view . This function should be called only after camera position change .
pub fn update_view_projection(&self, camera:&Camera2d) {
        if self.children_number() == 0 { return }
        let trans_cam  = camera.transform_matrix().try_inverse();
        let trans_cam  = trans_cam.expect("Camera's matrix is not invertible.");
        let trans_cam  = trans_cam.map(eps);
        let trans_cam  = inverse_y_translation(trans_cam);
        let half_dim   = camera.screen().height / 2.0;
        let fovy_slope = camera.half_fovy_slope();
        let near       = half_dim / fovy_slope;
        match camera.projection() {
            Projection::Perspective{..} => {
                js::setup_perspective(&self.data.dom,&near.into());
                setup_camera_perspective(&self.data.view_projection_dom,near,&trans_cam);
            },
            Projection::Orthographic => {
                setup_camera_orthographic(&self.data.view_projection_dom,&trans_cam);
            }
        }
    }
pub fn update_view_projection ( & self , camera : & Camera2d ) { if self . children_number ( ) == 0 { return } let trans_cam = camera . transform_matrix ( ) . try_inverse ( ) ; let trans_cam = trans_cam . expect ( " " ) ; let trans_cam = trans_cam . map ( eps ) ; let trans_cam = inverse_y_translation ( trans_cam ) ; let half_dim = camera . screen ( ) . height / 2.0 ; let fovy_slope = camera . half_fovy_slope ( ) ; let near = half_dim / fovy_slope ; match camera . projection ( ) { Projection :: Perspective { .. } => { js :: setup_perspective ( & self . data . dom , & near . into ( ) ) ; setup_camera_perspective ( & self . data . view_projection_dom , near , & trans_cam ) ; } , Projection :: Orthographic => { setup_camera_orthographic ( & self . data . view_projection_dom , & trans_cam ) ; } } }
Update the objects to match the new camera's point of view.
Update the objects to match the new camera ' s point of view .
&self
camera
&Camera2d
&self
camera
&Camera2d