pub trait Camera {
Show 13 methods fn handle_event(&mut self, canvas: &Canvas, event: &WindowEvent); fn eye(&self) -> Point3<f32>; fn view_transform(&self) -> Isometry3<f32>; fn transformation(&self) -> Matrix4<f32>; fn inverse_transformation(&self) -> Matrix4<f32>; fn clip_planes(&self) -> (f32, f32); fn update(&mut self, canvas: &Canvas); fn upload(
        &self,
        pass: usize,
        proj: &mut ShaderUniform<Matrix4<f32>>,
        view: &mut ShaderUniform<Matrix4<f32>>
    ); fn num_passes(&self) -> usize { ... } fn start_pass(&self, _pass: usize, _canvas: &Canvas) { ... } fn render_complete(&self, _canvas: &Canvas) { ... } fn project(
        &self,
        world_coord: &Point3<f32>,
        size: &Vector2<f32>
    ) -> Vector2<f32> { ... } fn unproject(
        &self,
        window_coord: &Point2<f32>,
        size: &Vector2<f32>
    ) -> (Point3<f32>, Vector3<f32>) { ... }
}
Expand description

Trait every camera must implement.

Required Methods

Handle a mouse event.

The camera position.

The camera view transform.

The transformation applied by the camera to transform a point in world coordinates to a point in device coordinates.

The transformation applied by the camera to transform point in device coordinates to a point in world coordinate.

The clipping planes, aka. (znear, zfar).

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.

Provided Methods

The number of passes required by this camera.

Indicates that a pass will begin.

Indicates that the scene has been rendered and the post-processing is being run.

Converts a 3d point to 2d screen coordinates, assuming the screen has the size size.

Converts a point in 2d screen coordinates to a ray (a 3d position and a direction).

The screen is assumed to have a size given by size.

Implementors