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