Trait Camera

Source
pub trait Camera:
    Send
    + Sync
    + Clone {
    // Required methods
    fn view(&self) -> Matrix4<f32>;
    fn projection(&self) -> Matrix4<f32>;
    fn eye(&mut self) -> &mut Point3<f32>;
    fn target(&mut self) -> &mut Point3<f32>;
    fn up(&mut self) -> &mut Vector3<f32>;

    // Provided method
    fn matrix(&self) -> Matrix4<f32> { ... }
}
Expand description

Abstraction of a camera

Required Methods§

Source

fn view(&self) -> Matrix4<f32>

Create a view matrix for the camera

Source

fn projection(&self) -> Matrix4<f32>

Create a projection matrix

Source

fn eye(&mut self) -> &mut Point3<f32>

Poistion of the camera

Source

fn target(&mut self) -> &mut Point3<f32>

Direction of the camera

Source

fn up(&mut self) -> &mut Vector3<f32>

Up vector

Provided Methods§

Source

fn matrix(&self) -> Matrix4<f32>

Calculated and converted to WGPU matrix of the camera

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§