#[repr(C)]pub struct Camera3D {
pub position: Vector3,
pub target: Vector3,
pub up: Vector3,
pub fovy: f32,
pub projection: CameraProjection,
}
Expand description
Camera, defines position/orientation in 3d space
Fields§
§position: Vector3
Camera position
target: Vector3
Camera target it looks-at
up: Vector3
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
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
Trait Implementations§
impl Copy for Camera3D
impl StructuralPartialEq for Camera3D
Auto Trait Implementations§
impl Freeze for Camera3D
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