pub struct Vec {
pub x: f32,
pub y: f32,
}
Fields§
§x: f32
§y: f32
Implementations§
Source§impl Vec
impl Vec
pub const fn new(x: f32, y: f32) -> Self
pub fn transform_dir(self, mat: &Mat) -> Self
pub fn length(self) -> f32
pub fn distance(self, other: Self) -> f32
pub fn normalize(self) -> Self
pub fn dot(self, other: Self) -> f32
pub fn lerp(self, other: Self, ratio: f32) -> Self
Trait Implementations§
Source§impl AddAssign for Vec
impl AddAssign for Vec
Source§fn add_assign(&mut self, rhs: Self)
fn add_assign(&mut self, rhs: Self)
Performs the
+=
operation. Read moreSource§impl SubAssign for Vec
impl SubAssign for Vec
Source§fn sub_assign(&mut self, rhs: Self)
fn sub_assign(&mut self, rhs: Self)
Performs the
-=
operation. Read moreimpl Copy for Vec
impl Eq for Vec
impl StructuralPartialEq for Vec
Auto Trait Implementations§
impl Freeze for Vec
impl RefUnwindSafe for Vec
impl Send for Vec
impl Sync for Vec
impl Unpin for Vec
impl UnwindSafe for Vec
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§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)