pub trait PlanarCamera {
    fn handle_event(&mut self, canvas: &Canvas, event: &WindowEvent);
    fn update(&mut self, canvas: &Canvas);
    fn upload(
        &self,
        proj: &mut ShaderUniform<Matrix3<f32>>,
        view: &mut ShaderUniform<Matrix3<f32>>
    ); fn unproject(
        &self,
        window_coord: &Point2<f32>,
        window_size: &Vector2<f32>
    ) -> Point2<f32>; }
Expand description

Trait every 2D camera must implement.

Required Methods

Handle a mouse event.

Update the camera. This is called once at the beginning of the render loop.

Upload the camera view and projection to the gpu. This can be called multiple times on the render loop.

Computes the 2D world-space coordiates corresponding to the given screen-space coordiates.

Implementors