Fields
x: f32y: f32Implementations
sourceimpl Vec2
impl Vec2
pub const fn new(x: f32, y: f32) -> Self
sourcepub fn sqr_magnitude(&self) -> f32
pub fn sqr_magnitude(&self) -> f32
Returns the square of the vector’s length.
Faster to compute than magnitude()
sourcepub fn normalized(&self) -> Self
pub fn normalized(&self) -> Self
Returns a normalized copy of self
pub fn extend(&self, z: f32) -> Vec3
pub fn xx(&self) -> Vec2
swizzle only.pub fn xy(&self) -> Vec2
swizzle only.pub fn yx(&self) -> Vec2
swizzle only.pub fn yy(&self) -> Vec2
swizzle only.pub fn xxx(&self) -> Vec3
swizzle only.pub fn xxy(&self) -> Vec3
swizzle only.pub fn xyx(&self) -> Vec3
swizzle only.pub fn xyy(&self) -> Vec3
swizzle only.pub fn yxx(&self) -> Vec3
swizzle only.pub fn yxy(&self) -> Vec3
swizzle only.pub fn yyx(&self) -> Vec3
swizzle only.pub fn yyy(&self) -> Vec3
swizzle only.pub fn xxxx(&self) -> Vec4
swizzle only.pub fn xxxy(&self) -> Vec4
swizzle only.pub fn xxyx(&self) -> Vec4
swizzle only.pub fn xxyy(&self) -> Vec4
swizzle only.pub fn xyxx(&self) -> Vec4
swizzle only.pub fn xyxy(&self) -> Vec4
swizzle only.pub fn xyyx(&self) -> Vec4
swizzle only.pub fn xyyy(&self) -> Vec4
swizzle only.pub fn yxxx(&self) -> Vec4
swizzle only.pub fn yxxy(&self) -> Vec4
swizzle only.pub fn yxyx(&self) -> Vec4
swizzle only.pub fn yxyy(&self) -> Vec4
swizzle only.pub fn yyxx(&self) -> Vec4
swizzle only.pub fn yyxy(&self) -> Vec4
swizzle only.pub fn yyyx(&self) -> Vec4
swizzle only.pub fn yyyy(&self) -> Vec4
swizzle only.Trait Implementations
sourceimpl AddAssign<&'_ Vec2> for Vec2
impl AddAssign<&'_ Vec2> for Vec2
sourcefn add_assign(&mut self, rhs: &Vec2)
fn add_assign(&mut self, rhs: &Vec2)
Performs the += operation. Read more
sourceimpl AddAssign<Vec2> for Vec2
impl AddAssign<Vec2> for Vec2
sourcefn add_assign(&mut self, rhs: Vec2)
fn add_assign(&mut self, rhs: Vec2)
Performs the += operation. Read more
sourceimpl DivAssign<&'_ Vec2> for Vec2
impl DivAssign<&'_ Vec2> for Vec2
sourcefn div_assign(&mut self, rhs: &Vec2)
fn div_assign(&mut self, rhs: &Vec2)
Performs the /= operation. Read more
sourceimpl DivAssign<&'_ f32> for Vec2
impl DivAssign<&'_ f32> for Vec2
sourcefn div_assign(&mut self, rhs: &f32)
fn div_assign(&mut self, rhs: &f32)
Performs the /= operation. Read more
sourceimpl DivAssign<Vec2> for Vec2
impl DivAssign<Vec2> for Vec2
sourcefn div_assign(&mut self, rhs: Vec2)
fn div_assign(&mut self, rhs: Vec2)
Performs the /= operation. Read more
sourceimpl DivAssign<f32> for Vec2
impl DivAssign<f32> for Vec2
sourcefn div_assign(&mut self, rhs: f32)
fn div_assign(&mut self, rhs: f32)
Performs the /= operation. Read more
sourceimpl MulAssign<&'_ Vec2> for Vec2
impl MulAssign<&'_ Vec2> for Vec2
sourcefn mul_assign(&mut self, rhs: &Vec2)
fn mul_assign(&mut self, rhs: &Vec2)
Performs the *= operation. Read more
sourceimpl MulAssign<&'_ f32> for Vec2
impl MulAssign<&'_ f32> for Vec2
sourcefn mul_assign(&mut self, rhs: &f32)
fn mul_assign(&mut self, rhs: &f32)
Performs the *= operation. Read more
sourceimpl MulAssign<Vec2> for Vec2
impl MulAssign<Vec2> for Vec2
sourcefn mul_assign(&mut self, rhs: Vec2)
fn mul_assign(&mut self, rhs: Vec2)
Performs the *= operation. Read more
sourceimpl MulAssign<f32> for Vec2
impl MulAssign<f32> for Vec2
sourcefn mul_assign(&mut self, rhs: f32)
fn mul_assign(&mut self, rhs: f32)
Performs the *= operation. Read more
sourceimpl SubAssign<&'_ Vec2> for Vec2
impl SubAssign<&'_ Vec2> for Vec2
sourcefn sub_assign(&mut self, rhs: &Vec2)
fn sub_assign(&mut self, rhs: &Vec2)
Performs the -= operation. Read more
sourceimpl SubAssign<Vec2> for Vec2
impl SubAssign<Vec2> for Vec2
sourcefn sub_assign(&mut self, rhs: Vec2)
fn sub_assign(&mut self, rhs: Vec2)
Performs the -= operation. Read more
impl Copy for Vec2
impl StructuralPartialEq for Vec2
Auto Trait Implementations
impl RefUnwindSafe for Vec2
impl Send for Vec2
impl Sync for Vec2
impl Unpin for Vec2
impl UnwindSafe for Vec2
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcepub fn to_owned(&self) -> T
pub fn to_owned(&self) -> T
Creates owned data from borrowed data, usually by cloning. Read more
sourcepub fn clone_into(&self, target: &mut T)
pub fn clone_into(&self, target: &mut T)
toowned_clone_into)Uses borrowed data to replace owned data, usually by cloning. Read more