[−][src]Struct glam::f32::Vec2
Methods
impl Vec2
[src]
pub fn transform_mat2(self, rhs: &Mat2) -> Self
[src]
Multiplies a 2x2 matrix and a 2D vector.
Multiplication order is as follows:
world_direction = local_direction.transform_mat3(local_to_world)
impl Vec2
[src]
pub fn transform_mat3(self, rhs: &Mat3) -> Self
[src]
Multiplies a 3x3 matrix and a 2D point.
Multiplication order is as follows:
world_position = local_position.transform_mat3(local_to_world)
pub fn rotate_mat3(self, rhs: &Mat3) -> Self
[src]
Multiplies a 2x2 matrix and a 2D direction vector. Translation is not applied.
Multiplication order is as follows:
world_direction = local_direction.transform_mat4(local_to_world)
impl Vec2
[src]
pub fn zero() -> Vec2
[src]
pub fn one() -> Vec2
[src]
pub fn new(x: f32, y: f32) -> Vec2
[src]
pub fn unit_x() -> Vec2
[src]
pub fn unit_y() -> Vec2
[src]
pub fn splat(v: f32) -> Vec2
[src]
pub fn extend(self, z: f32) -> Vec3
[src]
pub fn x(self) -> f32
[src]
pub fn y(self) -> f32
[src]
pub fn set_x(&mut self, x: f32)
[src]
pub fn set_y(&mut self, y: f32)
[src]
pub fn dot(self, rhs: Vec2) -> f32
[src]
pub fn length(self) -> f32
[src]
pub fn length_squared(self) -> f32
[src]
pub fn normalize(self) -> Vec2
[src]
pub fn min(self, rhs: Vec2) -> Vec2
[src]
pub fn max(self, rhs: Vec2) -> Vec2
[src]
pub fn min_element(self) -> f32
[src]
pub fn max_element(self) -> f32
[src]
pub fn cmpeq(self, rhs: Vec2) -> Vec2b
[src]
pub fn cmpne(self, rhs: Vec2) -> Vec2b
[src]
pub fn cmpge(self, rhs: Vec2) -> Vec2b
[src]
pub fn cmpgt(self, rhs: Vec2) -> Vec2b
[src]
pub fn cmple(self, rhs: Vec2) -> Vec2b
[src]
pub fn cmplt(self, rhs: Vec2) -> Vec2b
[src]
pub fn sign(self) -> Self
[src]
pub fn reciprocal(self) -> Self
[src]
pub fn lerp(self, rhs: Self, s: f32) -> Self
[src]
Trait Implementations
impl Copy for Vec2
[src]
impl PartialOrd<Vec2> for Vec2
[src]
fn partial_cmp(&self, other: &Vec2) -> Option<Ordering>
[src]
fn lt(&self, other: &Vec2) -> bool
[src]
fn le(&self, other: &Vec2) -> bool
[src]
fn gt(&self, other: &Vec2) -> bool
[src]
fn ge(&self, other: &Vec2) -> bool
[src]
impl AsMut<[f32; 2]> for Vec2
[src]
impl From<(f32, f32)> for Vec2
[src]
impl From<Vec2> for (f32, f32)
[src]
impl From<[f32; 2]> for Vec2
[src]
impl From<Vec2> for [f32; 2]
[src]
impl From<Point2<f32>> for Vec2
[src]
impl From<Vec2> for Point2<f32>
[src]
impl From<Vector2<f32>> for Vec2
[src]
impl From<Vec2> for Vector2<f32>
[src]
impl PartialEq<Vec2> for Vec2
[src]
impl AsRef<[f32; 2]> for Vec2
[src]
impl Clone for Vec2
[src]
fn clone(&self) -> Vec2
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl Default for Vec2
[src]
impl Display for Vec2
[src]
impl Debug for Vec2
[src]
impl Sub<Vec2> for Vec2
[src]
type Output = Vec2
The resulting type after applying the -
operator.
fn sub(self, rhs: Vec2) -> Vec2
[src]
impl Add<Vec2> for Vec2
[src]
type Output = Vec2
The resulting type after applying the +
operator.
fn add(self, rhs: Vec2) -> Vec2
[src]
impl Mul<Mat2> for Vec2
[src]
type Output = Vec2
The resulting type after applying the *
operator.
fn mul(self, rhs: Mat2) -> Vec2
[src]
impl Mul<Vec2> for Vec2
[src]
type Output = Vec2
The resulting type after applying the *
operator.
fn mul(self, rhs: Vec2) -> Vec2
[src]
impl Mul<f32> for Vec2
[src]
type Output = Vec2
The resulting type after applying the *
operator.
fn mul(self, rhs: f32) -> Vec2
[src]
impl Mul<Vec2> for f32
[src]
type Output = Vec2
The resulting type after applying the *
operator.
fn mul(self, rhs: Vec2) -> Vec2
[src]
impl Div<Vec2> for Vec2
[src]
type Output = Vec2
The resulting type after applying the /
operator.
fn div(self, rhs: Vec2) -> Vec2
[src]
impl Div<f32> for Vec2
[src]
type Output = Vec2
The resulting type after applying the /
operator.
fn div(self, rhs: f32) -> Vec2
[src]
impl Neg for Vec2
[src]
impl AddAssign<Vec2> for Vec2
[src]
fn add_assign(&mut self, rhs: Vec2)
[src]
impl SubAssign<Vec2> for Vec2
[src]
fn sub_assign(&mut self, rhs: Vec2)
[src]
impl MulAssign<Vec2> for Vec2
[src]
fn mul_assign(&mut self, rhs: Vec2)
[src]
impl MulAssign<f32> for Vec2
[src]
fn mul_assign(&mut self, rhs: f32)
[src]
impl DivAssign<Vec2> for Vec2
[src]
fn div_assign(&mut self, rhs: Vec2)
[src]
impl DivAssign<f32> for Vec2
[src]
fn div_assign(&mut self, rhs: f32)
[src]
impl Distribution<Vec2> for Standard
[src]
fn sample<R: Rng + ?Sized>(&self, rng: &mut R) -> Vec2
[src]
fn sample_iter<R>(&'a self, rng: &'a mut R) -> DistIter<'a, Self, R, T> where
R: Rng,
[src]
R: Rng,
Create an iterator that generates random values of T
, using rng
as the source of randomness. Read more
impl AbsDiffEq<Vec2> for Vec2
[src]
type Epsilon = <f32 as AbsDiffEq>::Epsilon
Used for specifying relative comparisons.
fn default_epsilon() -> Self::Epsilon
[src]
fn abs_diff_eq(&self, other: &Self, epsilon: Self::Epsilon) -> bool
[src]
fn abs_diff_ne(&self, other: &Rhs, epsilon: Self::Epsilon) -> bool
[src]
The inverse of ApproxEq::abs_diff_eq
.
impl UlpsEq<Vec2> for Vec2
[src]
fn default_max_ulps() -> u32
[src]
fn ulps_eq(&self, other: &Self, epsilon: Self::Epsilon, max_ulps: u32) -> bool
[src]
fn ulps_ne(&self, other: &Rhs, epsilon: Self::Epsilon, max_ulps: u32) -> bool
[src]
The inverse of ApproxEq::ulps_eq
.
impl Serialize for Vec2
[src]
impl<'de> Deserialize<'de> for Vec2
[src]
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error> where
D: Deserializer<'de>,
[src]
D: Deserializer<'de>,
Auto Trait Implementations
Blanket Implementations
impl<T> From<T> for T
[src]
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> DeserializeOwned for T where
T: Deserialize<'de>,
[src]
T: Deserialize<'de>,