pub struct Camera {
pub dirty: bool,
pub virtual_size: Vec2,
pub position: Vec2,
pub zoom: f32,
}Expand description
Camera LOL
Fields§
§dirty: boolMakes the renderer write camera’s matrix into buffer
virtual_size: Vec2For example, if the virtual_size= 1080 then objects with transform at y= 540 will be at the center of your screen no mater the render resolution.
position: Vec2Offsets the whole scene
zoom: f32Zooms in on the whole scene
Implementations§
Source§impl Camera
impl Camera
Sourcepub const fn new(virtual_size: Vec2, position: Vec2, zoom: f32) -> Self
pub const fn new(virtual_size: Vec2, position: Vec2, zoom: f32) -> Self
virtual_size- Size of the space that is used in animations.
For example, if the virtual_size= 1080 then objects with transform at y= 540 will be at the
center of your screen no mater the render resolution.
position- Offsets the whole scene
zoom- Zooms in on the whole scene
Sourcepub fn get_matrix(&self) -> Mat4
pub fn get_matrix(&self) -> Mat4
Internal function go the projection matrix
Trait Implementations§
impl Copy for Camera
Source§impl<'de> Deserialize<'de> for Camera
impl<'de> Deserialize<'de> for Camera
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for Camera
impl RefUnwindSafe for Camera
impl Send for Camera
impl Sync for Camera
impl Unpin for Camera
impl UnsafeUnpin 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