pub struct Camera2d {
pub center: vec2<f32>,
pub rotation: Angle<f32>,
pub fov: f32,
}
Expand description
2-dimensional camera.
Fields§
§center: vec2<f32>
§rotation: Angle<f32>
§fov: f32
Trait Implementations§
Source§impl AbstractCamera2d for Camera2d
impl AbstractCamera2d for Camera2d
fn view_matrix(&self) -> mat3<f32>
fn projection_matrix(&self, framebuffer_size: vec2<f32>) -> mat3<f32>
fn uniforms(&self, framebuffer_size: vec2<f32>) -> Uniforms2d
fn screen_to_world( &self, framebuffer_size: vec2<f32>, pos: vec2<f32>, ) -> vec2<f32>
fn world_to_screen( &self, framebuffer_size: vec2<f32>, pos: vec2<f32>, ) -> Option<vec2<f32>>
fn view_area(&self, framebuffer_size: vec2<f32>) -> Quad<f32>
Source§impl<'de> Deserialize<'de> for Camera2d
impl<'de> Deserialize<'de> for Camera2d
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
impl StructuralPartialEq for Camera2d
Auto Trait Implementations§
impl Freeze for Camera2d
impl RefUnwindSafe for Camera2d
impl Send for Camera2d
impl Sync for Camera2d
impl Unpin for Camera2d
impl UnwindSafe for Camera2d
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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