[][src]Struct easy_gltf::Camera

pub struct Camera {
    pub transform: Matrix4<f32>,
    pub fov: Rad<f32>,
    pub zfar: f32,
    pub znear: f32,
}

Contains camera properties.

Fields

transform: Matrix4<f32>

Transform matrix (also called world to camera matrix)

fov: Rad<f32>

Angle in degree of field of view

zfar: f32

The distance to the far clipping plane.

znear: f32

The distance to the near clipping plane.

Implementations

impl Camera[src]

pub fn position(&self) -> Vector3<f32>[src]

Position of the camera.

pub fn right(&self) -> Vector3<f32>[src]

Right vector of the camera.

pub fn up(&self) -> Vector3<f32>[src]

Up vector of the camera.

pub fn forward(&self) -> Vector3<f32>[src]

Forward vector of the camera (backside direction).

pub fn apply_transform_vector(&self, pos: &Vector3<f32>) -> Vector3<f32>[src]

Apply the transformation matrix on a vector.

Example

let ray_dir = Vector3::new(1., 0., 0.);
let ray_dir = cam.apply_transform_vector(&ray_dir);

Trait Implementations

impl Clone for Camera[src]

impl Debug for Camera[src]

impl Default for Camera[src]

Auto Trait Implementations

impl RefUnwindSafe for Camera

impl Send for Camera

impl Sync for Camera

impl Unpin for Camera

impl UnwindSafe for Camera

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Pointable for T

type Init = T

The type for initializers.

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.