Trait kiss3d::planar_camera::PlanarCamera [−][src]
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>>
)
&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>
&self,
window_coord: &Point2<f32>,
window_size: &Vector2<f32>
) -> Point2<f32>
Computes the 2D world-space coordiates corresponding to the given screen-space coordiates.
Implementors
impl PlanarCamera for FixedView
impl PlanarCamera for Sidescroll