Struct fixed_vectors::Vector4
source · [−]pub struct Vector4<T> {
pub x: T,
pub y: T,
pub z: T,
pub w: T,
}Expand description
Vector Struct for representing a four-dimensional value.
Fields
x: TRepresents the first dimensional value.
y: TRepresents the second dimensional value.
z: TRepresents the third dimensional value.
w: TRepresents the fourth dimensional value.
Implementations
sourceimpl<T> Vector4<T>
impl<T> Vector4<T>
Trait Implementations
sourceimpl<T: Add<Output = T> + Copy> AddAssign<Vector4<T>> for Vector4<T>
impl<T: Add<Output = T> + Copy> AddAssign<Vector4<T>> for Vector4<T>
sourcefn add_assign(&mut self, other: Self)
fn add_assign(&mut self, other: Self)
Performs the += operation. Read more
sourceimpl<T: BitAnd<Output = T> + Copy> BitAndAssign<Vector4<T>> for Vector4<T>
impl<T: BitAnd<Output = T> + Copy> BitAndAssign<Vector4<T>> for Vector4<T>
sourcefn bitand_assign(&mut self, other: Self)
fn bitand_assign(&mut self, other: Self)
Performs the &= operation. Read more
sourceimpl<T: BitOr<Output = T> + Copy> BitOrAssign<Vector4<T>> for Vector4<T>
impl<T: BitOr<Output = T> + Copy> BitOrAssign<Vector4<T>> for Vector4<T>
sourcefn bitor_assign(&mut self, other: Self)
fn bitor_assign(&mut self, other: Self)
Performs the |= operation. Read more
sourceimpl<T: BitXor<Output = T> + Copy> BitXorAssign<Vector4<T>> for Vector4<T>
impl<T: BitXor<Output = T> + Copy> BitXorAssign<Vector4<T>> for Vector4<T>
sourcefn bitxor_assign(&mut self, other: Self)
fn bitxor_assign(&mut self, other: Self)
Performs the ^= operation. Read more
sourceimpl<T: Div<Output = T> + Copy> DivAssign<Vector4<T>> for Vector4<T>
impl<T: Div<Output = T> + Copy> DivAssign<Vector4<T>> for Vector4<T>
sourcefn div_assign(&mut self, other: Self)
fn div_assign(&mut self, other: Self)
Performs the /= operation. Read more
sourceimpl<T: Float> FloatingPointVector<T, 4_usize> for Vector4<T>
impl<T: Float> FloatingPointVector<T, 4_usize> for Vector4<T>
sourcefn zero(self) -> Self
fn zero(self) -> Self
Converts all numbers within the FloatingPointVector to zero. Read more
sourcefn floor(self) -> Self
fn floor(self) -> Self
Converts all numbers within the FloatingPointVector to the largest integer less than or equal to the value. Read more
sourcefn ceil(self) -> Self
fn ceil(self) -> Self
Converts all numbers within the FloatingPointVector to the largest integer greater than or equal to the value. Read more
sourcefn round(self) -> Self
fn round(self) -> Self
Converts all numbers within the FloatingPointVector to the nearest integer. Read more
sourcefn abs(self) -> Self
fn abs(self) -> Self
Converts all numbers within the FloatingPointVector to their absolute value. Read more
sourcefn powi(self, n: i32) -> Self
fn powi(self, n: i32) -> Self
Raises all numbers within the FloatingPointVector to an integer power. Read more
sourcefn powf(self, n: T) -> Self
fn powf(self, n: T) -> Self
Raises all numbers within the FloatingPointVector to a floating point power. Read more
sourcefn trunc(self) -> Self
fn trunc(self) -> Self
Sets all numbers within the FloatingPointVector to their integer parts. Read more
sourcefn fract(self) -> Self
fn fract(self) -> Self
Sets all numbers within the FloatingPointVector to their fractional parts. Read more
sourcefn sqrt(self) -> Self
fn sqrt(self) -> Self
Sets all numbers within the FloatingPointVector to their square-root. Read more
sourcefn normalized(self) -> Self
fn normalized(self) -> Self
Normalizes the FloatingPointVector. Read more
sourcefn lerp(self, to: Self, weight: T) -> Self
fn lerp(self, to: Self, weight: T) -> Self
Linearly interpolates between two FloatingPointVectors by a normalized weight. Read more
sourcefn dot(self, b: Self) -> T
fn dot(self, b: Self) -> T
Returns the dot product of two FloatingPointVectors,
this can be used to compare the angle between two FloatingPointVectors. Read more
sourcefn length_squared(self) -> T
fn length_squared(self) -> T
Returns the squared magnitude of the FloatingPointVector.
This will always run faster than [length], this method should prefered over it if applicable. Read more
sourcefn length(self) -> T where
Self: Sized,
fn length(self) -> T where
Self: Sized,
Returns the magnitude of the FloatingPointVector. Read more
sourceimpl<T: PrimInt> IntegerVector<T, 4_usize> for Vector4<T>
impl<T: PrimInt> IntegerVector<T, 4_usize> for Vector4<T>
sourcefn pow(self, n: u32) -> Self
fn pow(self, n: u32) -> Self
Raises all numbers within the IntegerVector to the specified power. Read more
sourceimpl<T> IntoIterator for Vector4<T>
impl<T> IntoIterator for Vector4<T>
sourceimpl<T: Mul<Output = T> + Copy> MulAssign<Vector4<T>> for Vector4<T>
impl<T: Mul<Output = T> + Copy> MulAssign<Vector4<T>> for Vector4<T>
sourcefn mul_assign(&mut self, other: Self)
fn mul_assign(&mut self, other: Self)
Performs the *= operation. Read more
sourceimpl<T: Rem<Output = T> + Copy> RemAssign<Vector4<T>> for Vector4<T>
impl<T: Rem<Output = T> + Copy> RemAssign<Vector4<T>> for Vector4<T>
sourcefn rem_assign(&mut self, other: Self)
fn rem_assign(&mut self, other: Self)
Performs the %= operation. Read more
sourceimpl<T: Sub<Output = T> + Copy> SubAssign<Vector4<T>> for Vector4<T>
impl<T: Sub<Output = T> + Copy> SubAssign<Vector4<T>> for Vector4<T>
sourcefn sub_assign(&mut self, other: Self)
fn sub_assign(&mut self, other: Self)
Performs the -= operation. Read more
sourceimpl<T> TuplableVector<T, { Vector4::<()>::LEN }> for Vector4<T>
impl<T> TuplableVector<T, { Vector4::<()>::LEN }> for Vector4<T>
sourceimpl<T> Vector<T, 4_usize> for Vector4<T>
impl<T> Vector<T, 4_usize> for Vector4<T>
impl<T: Copy> Copy for Vector4<T>
impl<T: Eq> Eq for Vector4<T>
Auto Trait Implementations
impl<T> RefUnwindSafe for Vector4<T> where
T: RefUnwindSafe,
impl<T> Send for Vector4<T> where
T: Send,
impl<T> Sync for Vector4<T> where
T: Sync,
impl<T> Unpin for Vector4<T> where
T: Unpin,
impl<T> UnwindSafe for Vector4<T> where
T: UnwindSafe,
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