[−][src]Struct glam::f32::Vec4Mask
A 4-dimensional vector mask.
This type is typically created by comparison methods on Vec4
. It is
essentially a vector of four boolean values.
Methods
impl Vec4Mask
[src]
pub fn new(x: bool, y: bool, z: bool, w: bool) -> Self
[src]
Creates a new Vec4Mask
.
pub fn bitmask(self) -> u32
[src]
Returns a bitmask with the lowest four bits set from the elements of
the Vec4Mask
.
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 || z || w
.
pub fn all(self) -> bool
[src]
Returns true if all the elements are true, false otherwise.
In other words: x && y && z && w
.
pub fn select(self, if_true: Vec4, if_false: Vec4) -> Vec4
[src]
Creates a new Vec4
from the elements in if_true
and if_false
,
selecting which to use for each element based on the Vec4Mask
.
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 Vec4Mask
[src]
impl Copy for Vec4Mask
[src]
impl Default for Vec4Mask
[src]
impl Not for Vec4Mask
[src]
impl BitAnd<Vec4Mask> for Vec4Mask
[src]
type Output = Self
The resulting type after applying the &
operator.
fn bitand(self, other: Self) -> Self
[src]
impl BitOr<Vec4Mask> for Vec4Mask
[src]
type Output = Self
The resulting type after applying the |
operator.
fn bitor(self, other: Self) -> Self
[src]
impl BitAndAssign<Vec4Mask> for Vec4Mask
[src]
fn bitand_assign(&mut self, other: Self)
[src]
impl BitOrAssign<Vec4Mask> for Vec4Mask
[src]
fn bitor_assign(&mut self, other: Self)
[src]
Auto Trait Implementations
impl Send for Vec4Mask
impl Sync for Vec4Mask
impl Unpin for Vec4Mask
impl UnwindSafe for Vec4Mask
impl RefUnwindSafe for Vec4Mask
Blanket Implementations
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
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, 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> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,