Trait Viewer

Source
pub trait Viewer {
    // Required methods
    fn position(&self) -> Vec3;
    fn view(&self) -> Mat4;
    fn projection(&self) -> Mat4;
    fn viewport(&self) -> Viewport;
    fn z_near(&self) -> f32;
    fn z_far(&self) -> f32;
    fn color_mapping(&self) -> ColorMapping;
    fn tone_mapping(&self) -> ToneMapping;
}
Expand description

Represents a viewer, usually some kind of camera. The default implementation of this trait is the Camera which should be adequate for most use cases.

Required Methods§

Source

fn position(&self) -> Vec3

The position of the viewer.

Source

fn view(&self) -> Mat4

The view matrix which transforms from world space to view space.

Source

fn projection(&self) -> Mat4

The projection matrix which transforms from view space to clip space (2D position on the screen).

Source

fn viewport(&self) -> Viewport

The 2D Viewport of the viewer.

Source

fn z_near(&self) -> f32

Defines the minimum depth in world space.

Source

fn z_far(&self) -> f32

Defines the maximum depth in world space.

Source

fn color_mapping(&self) -> ColorMapping

Defines the ColorMapping applied to the final rendered image.

Source

fn tone_mapping(&self) -> ToneMapping

Defines the ToneMapping applied to the final rendered image.

Implementations on Foreign Types§

Source§

impl<T: Viewer + ?Sized> Viewer for &T

Source§

impl<T: Viewer + ?Sized> Viewer for &mut T

Source§

impl<T: Viewer> Viewer for Box<T>

Source§

impl<T: Viewer> Viewer for Rc<T>

Source§

impl<T: Viewer> Viewer for Arc<T>

Source§

impl<T: Viewer> Viewer for RefCell<T>

Source§

impl<T: Viewer> Viewer for RwLock<T>

Implementors§