#[repr(C)]pub struct V2 {
pub x: f32,
pub y: f32,
}
Fields§
§x: f32
§y: f32
Implementations§
Source§impl V2
impl V2
pub const fn new(x: f32, y: f32) -> Self
pub fn dot(self, b: Self) -> scalar
pub fn cross(self, b: Self) -> scalar
pub fn normalize(self) -> Self
pub fn length_squared(self) -> scalar
pub fn length(self) -> scalar
pub fn as_array(&self) -> &[f32; 2]
pub fn as_mut_array(&mut self) -> &mut [f32; 2]
Trait Implementations§
Source§impl AddAssign for V2
impl AddAssign for V2
Source§fn add_assign(&mut self, v: Self)
fn add_assign(&mut self, v: Self)
Performs the
+=
operation. Read moreSource§impl DivAssign<f32> for V2
impl DivAssign<f32> for V2
Source§fn div_assign(&mut self, s: scalar)
fn div_assign(&mut self, s: scalar)
Performs the
/=
operation. Read moreSource§impl MulAssign<f32> for V2
impl MulAssign<f32> for V2
Source§fn mul_assign(&mut self, s: scalar)
fn mul_assign(&mut self, s: scalar)
Performs the
*=
operation. Read moreSource§impl MulAssign for V2
impl MulAssign for V2
Source§fn mul_assign(&mut self, v: Self)
fn mul_assign(&mut self, v: Self)
Performs the
*=
operation. Read moreSource§impl SubAssign for V2
impl SubAssign for V2
Source§fn sub_assign(&mut self, v: Self)
fn sub_assign(&mut self, v: Self)
Performs the
-=
operation. Read moreimpl Copy for V2
impl StructuralPartialEq for V2
Auto Trait Implementations§
impl Freeze for V2
impl RefUnwindSafe for V2
impl Send for V2
impl Sync for V2
impl Unpin for V2
impl UnwindSafe for V2
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