pub struct Vec2(/* private fields */);Expand description
A 2D vector.
Implementations§
Source§impl Vec2
impl Vec2
Sourcepub fn length_squared(&self) -> f32
pub fn length_squared(&self) -> f32
Returns the squared length of this vector.
pub const fn xx(&self) -> Vec2
pub const fn xy(&self) -> Vec2
pub const fn yx(&self) -> Vec2
pub const fn yy(&self) -> Vec2
pub const fn xxx(&self) -> Vec3
pub const fn xxy(&self) -> Vec3
pub const fn xyx(&self) -> Vec3
pub const fn xyy(&self) -> Vec3
pub const fn yxx(&self) -> Vec3
pub const fn yxy(&self) -> Vec3
pub const fn yyx(&self) -> Vec3
pub const fn yyy(&self) -> Vec3
pub const fn xxxx(&self) -> Vec4
pub const fn xxxy(&self) -> Vec4
pub const fn xxyx(&self) -> Vec4
pub const fn xxyy(&self) -> Vec4
pub const fn xyxx(&self) -> Vec4
pub const fn xyxy(&self) -> Vec4
pub const fn xyyx(&self) -> Vec4
pub const fn xyyy(&self) -> Vec4
pub const fn yxxx(&self) -> Vec4
pub const fn yxxy(&self) -> Vec4
pub const fn yxyx(&self) -> Vec4
pub const fn yxyy(&self) -> Vec4
pub const fn yyxx(&self) -> Vec4
pub const fn yyxy(&self) -> Vec4
pub const fn yyyx(&self) -> Vec4
pub const fn yyyy(&self) -> Vec4
Sourcepub const fn with_z(&self, z: f32) -> Vec3
pub const fn with_z(&self, z: f32) -> Vec3
Extends this Vec2 with a z component, producing a Vec3.
Trait Implementations§
Source§impl AddAssign for Vec2
impl AddAssign for Vec2
Source§fn add_assign(&mut self, rhs: Self)
fn add_assign(&mut self, rhs: Self)
Performs the
+= operation. Read moreSource§impl DivAssign<f32> for Vec2
impl DivAssign<f32> for Vec2
Source§fn div_assign(&mut self, rhs: f32)
fn div_assign(&mut self, rhs: f32)
Performs the
/= operation. Read moreSource§impl MulAssign<f32> for Vec2
impl MulAssign<f32> for Vec2
Source§fn mul_assign(&mut self, rhs: f32)
fn mul_assign(&mut self, rhs: f32)
Performs the
*= operation. Read moreSource§impl SubAssign for Vec2
impl SubAssign for Vec2
Source§fn sub_assign(&mut self, rhs: Self)
fn sub_assign(&mut self, rhs: Self)
Performs the
-= operation. Read moreimpl Copy for Vec2
impl StructuralPartialEq for Vec2
Auto Trait Implementations§
impl Freeze for Vec2
impl RefUnwindSafe for Vec2
impl Send for Vec2
impl Sync for Vec2
impl Unpin for Vec2
impl UnsafeUnpin for Vec2
impl UnwindSafe for Vec2
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