pub trait Camera {
// Required methods
fn get_projection_matrix(&self) -> Matrix4<f32>;
fn get_view_matrix(&self) -> Matrix4<f32>;
fn get_combined_matrix(&self) -> Matrix4<f32>;
// Provided method
fn update_matrices(&self, matrices: Arc<RwLock<CameraMatrices>>) { ... }
}Expand description
A camera is the lens through which your scene can be viewed. This tells covalent how to map the scene in 2D/3D space onto your screen, a 2D window. The two major types of camera are perspective and orthographic.
Required Methods§
fn get_projection_matrix(&self) -> Matrix4<f32>
fn get_view_matrix(&self) -> Matrix4<f32>
fn get_combined_matrix(&self) -> Matrix4<f32>
Provided Methods§
Sourcefn update_matrices(&self, matrices: Arc<RwLock<CameraMatrices>>)
fn update_matrices(&self, matrices: Arc<RwLock<CameraMatrices>>)
Sends the camera’s matrices to the graphics backend for rendering. Run this function when you’ve edited the camera’s variables e.g. position, view angle, aspect ratio etc.