[][src]Struct glam::f32::Vec2Mask

#[repr(C)]
pub struct Vec2Mask(_, _);

A 2-dimensional vector mask.

This type is typically created by comparison methods on Vec2.

Methods

impl Vec2Mask[src]

pub fn new(x: bool, y: bool) -> Self[src]

Creates a new Vec2Mask.

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

Returns a bitmask with the lowest two bits set from the elements of the Vec2Mask.

A true element results in a 1 bit and a false element in a 0 bit. Element x goes into the first lowest bit, element y into the second, etc.

pub fn any(self) -> bool[src]

Returns true if any of the elements are true, false otherwise.

In other words: x || y.

pub fn all(self) -> bool[src]

Returns true if all the elements are true, false otherwise.

In other words: x && y.

pub fn select(self, if_true: Vec2, if_false: Vec2) -> Vec2[src]

Creates a new Vec2 from the elements in if_true and if_false, selecting which to use for each element based on the Vec2Mask.

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

Trait Implementations

impl Clone for Vec2Mask[src]

impl Copy for Vec2Mask[src]

impl Default for Vec2Mask[src]

impl Not for Vec2Mask[src]

type Output = Self

The resulting type after applying the ! operator.

impl BitAnd<Vec2Mask> for Vec2Mask[src]

type Output = Self

The resulting type after applying the & operator.

impl BitOr<Vec2Mask> for Vec2Mask[src]

type Output = Self

The resulting type after applying the | operator.

impl BitAndAssign<Vec2Mask> for Vec2Mask[src]

impl BitOrAssign<Vec2Mask> for Vec2Mask[src]

Auto Trait Implementations

Blanket Implementations

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

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

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

type Owned = T

The resulting type after obtaining ownership.

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.

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

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

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