pub struct UVec4(/* private fields */);Expand description
A 4-dimensional vector.
Implementations§
Source§impl UVec4
impl UVec4
Sourcepub fn truncate(self) -> UVec3
pub fn truncate(self) -> UVec3
Creates a Vec3 from the x, y and z elements of self, discarding w.
Truncation to Vec3 may also be performed by using self.xyz() or Vec3::from().
To truncate to Vec3A use Vec3A::from().
Sourcepub fn select(mask: BVec4, if_true: UVec4, if_false: UVec4) -> UVec4
pub fn select(mask: BVec4, if_true: UVec4, if_false: UVec4) -> UVec4
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.
Sourcepub fn min(self, other: UVec4) -> UVec4
pub fn min(self, other: UVec4) -> UVec4
Returns a vector containing the minimum values for each element of self and other.
In other words this computes [self.x.min(other.x), self.y.min(other.y), ..].
Sourcepub fn max(self, other: UVec4) -> UVec4
pub fn max(self, other: UVec4) -> UVec4
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), ..].
Sourcepub fn clamp(self, min: UVec4, max: UVec4) -> UVec4
pub fn clamp(self, min: UVec4, max: UVec4) -> UVec4
Component-wise clamping of values, similar to f32::clamp.
Each element in min must be less-or-equal to the corresponding element in max.
§Panics
Will panic if min is greater than max when glam_assert is enabled.
Sourcepub fn min_element(self) -> u32
pub fn min_element(self) -> u32
Returns the horizontal minimum of self.
In other words this computes min(x, y, ..).
Sourcepub fn max_element(self) -> u32
pub fn max_element(self) -> u32
Returns the horizontal maximum of self.
In other words this computes max(x, y, ..).
Sourcepub fn cmpeq(self, other: UVec4) -> BVec4
pub fn cmpeq(self, other: UVec4) -> BVec4
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.
Sourcepub fn cmpne(self, other: UVec4) -> BVec4
pub fn cmpne(self, other: UVec4) -> BVec4
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.
Sourcepub fn cmpge(self, other: UVec4) -> BVec4
pub fn cmpge(self, other: UVec4) -> BVec4
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.
Sourcepub fn cmpgt(self, other: UVec4) -> BVec4
pub fn cmpgt(self, other: UVec4) -> BVec4
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.
Sourcepub fn cmple(self, other: UVec4) -> BVec4
pub fn cmple(self, other: UVec4) -> BVec4
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.
Sourcepub fn cmplt(self, other: UVec4) -> BVec4
pub fn cmplt(self, other: UVec4) -> BVec4
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.
Sourcepub fn from_slice(slice: &[u32]) -> UVec4
pub fn from_slice(slice: &[u32]) -> UVec4
Creates a vector from the first N values in slice.
§Panics
Panics if slice is less than N elements long.
Sourcepub fn write_to_slice(self, slice: &mut [u32])
pub fn write_to_slice(self, slice: &mut [u32])
Writes the elements of self to the first N elements in slice.
§Panics
Panics if slice is less than N elements long.
Trait Implementations§
Source§impl AddAssign<u32> for UVec4
impl AddAssign<u32> for UVec4
Source§fn add_assign(&mut self, other: u32)
fn add_assign(&mut self, other: u32)
+= operation. Read moreSource§impl AddAssign for UVec4
impl AddAssign for UVec4
Source§fn add_assign(&mut self, other: UVec4)
fn add_assign(&mut self, other: UVec4)
+= operation. Read moreSource§impl DivAssign<u32> for UVec4
impl DivAssign<u32> for UVec4
Source§fn div_assign(&mut self, other: u32)
fn div_assign(&mut self, other: u32)
/= operation. Read moreSource§impl DivAssign for UVec4
impl DivAssign for UVec4
Source§fn div_assign(&mut self, other: UVec4)
fn div_assign(&mut self, other: UVec4)
/= operation. Read moreSource§impl MulAssign<u32> for UVec4
impl MulAssign<u32> for UVec4
Source§fn mul_assign(&mut self, other: u32)
fn mul_assign(&mut self, other: u32)
*= operation. Read moreSource§impl MulAssign for UVec4
impl MulAssign for UVec4
Source§fn mul_assign(&mut self, other: UVec4)
fn mul_assign(&mut self, other: UVec4)
*= operation. Read moreSource§impl RemAssign<u32> for UVec4
impl RemAssign<u32> for UVec4
Source§fn rem_assign(&mut self, other: u32)
fn rem_assign(&mut self, other: u32)
%= operation. Read moreSource§impl RemAssign for UVec4
impl RemAssign for UVec4
Source§fn rem_assign(&mut self, other: UVec4)
fn rem_assign(&mut self, other: UVec4)
%= operation. Read moreSource§impl SubAssign<u32> for UVec4
impl SubAssign<u32> for UVec4
Source§fn sub_assign(&mut self, other: u32)
fn sub_assign(&mut self, other: u32)
-= operation. Read moreSource§impl SubAssign for UVec4
impl SubAssign for UVec4
Source§fn sub_assign(&mut self, other: UVec4)
fn sub_assign(&mut self, other: UVec4)
-= operation. Read more