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: f32Camera field-of-view aperture in Y (degrees) in perspective, used as near plane width in orthographic
projection: CameraProjectionCamera projection: CAMERA_PERSPECTIVE or CAMERA_ORTHOGRAPHIC
Implementations§
source§impl Camera3D
impl Camera3D
sourcepub fn update(&mut self, mode: CameraMode)
pub fn update(&mut self, mode: CameraMode)
Update camera position for selected mode
sourcepub fn update_pro(&mut self, movement: Vector3, rotation: Vector3, zoom: f32)
pub fn update_pro(&mut self, movement: Vector3, rotation: Vector3, zoom: f32)
Update camera movement/rotation
sourcepub fn get_mouse_ray(&self, mouse_position: Vector2) -> Ray
pub fn get_mouse_ray(&self, mouse_position: Vector2) -> Ray
Get a ray trace from mouse position
sourcepub fn get_matrix(&self) -> Matrix
pub fn get_matrix(&self) -> Matrix
Get camera transform matrix (view matrix)
sourcepub fn world_to_screen(&self, position: Vector3) -> Vector2
pub fn world_to_screen(&self, position: Vector3) -> Vector2
Get the screen space position for a 3d world space position