Struct makepad_math::math_f32::Vec2
source · pub struct Vec2 {
pub x: f32,
pub y: f32,
}
Fields§
§x: f32
§y: f32
Implementations§
source§impl Vec2
impl Vec2
pub fn new() -> Vec2
pub fn index(&self, index: Vec2Index) -> f32
pub fn set_index(&mut self, index: Vec2Index, v: f32)
pub fn from_index_pair(index: Vec2Index, a: f32, b: f32) -> Self
pub fn into_dvec2(self) -> DVec2
pub fn all(x: f32) -> Vec2
pub fn from_lerp(a: Vec2, b: Vec2, f: f32) -> Vec2
pub fn distance(&self, other: &Vec2) -> f32
pub fn length(&self) -> f32
pub fn to_vec3(&self) -> Vec3
Trait Implementations§
source§impl AddAssign<Vec2> for Vec2
impl AddAssign<Vec2> for Vec2
source§fn add_assign(&mut self, rhs: Vec2)
fn add_assign(&mut self, rhs: Vec2)
Performs the
+=
operation. Read moresource§impl AddAssign<f32> for Vec2
impl AddAssign<f32> for Vec2
source§fn add_assign(&mut self, rhs: f32)
fn add_assign(&mut self, rhs: f32)
Performs the
+=
operation. Read moresource§impl DivAssign<Vec2> for Vec2
impl DivAssign<Vec2> for Vec2
source§fn div_assign(&mut self, rhs: Vec2)
fn div_assign(&mut self, rhs: Vec2)
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<Vec2> for Vec2
impl MulAssign<Vec2> for Vec2
source§fn mul_assign(&mut self, rhs: Vec2)
fn mul_assign(&mut self, rhs: Vec2)
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 PartialEq<Vec2> for Vec2
impl PartialEq<Vec2> for Vec2
source§impl SubAssign<Vec2> for Vec2
impl SubAssign<Vec2> for Vec2
source§fn sub_assign(&mut self, rhs: Vec2)
fn sub_assign(&mut self, rhs: Vec2)
Performs the
-=
operation. Read moresource§impl SubAssign<f32> for Vec2
impl SubAssign<f32> for Vec2
source§fn sub_assign(&mut self, rhs: f32)
fn sub_assign(&mut self, rhs: f32)
Performs the
-=
operation. Read moreimpl 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§
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