Trait bevy::render::camera::CameraProjection
source · pub trait CameraProjection {
// Required methods
fn get_projection_matrix(&self) -> Mat4;
fn update(&mut self, width: f32, height: f32);
fn far(&self) -> f32;
fn get_frustum_corners(&self, z_near: f32, z_far: f32) -> [Vec3A; 8];
// Provided method
fn compute_frustum(&self, camera_transform: &GlobalTransform) -> Frustum { ... }
}
Expand description
Trait to control the projection matrix of a camera.
Components implementing this trait are automatically polled for changes, and used
to recompute the camera projection matrix of the Camera
component attached to
the same entity as the component implementing this trait.
Required Methods§
fn get_projection_matrix(&self) -> Mat4
fn update(&mut self, width: f32, height: f32)
fn far(&self) -> f32
fn get_frustum_corners(&self, z_near: f32, z_far: f32) -> [Vec3A; 8]
Provided Methods§
sourcefn compute_frustum(&self, camera_transform: &GlobalTransform) -> Frustum
fn compute_frustum(&self, camera_transform: &GlobalTransform) -> Frustum
Compute camera frustum for camera with given projection and transform.
This code is called by update_frusta
system
for each camera to update its frustum.