#[repr(transparent)]pub struct UVec3(_);
Expand description
A 3-dimensional vector.
Implementations
sourceimpl UVec3
impl UVec3
sourcepub const X: UVec3 = Self(Vector3Const::X)
pub const X: UVec3 = Self(Vector3Const::X)
[1, 0, 0]
: a unit-length vector pointing along the positive X axis.
sourcepub const Y: UVec3 = Self(Vector3Const::Y)
pub const Y: UVec3 = Self(Vector3Const::Y)
[0, 1, 0]
: a unit-length vector pointing along the positive Y axis.
sourcepub const Z: UVec3 = Self(Vector3Const::Z)
pub const Z: UVec3 = Self(Vector3Const::Z)
[0, 0, 1]
: a unit-length vector pointing along the positive Z axis.
sourcepub const fn unit_x() -> UVec3
👎 Deprecated: Use Vec3::X instead
pub const fn unit_x() -> UVec3
Use Vec3::X instead
Creates a vector with values [x: 1.0, y: 0.0, z: 0.0]
.
sourcepub const fn unit_y() -> UVec3
👎 Deprecated: Use Vec3::Y instead
pub const fn unit_y() -> UVec3
Use Vec3::Y instead
Creates a vector with values [x: 0.0, y: 1.0, z: 0.0]
.
sourcepub const fn unit_z() -> UVec3
👎 Deprecated: Use Vec3::Z instead
pub const fn unit_z() -> UVec3
Use Vec3::Z instead
Creates a vector with values [x: 0.0, y: 0.0, z: 1.0]
.
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 const fn zero() -> UVec3
👎 Deprecated: use ZERO constant instead
pub const fn zero() -> UVec3
use ZERO constant instead
Creates a vector with all elements set to 0.0
.
sourcepub const fn one() -> UVec3
👎 Deprecated: use ONE constant instead
pub const fn one() -> UVec3
use ONE constant instead
Creates a vector with all elements set to 1.0
.
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: UVec3) -> UVec3
pub fn min(self, other: UVec3) -> UVec3
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), ..]
.
sourcepub fn max(self, other: UVec3) -> UVec3
pub fn max(self, other: UVec3) -> UVec3
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: UVec3, max: UVec3) -> UVec3
pub fn clamp(self, min: UVec3, max: UVec3) -> UVec3
Component-wise clamping of values, similar to [std::f32::clamp
].
Each element in min
must be less-or-equal to the corresponing element in max
.
If the glam-assert
feature is enabled, the function will panic if the contract is not
met, otherwise the behavior is undefined.
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: UVec3) -> BVec3
pub fn cmpeq(self, other: UVec3) -> 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: UVec3) -> BVec3
pub fn cmpne(self, other: UVec3) -> 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: UVec3) -> BVec3
pub fn cmpge(self, other: UVec3) -> 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: UVec3) -> BVec3
pub fn cmpgt(self, other: UVec3) -> 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: UVec3) -> BVec3
pub fn cmple(self, other: UVec3) -> 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: UVec3) -> BVec3
pub fn cmplt(self, other: UVec3) -> 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_unaligned(slice: &[u32]) -> UVec3
pub fn from_slice_unaligned(slice: &[u32]) -> UVec3
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_unaligned(self, slice: &mut [u32])
pub fn write_to_slice_unaligned(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
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 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 PartialOrd<UVec3> for UVec3
impl PartialOrd<UVec3> for UVec3
sourcefn partial_cmp(&self, other: &UVec3) -> Option<Ordering>
fn partial_cmp(&self, other: &UVec3) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
1.0.0 · sourcefn lt(&self, other: &Rhs) -> bool
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
1.0.0 · sourcefn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. 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 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) -> UVec3
fn xxy(self) -> UVec3
fn xxz(self) -> UVec3
fn xyx(self) -> UVec3
fn xyy(self) -> UVec3
fn xzx(self) -> UVec3
fn xzy(self) -> UVec3
fn xzz(self) -> UVec3
fn yxx(self) -> UVec3
fn yxy(self) -> UVec3
fn yxz(self) -> UVec3
fn yyx(self) -> UVec3
fn yyy(self) -> UVec3
fn yyz(self) -> UVec3
fn yzx(self) -> UVec3
fn yzy(self) -> UVec3
fn yzz(self) -> UVec3
fn zxx(self) -> UVec3
fn zxy(self) -> UVec3
fn zxz(self) -> UVec3
fn zyx(self) -> UVec3
fn zyy(self) -> UVec3
fn zyz(self) -> UVec3
fn zzx(self) -> UVec3
fn zzy(self) -> UVec3
fn zzz(self) -> UVec3
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