pub struct Camera {
pub center: [f64; 2],
pub scale: f64,
pub rotation: f64,
}Expand description
what a scene shows: the point of the drawing at the target’s middle, drawing units per pixel, and the rotation (radians, counter-clockwise: the drawing turns that way on the screen). The y axis points up on the screen
Fields§
§center: [f64; 2]§scale: f64§rotation: f64Implementations§
Source§impl Camera
impl Camera
pub const fn new(center: [f64; 2], scale: f64) -> Camera
Sourcepub fn to_screen(&self, p: [f64; 2], size: (u32, u32)) -> [f64; 2]
pub fn to_screen(&self, p: [f64; 2], size: (u32, u32)) -> [f64; 2]
a point of the drawing in pixels of a target of size (x right, y down from its top left corner; a pixel’s
centre at + 0.5)
Sourcepub fn to_drawing(&self, q: [f64; 2], size: (u32, u32)) -> [f64; 2]
pub fn to_drawing(&self, q: [f64; 2], size: (u32, u32)) -> [f64; 2]
the point of the drawing under a pixel position of a target of size
Trait Implementations§
impl Copy for Camera
impl StructuralPartialEq for Camera
Auto Trait Implementations§
impl Forget for Camera
impl Freeze for Camera
impl Move 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