Struct tiny_game_framework::Camera
source · pub struct Camera {
pub proj: Mat4,
pub view: Mat4,
pub pos: Vec3,
pub right: Vec3,
pub front: Vec3,
pub up: Vec3,
pub pitch: f32,
pub yaw: f32,
pub speed: f32,
pub dt: f32,
/* private fields */
}
Fields§
§proj: Mat4
§view: Mat4
§pos: Vec3
§right: Vec3
§front: Vec3
§up: Vec3
§pitch: f32
§yaw: f32
§speed: f32
§dt: f32
Implementations§
source§impl Camera
impl Camera
pub fn new() -> Self
pub fn update(&mut self, y: Vec3)
pub fn input(&mut self, window: &Window, glfw: &Glfw)
pub fn mouse_callback(&mut self, xpos: f32, ypos: f32, window: &Window)
pub unsafe fn send_uniforms(&self, shader: &Shader)
pub fn set_projection(&mut self, projection_type: ProjectionType)
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Camera
impl RefUnwindSafe for Camera
impl Send for Camera
impl Sync for Camera
impl Unpin for Camera
impl UnwindSafe for Camera
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
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more