#[repr(transparent)]pub struct UVec3(_);
Expand description
A 3-dimensional vector.
Implementations
sourceimpl UVec3
impl UVec3
sourcepub fn truncate(self) -> UVec2
pub fn truncate(self) -> UVec2
Creates a Vec2
from the x
and y
elements of self
, discarding z
.
Truncation may also be performed by using self.xy()
or Vec2::from()
.
sourcepub fn select(mask: BVec3, if_true: UVec3, if_false: UVec3) -> UVec3
pub fn select(mask: BVec3, if_true: UVec3, if_false: UVec3) -> UVec3
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: Self) -> Self
pub fn min(self, other: Self) -> Self
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: Self) -> Self
pub fn max(self, other: Self) -> Self
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: Self, max: Self) -> Self
pub fn clamp(self, min: Self, max: Self) -> Self
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: Self) -> BVec3
pub fn cmpeq(self, other: Self) -> BVec3
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: Self) -> BVec3
pub fn cmpne(self, other: Self) -> BVec3
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: Self) -> BVec3
pub fn cmpge(self, other: Self) -> BVec3
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: Self) -> BVec3
pub fn cmpgt(self, other: Self) -> BVec3
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: Self) -> BVec3
pub fn cmple(self, other: Self) -> BVec3
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: Self) -> BVec3
pub fn cmplt(self, other: Self) -> BVec3
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]) -> Self
pub fn from_slice(slice: &[u32]) -> Self
Creates a vector from the first N values in slice
.
Panics
Panics if slice
is less than N elements long.
Trait Implementations
sourceimpl AddAssign<UVec3> for UVec3
impl AddAssign<UVec3> for UVec3
sourcefn add_assign(&mut self, other: UVec3)
fn add_assign(&mut self, other: UVec3)
Performs the +=
operation. Read more
sourceimpl AddAssign<u32> for UVec3
impl AddAssign<u32> for UVec3
sourcefn add_assign(&mut self, other: u32)
fn add_assign(&mut self, other: u32)
Performs the +=
operation. Read more
sourceimpl DivAssign<UVec3> for UVec3
impl DivAssign<UVec3> for UVec3
sourcefn div_assign(&mut self, other: UVec3)
fn div_assign(&mut self, other: UVec3)
Performs the /=
operation. Read more
sourceimpl DivAssign<u32> for UVec3
impl DivAssign<u32> for UVec3
sourcefn div_assign(&mut self, other: u32)
fn div_assign(&mut self, other: u32)
Performs the /=
operation. Read more
sourceimpl MulAssign<UVec3> for UVec3
impl MulAssign<UVec3> for UVec3
sourcefn mul_assign(&mut self, other: UVec3)
fn mul_assign(&mut self, other: UVec3)
Performs the *=
operation. Read more
sourceimpl MulAssign<u32> for UVec3
impl MulAssign<u32> for UVec3
sourcefn mul_assign(&mut self, other: u32)
fn mul_assign(&mut self, other: u32)
Performs the *=
operation. Read more
sourceimpl RemAssign<UVec3> for UVec3
impl RemAssign<UVec3> for UVec3
sourcefn rem_assign(&mut self, other: UVec3)
fn rem_assign(&mut self, other: UVec3)
Performs the %=
operation. Read more
sourceimpl RemAssign<u32> for UVec3
impl RemAssign<u32> for UVec3
sourcefn rem_assign(&mut self, other: u32)
fn rem_assign(&mut self, other: u32)
Performs the %=
operation. Read more
sourceimpl SubAssign<UVec3> for UVec3
impl SubAssign<UVec3> for UVec3
sourcefn sub_assign(&mut self, other: UVec3)
fn sub_assign(&mut self, other: UVec3)
Performs the -=
operation. Read more
sourceimpl SubAssign<u32> for UVec3
impl SubAssign<u32> for UVec3
sourcefn sub_assign(&mut self, other: u32)
fn sub_assign(&mut self, other: u32)
Performs the -=
operation. Read more
sourceimpl Vec3Swizzles for UVec3
impl Vec3Swizzles for UVec3
type Vec2 = UVec2
type Vec4 = UVec4
fn xxxx(self) -> UVec4
fn xxxy(self) -> UVec4
fn xxxz(self) -> UVec4
fn xxyx(self) -> UVec4
fn xxyy(self) -> UVec4
fn xxyz(self) -> UVec4
fn xxzx(self) -> UVec4
fn xxzy(self) -> UVec4
fn xxzz(self) -> UVec4
fn xyxx(self) -> UVec4
fn xyxy(self) -> UVec4
fn xyxz(self) -> UVec4
fn xyyx(self) -> UVec4
fn xyyy(self) -> UVec4
fn xyyz(self) -> UVec4
fn xyzx(self) -> UVec4
fn xyzy(self) -> UVec4
fn xyzz(self) -> UVec4
fn xzxx(self) -> UVec4
fn xzxy(self) -> UVec4
fn xzxz(self) -> UVec4
fn xzyx(self) -> UVec4
fn xzyy(self) -> UVec4
fn xzyz(self) -> UVec4
fn xzzx(self) -> UVec4
fn xzzy(self) -> UVec4
fn xzzz(self) -> UVec4
fn yxxx(self) -> UVec4
fn yxxy(self) -> UVec4
fn yxxz(self) -> UVec4
fn yxyx(self) -> UVec4
fn yxyy(self) -> UVec4
fn yxyz(self) -> UVec4
fn yxzx(self) -> UVec4
fn yxzy(self) -> UVec4
fn yxzz(self) -> UVec4
fn yyxx(self) -> UVec4
fn yyxy(self) -> UVec4
fn yyxz(self) -> UVec4
fn yyyx(self) -> UVec4
fn yyyy(self) -> UVec4
fn yyyz(self) -> UVec4
fn yyzx(self) -> UVec4
fn yyzy(self) -> UVec4
fn yyzz(self) -> UVec4
fn yzxx(self) -> UVec4
fn yzxy(self) -> UVec4
fn yzxz(self) -> UVec4
fn yzyx(self) -> UVec4
fn yzyy(self) -> UVec4
fn yzyz(self) -> UVec4
fn yzzx(self) -> UVec4
fn yzzy(self) -> UVec4
fn yzzz(self) -> UVec4
fn zxxx(self) -> UVec4
fn zxxy(self) -> UVec4
fn zxxz(self) -> UVec4
fn zxyx(self) -> UVec4
fn zxyy(self) -> UVec4
fn zxyz(self) -> UVec4
fn zxzx(self) -> UVec4
fn zxzy(self) -> UVec4
fn zxzz(self) -> UVec4
fn zyxx(self) -> UVec4
fn zyxy(self) -> UVec4
fn zyxz(self) -> UVec4
fn zyyx(self) -> UVec4
fn zyyy(self) -> UVec4
fn zyyz(self) -> UVec4
fn zyzx(self) -> UVec4
fn zyzy(self) -> UVec4
fn zyzz(self) -> UVec4
fn zzxx(self) -> UVec4
fn zzxy(self) -> UVec4
fn zzxz(self) -> UVec4
fn zzyx(self) -> UVec4
fn zzyy(self) -> UVec4
fn zzyz(self) -> UVec4
fn zzzx(self) -> UVec4
fn zzzy(self) -> UVec4
fn zzzz(self) -> UVec4
fn xxx(self) -> Self
fn xxy(self) -> Self
fn xxz(self) -> Self
fn xyx(self) -> Self
fn xyy(self) -> Self
fn xzx(self) -> Self
fn xzy(self) -> Self
fn xzz(self) -> Self
fn yxx(self) -> Self
fn yxy(self) -> Self
fn yxz(self) -> Self
fn yyx(self) -> Self
fn yyy(self) -> Self
fn yyz(self) -> Self
fn yzx(self) -> Self
fn yzy(self) -> Self
fn yzz(self) -> Self
fn zxx(self) -> Self
fn zxy(self) -> Self
fn zxz(self) -> Self
fn zyx(self) -> Self
fn zyy(self) -> Self
fn zyz(self) -> Self
fn zzx(self) -> Self
fn zzy(self) -> Self
fn zzz(self) -> Self
fn xx(self) -> UVec2
fn xy(self) -> UVec2
fn xz(self) -> UVec2
fn yx(self) -> UVec2
fn yy(self) -> UVec2
fn yz(self) -> UVec2
fn zx(self) -> UVec2
fn zy(self) -> UVec2
fn zz(self) -> UVec2
fn xyz(self) -> Self
impl Copy for UVec3
impl Eq for UVec3
Auto Trait Implementations
impl RefUnwindSafe for UVec3
impl Send for UVec3
impl Sync for UVec3
impl Unpin for UVec3
impl UnwindSafe for UVec3
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more