#[repr(C, align(16))]pub struct Vector4u {
pub x: u32,
pub y: u32,
pub z: u32,
pub w: u32,
}Expand description
An owning representation of an unsigned 4-component Euclidean vector.
Like Vec4u, the Vector4u object represents a Euclidean vector in
4D. Unlike the Vec4u, this is an owning representation that stores the
actual content of the vector.
Fields§
§x: u32The X-component of the vector.
y: u32The Y-component of the vector.
z: u32The Z-component of the vector.
w: u32The W-component of the vector.
Implementations§
source§impl Vector4u
impl Vector4u
sourcepub const ZERO: Vector4u = _
pub const ZERO: Vector4u = _
A constant for a Null vector, which has magnitude 0 and exists at the origin.
sourcepub const UNIT_X: Vector4u = _
pub const UNIT_X: Vector4u = _
A constant for a unit vector in the positive X-direction.
sourcepub const UNIT_Y: Vector4u = _
pub const UNIT_Y: Vector4u = _
A constant for a unit vector in the positive Y-direction.
sourcepub const UNIT_Z: Vector4u = _
pub const UNIT_Z: Vector4u = _
A constant for a unit vector in the positive Z-direction.
sourcepub const UNIT_W: Vector4u = _
pub const UNIT_W: Vector4u = _
A constant for a unit vector in the positive W-direction.
sourcepub const fn new(x: u32, y: u32, z: u32, w: u32) -> Self
pub const fn new(x: u32, y: u32, z: u32, w: u32) -> Self
Constructs this vector from an x, y, z, and w coordinate.
§Parameters
x- the x-componenty- the y-componentz- the z-componentw- the w-component
sourcepub const fn from_array(array: &[u32; 4]) -> Self
pub const fn from_array(array: &[u32; 4]) -> Self
sourcepub const fn from_slice(slice: &[u32]) -> Result<Self, VecError>
pub const fn from_slice(slice: &[u32]) -> Result<Self, VecError>
sourcepub const unsafe fn from_slice_unchecked(slice: &[u32]) -> Self
pub const unsafe fn from_slice_unchecked(slice: &[u32]) -> Self
sourcepub fn from_vec4u(other: &Vec4u) -> Self
pub fn from_vec4u(other: &Vec4u) -> Self
sourcepub fn as_mut_vec4(&mut self) -> &mut Vec4u
pub fn as_mut_vec4(&mut self) -> &mut Vec4u
Returns this vector as a mutable Vec4u.
sourcepub fn as_mut_slice(&mut self) -> &mut [u32]
pub fn as_mut_slice(&mut self) -> &mut [u32]
Returns this vector as a mutable slice of u32.
Methods from Deref<Target = Vec4u>§
sourcepub fn as_mut_slice(&mut self) -> &mut [u32]
pub fn as_mut_slice(&mut self) -> &mut [u32]
sourcepub fn as_mut_ptr(&mut self) -> *mut u32
pub fn as_mut_ptr(&mut self) -> *mut u32
Returns a mutable raw pointer to u32 of the vector’s buffer.
sourcepub fn iter_mut(&mut self) -> impl Iterator<Item = &mut u32>
pub fn iter_mut(&mut self) -> impl Iterator<Item = &mut u32>
Returns a mutable iterator over the vector.
sourcepub fn x_mut(&mut self) -> &mut u32
pub fn x_mut(&mut self) -> &mut u32
Returns a mutable reference to the X-coordinate of this 3-component vector.
sourcepub fn y_mut(&mut self) -> &mut u32
pub fn y_mut(&mut self) -> &mut u32
Returns a mutable reference to the Y-coordinate of this 3-component vector.
sourcepub fn z_mut(&mut self) -> &mut u32
pub fn z_mut(&mut self) -> &mut u32
Returns a mutable reference to the Z-coordinate of this 3-component vector.
sourcepub fn w_mut(&mut self) -> &mut u32
pub fn w_mut(&mut self) -> &mut u32
Returns a mutable reference to the W-coordinate of this 3-component vector.
sourcepub fn xy_mut(&mut self) -> &mut Vec2u
pub fn xy_mut(&mut self) -> &mut Vec2u
Returns a mutable reference to the xy coordinates of this vector.
sourcepub fn yz_mut(&mut self) -> &mut Vec2u
pub fn yz_mut(&mut self) -> &mut Vec2u
Returns a mutable reference to the yz coordinates of this vector.
sourcepub fn zw_mut(&mut self) -> &mut Vec2u
pub fn zw_mut(&mut self) -> &mut Vec2u
Returns a mutable reference to the zw coordinates of this vector.
sourcepub fn xyz_mut(&mut self) -> &mut Vec3u
pub fn xyz_mut(&mut self) -> &mut Vec3u
Returns a mutable reference to the yz coordinates of this vector.
sourcepub fn yzw_mut(&mut self) -> &mut Vec3u
pub fn yzw_mut(&mut self) -> &mut Vec3u
Returns a mutable reference to the zw coordinates of this vector.
Trait Implementations§
source§impl AddAssign<&Vec4u> for Vector4u
impl AddAssign<&Vec4u> for Vector4u
source§fn add_assign(&mut self, rhs: &Vec4u)
fn add_assign(&mut self, rhs: &Vec4u)
+= operation. Read moresource§impl AddAssign<&Vector4u> for Vector4u
impl AddAssign<&Vector4u> for Vector4u
source§fn add_assign(&mut self, rhs: &Self)
fn add_assign(&mut self, rhs: &Self)
+= operation. Read moresource§impl AddAssign for Vector4u
impl AddAssign for Vector4u
source§fn add_assign(&mut self, rhs: Self)
fn add_assign(&mut self, rhs: Self)
+= operation. Read moresource§impl BorrowMut<[u32]> for Vector4u
impl BorrowMut<[u32]> for Vector4u
source§fn borrow_mut(&mut self) -> &mut [u32]
fn borrow_mut(&mut self) -> &mut [u32]
source§impl BorrowMut<Vec4u> for Vector4u
impl BorrowMut<Vec4u> for Vector4u
source§fn borrow_mut(&mut self) -> &mut Vec4u
fn borrow_mut(&mut self) -> &mut Vec4u
source§impl DivAssign<u32> for Vector4u
impl DivAssign<u32> for Vector4u
source§fn div_assign(&mut self, rhs: u32)
fn div_assign(&mut self, rhs: u32)
/= operation. Read moresource§impl MulAssign<u32> for Vector4u
impl MulAssign<u32> for Vector4u
source§fn mul_assign(&mut self, rhs: u32)
fn mul_assign(&mut self, rhs: u32)
*= operation. Read moresource§impl Ord for Vector4u
impl Ord for Vector4u
source§impl PartialOrd for Vector4u
impl PartialOrd for Vector4u
source§impl RemAssign<u32> for Vector4u
impl RemAssign<u32> for Vector4u
source§fn rem_assign(&mut self, rhs: u32)
fn rem_assign(&mut self, rhs: u32)
%= operation. Read moresource§impl SubAssign<&Vec4u> for Vector4u
impl SubAssign<&Vec4u> for Vector4u
source§fn sub_assign(&mut self, rhs: &Vec4u)
fn sub_assign(&mut self, rhs: &Vec4u)
-= operation. Read moresource§impl SubAssign<&Vector4u> for Vector4u
impl SubAssign<&Vector4u> for Vector4u
source§fn sub_assign(&mut self, rhs: &Self)
fn sub_assign(&mut self, rhs: &Self)
-= operation. Read moresource§impl SubAssign for Vector4u
impl SubAssign for Vector4u
source§fn sub_assign(&mut self, rhs: Self)
fn sub_assign(&mut self, rhs: Self)
-= operation. Read moreimpl Copy for Vector4u
impl Eq for Vector4u
impl StructuralPartialEq for Vector4u
Auto Trait Implementations§
impl Freeze for Vector4u
impl RefUnwindSafe for Vector4u
impl Send for Vector4u
impl Sync for Vector4u
impl Unpin for Vector4u
impl UnwindSafe for Vector4u
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit)