#[repr(C)]pub struct ViewTransform {
pub zoom: f32,
pub pan: [f32; 2],
pub _pad: f32,
}Expand description
The shared camera transform every scene family applies (ADR-0018): a uniform
zoom about the frame centre, then a pan, in world space before the
aspect divide. Identity (zoom = 1, pan = 0) leaves geometry exactly where
a scene placed it, so a preset that binds none of zoom/pan_x/pan_y is
unchanged. #[repr(C)] + Pod so it uploads straight into a line-renderer
uniform slot. Rotate is reserved for a follow-up (ADR-0018 reserves it).
Defined here for Phase 1 (the line scenes are the walking skeleton); Phase 2 threads the same transform through the fragment and swarm scenes.
Fields§
§zoom: f32Uniform scale about the frame centre (1.0 = no zoom).
pan: [f32; 2]Pan offset in world units (x, y), applied after the zoom.
_pad: f32Padding to fill a 16-byte uniform slot (unused).
Trait Implementations§
Source§impl Clone for ViewTransform
impl Clone for ViewTransform
Source§fn clone(&self) -> ViewTransform
fn clone(&self) -> ViewTransform
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ViewTransform
impl Debug for ViewTransform
Source§impl PartialEq for ViewTransform
impl PartialEq for ViewTransform
Source§fn eq(&self, other: &ViewTransform) -> bool
fn eq(&self, other: &ViewTransform) -> bool
Tests for
self and other values to be equal, and is used by ==.impl Copy for ViewTransform
impl Pod for ViewTransform
impl StructuralPartialEq for ViewTransform
Auto Trait Implementations§
impl Freeze for ViewTransform
impl RefUnwindSafe for ViewTransform
impl Send for ViewTransform
impl Sync for ViewTransform
impl Unpin for ViewTransform
impl UnsafeUnpin for ViewTransform
impl UnwindSafe for ViewTransform
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
§impl<T> CheckedBitPattern for Twhere
T: AnyBitPattern,
impl<T> CheckedBitPattern for Twhere
T: AnyBitPattern,
§type Bits = T
type Bits = T
Self must have the same layout as the specified Bits except for
the possible invalid bit patterns being checked during
is_valid_bit_pattern.§fn is_valid_bit_pattern(_bits: &T) -> bool
fn is_valid_bit_pattern(_bits: &T) -> bool
If this function returns true, then it must be valid to reinterpret
bits
as &Self.