Struct glam::u32::UVec2[][src]

#[repr(transparent)]pub struct UVec2(_);

A 2-dimensional vector.

Implementations

impl UVec2[src]

pub const ZERO: Self[src]

All zeroes.

pub const ONE: Self[src]

All ones.

pub const X: Self[src]

[1, 0]: a unit-length vector pointing along the positive X axis.

pub const Y: Self[src]

[0, 1]: a unit-length vector pointing along the positive Y axis.

pub fn new(x: u32, y: u32) -> UVec2[src]

Creates a new vector.

pub const fn unit_x() -> UVec2[src]

👎 Deprecated:

Use Vec2::X instead

Creates a vector with values [x: 1.0, y: 0.0].

pub const fn unit_y() -> UVec2[src]

👎 Deprecated:

Use Vec2::Y instead

Creates a vector with values [x: 0.0, y: 1.0].

pub fn extend(self, z: u32) -> UVec3[src]

Creates a 3D vector from self and the given z value.

pub const fn zero() -> Self[src]

👎 Deprecated:

use ZERO constant instead

Creates a vector with all elements set to 0.0.

pub const fn one() -> Self[src]

👎 Deprecated:

use ONE constant instead

Creates a vector with all elements set to 1.0.

pub fn splat(v: u32) -> Self[src]

Creates a vector with all elements set to v.

pub fn select(mask: BVec2, if_true: UVec2, if_false: UVec2) -> UVec2[src]

Creates a vector from the elements in if_true and if_false, selecting which to use for each element of self.

A true element in the mask uses the corresponding element from if_true, and false uses the element from if_false.

pub fn dot(self, other: Self) -> u32[src]

Computes the dot product of self and other.

pub fn min(self, other: Self) -> Self[src]

Returns a vector containing the mininum values for each element of self and other.

In other words this computes [self.x.max(other.x), self.y.max(other.y), ..].

pub fn max(self, other: Self) -> Self[src]

Returns a vector containing the maximum values for each element of self and other.

In other words this computes [self.x.max(other.x), self.y.max(other.y), ..].

pub fn min_element(self) -> u32[src]

Returns the horizontal minimum of self.

In other words this computes min(x, y, ..).

pub fn max_element(self) -> u32[src]

Returns the horizontal maximum of self.

In other words this computes max(x, y, ..).

pub fn cmpeq(self, other: Self) -> BVec2[src]

Returns a vector mask containing the result of a == comparison for each element of self and other.

In other words, this computes [self.x == other.x, self.y == other.y, ..] for all elements.

pub fn cmpne(self, other: Self) -> BVec2[src]

Returns a vector mask containing the result of a != comparison for each element of self and other.

In other words this computes [self.x != other.x, self.y != other.y, ..] for all elements.

pub fn cmpge(self, other: Self) -> BVec2[src]

Returns a vector mask containing the result of a >= comparison for each element of self and other.

In other words this computes [self.x >= other.x, self.y >= other.y, ..] for all elements.

pub fn cmpgt(self, other: Self) -> BVec2[src]

Returns a vector mask containing the result of a > comparison for each element of self and other.

In other words this computes [self.x > other.x, self.y > other.y, ..] for all elements.

pub fn cmple(self, other: Self) -> BVec2[src]

Returns a vector mask containing the result of a <= comparison for each element of self and other.

In other words this computes [self.x <= other.x, self.y <= other.y, ..] for all elements.

pub fn cmplt(self, other: Self) -> BVec2[src]

Returns a vector mask containing the result of a < comparison for each element of self and other.

In other words this computes [self.x < other.x, self.y < other.y, ..] for all elements.

pub fn from_slice_unaligned(slice: &[u32]) -> Self[src]

Creates a vector from the first N values in slice.

Panics

Panics if slice is less than N elements long.

pub fn write_to_slice_unaligned(self, slice: &mut [u32])[src]

Writes the elements of self to the first N elements in slice.

Panics

Panics if slice is less than N elements long.

pub fn as_f32(&self) -> Vec2[src]

Casts all elements of self to f32.

pub fn as_f64(&self) -> DVec2[src]

Casts all elements of self to f64.

pub fn as_i32(&self) -> IVec2[src]

Casts all elements of self to i32.

Trait Implementations

impl Add<UVec2> for UVec2[src]

type Output = Self

The resulting type after applying the + operator.

impl AddAssign<UVec2> for UVec2[src]

impl AsMut<[u32; 2]> for UVec2[src]

impl AsRef<[u32; 2]> for UVec2[src]

impl Clone for UVec2[src]

impl Copy for UVec2[src]

impl Debug for UVec2[src]

impl Default for UVec2[src]

impl Deref for UVec2[src]

type Target = XY<u32>

The resulting type after dereferencing.

impl DerefMut for UVec2[src]

impl Display for UVec2[src]

impl Div<UVec2> for UVec2[src]

type Output = Self

The resulting type after applying the / operator.

impl Div<u32> for UVec2[src]

type Output = Self

The resulting type after applying the / operator.

impl DivAssign<UVec2> for UVec2[src]

impl DivAssign<u32> for UVec2[src]

impl Eq for UVec2[src]

impl From<[u32; 2]> for UVec2[src]

impl From<(u32, u32)> for UVec2[src]

impl From<UVec3> for UVec2[src]

fn from(v: UVec3) -> Self[src]

Creates a Vec2 from the x and y elements of self, discarding z.

impl From<UVec4> for UVec2[src]

fn from(v: UVec4) -> Self[src]

Creates a 2D vector from the x and y elements of self, discarding z and w.

impl Hash for UVec2[src]

impl Index<usize> for UVec2[src]

type Output = u32

The returned type after indexing.

impl IndexMut<usize> for UVec2[src]

impl Mul<UVec2> for UVec2[src]

type Output = Self

The resulting type after applying the * operator.

impl Mul<u32> for UVec2[src]

type Output = Self

The resulting type after applying the * operator.

impl MulAssign<UVec2> for UVec2[src]

impl MulAssign<u32> for UVec2[src]

impl PartialEq<UVec2> for UVec2[src]

impl PartialOrd<UVec2> for UVec2[src]

impl<'a> Product<&'a UVec2> for UVec2[src]

impl Sub<UVec2> for UVec2[src]

type Output = Self

The resulting type after applying the - operator.

impl SubAssign<UVec2> for UVec2[src]

impl<'a> Sum<&'a UVec2> for UVec2[src]

impl Vec2Swizzles for UVec2[src]

type Vec3 = UVec3

type Vec4 = UVec4

Auto Trait Implementations

impl RefUnwindSafe for UVec2

impl Send for UVec2

impl Sync for UVec2

impl Unpin for UVec2

impl UnwindSafe for UVec2

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.