pub struct Camera3D {
pub position: Vec3,
pub target: Vec3,
pub up: Vec3,
pub fovy: f32,
pub aspect: Option<f32>,
pub projection: Projection,
pub render_target: Option<RenderTarget>,
pub viewport: Option<(i32, i32, i32, i32)>,
}
Fields§
§position: Vec3
Camera position.
target: Vec3
Camera target it looks-at.
up: Vec3
Camera up vector (rotation over its axis).
fovy: f32
Camera field-of-view aperture in Y (degrees) in perspective, used as near plane width in orthographic.
aspect: Option<f32>
Screen aspect ratio.
By default aspect is calculated with screen_width() / screen_height() on each frame.
projection: Projection
Camera projection type, perspective or orthographics.
render_target: Option<RenderTarget>
If “render_target” is set - camera will render to texture.
Otherwise to the screen.
viewport: Option<(i32, i32, i32, i32)>
Part of the screen to render to.
None means the whole screen.
Viewport do not affect camera space, just the render position on the screen.
Useful for things like splitscreen.
Trait Implementations§
Auto Trait Implementations§
impl RefUnwindSafe for Camera3D
impl Send for Camera3D
impl Sync for Camera3D
impl Unpin for Camera3D
impl UnwindSafe for Camera3D
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more