[][src]Trait kiss3d::planar_camera::PlanarCamera

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>; }

Trait every 2D camera must implement.

Required methods

fn handle_event(&mut self, canvas: &Canvas, event: &WindowEvent)

Handle a mouse event.

fn update(&mut self, canvas: &Canvas)

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

fn upload(
    &self,
    proj: &mut ShaderUniform<Matrix3<f32>>,
    view: &mut ShaderUniform<Matrix3<f32>>
)

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

fn unproject(
    &self,
    window_coord: &Point2<f32>,
    window_size: &Vector2<f32>
) -> Point2<f32>

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

Loading content...

Implementors

impl PlanarCamera for FixedView[src]

impl PlanarCamera for Sidescroll[src]

Loading content...