#[repr(C)]pub struct Vector2 {
pub x: f32,
pub y: f32,
}
Fields§
§x: f32
§y: f32
Implementations§
Source§impl Vector2
impl Vector2
pub const fn new(x: f32, y: f32) -> Vector2
pub const fn zero() -> Vector2
pub const fn unit_x() -> Vector2
pub const fn unit_y() -> Vector2
Sourcepub fn distance_sq(lhs: &Vector2, rhs: &Vector2) -> f32
pub fn distance_sq(lhs: &Vector2, rhs: &Vector2) -> f32
Compute the squared distance between two vectors
Sourcepub fn normalized(&self) -> Vector2
pub fn normalized(&self) -> Vector2
Produce a normalized copy of the vector
Trait Implementations§
impl Copy for Vector2
Auto Trait Implementations§
impl Freeze for Vector2
impl RefUnwindSafe for Vector2
impl Send for Vector2
impl Sync for Vector2
impl Unpin for Vector2
impl UnwindSafe for Vector2
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