Struct amethyst_renderer::Camera
[−]
[src]
pub struct Camera { pub proj: [[f32; 4]; 4], pub view: [[f32; 4]; 4], }
Contains the graphical transforms for a camera.
Fields
proj: [[f32; 4]; 4]
Graphical projection matrix.
view: [[f32; 4]; 4]
The view matrix.
Methods
impl Camera
[src]
fn new(proj: [[f32; 4]; 4], view: [[f32; 4]; 4]) -> Camera
Creates a new camera with the given projection and view matrices.
fn perspective(fov: f32, aspect: f32, near: f32, far: f32) -> [[f32; 4]; 4]
Returns a realistic perspective projection matrix.
fn orthographic(
left: f32,
right: f32,
bottom: f32,
top: f32,
near: f32,
far: f32
) -> [[f32; 4]; 4]
left: f32,
right: f32,
bottom: f32,
top: f32,
near: f32,
far: f32
) -> [[f32; 4]; 4]
Returns an orthographic projection matrix..
fn look_at(eye: [f32; 3], target: [f32; 3], up: [f32; 3]) -> [[f32; 4]; 4]
Returns a 4x4 view matrix.
Trait Implementations
impl Copy for Camera
[src]
impl Clone for Camera
[src]
fn clone(&self) -> Camera
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0
Performs copy-assignment from source
. Read more