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

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Returns the “default value” for a type. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.