Type Alias rust_raylib::math::Camera

source ·
pub type Camera = Camera3D;
Expand description

Camera type fallback, defaults to Camera3D

Aliased Type§

struct Camera {
    pub position: Vector3<f32>,
    pub target: Vector3<f32>,
    pub up: Vector3<f32>,
    pub fovy: f32,
    pub projection: CameraProjection,
}

Fields§

§position: Vector3<f32>

Camera position

§target: Vector3<f32>

Camera target it looks-at

§up: Vector3<f32>

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

§projection: CameraProjection

Camera projection: CAMERA_PERSPECTIVE or CAMERA_ORTHOGRAPHIC

Implementations§

source§

impl Camera3D

source

pub fn update(&mut self, mode: CameraMode)

Update camera position for selected mode

source

pub fn update_pro(&mut self, movement: Vector3, rotation: Vector3, zoom: f32)

Update camera movement/rotation

source

pub fn get_mouse_ray(&self, mouse_position: Vector2) -> Ray

Get a ray trace from mouse position

source

pub fn get_matrix(&self) -> Matrix

Get camera transform matrix (view matrix)

source

pub fn world_to_screen(&self, position: Vector3) -> Vector2

Get the screen space position for a 3d world space position

source

pub fn world_to_screen_ex( &self, position: Vector3, width: u32, height: u32 ) -> Vector2

Get size position for a 3d world space position

Trait Implementations§

source§

impl Clone for Camera3D

source§

fn clone(&self) -> Camera3D

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Camera3D

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl From<Camera3D> for Camera3D

source§

fn from(value: Camera3D) -> Self

Converts to this type from the input type.
source§

impl PartialEq<Camera3D> for Camera3D

source§

fn eq(&self, other: &Camera3D) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl StructuralPartialEq for Camera3D