Struct coord::vec4::Vec4[][src]

pub struct Vec4<T: VecItem> {
    pub x: T,
    pub y: T,
    pub z: T,
    pub w: T,
}

Fields

Methods

impl<T: VecItem> Vec4<T>
[src]

Creates a new Vec3 from multiple components

Returns the elements of the vector as an array

Apply an operation to all elements of this vector, returning the result

Trait Implementations

impl<T: Copy + VecItem> Copy for Vec4<T>
[src]

impl<T: Clone + VecItem> Clone for Vec4<T>
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl<T: Default + VecItem> Default for Vec4<T>
[src]

Returns the "default value" for a type. Read more

impl<T: Hash + VecItem> Hash for Vec4<T>
[src]

Feeds this value into the given [Hasher]. Read more

Feeds a slice of this type into the given [Hasher]. Read more

impl<T: Eq + VecItem> Eq for Vec4<T>
[src]

impl<T: PartialEq + VecItem> PartialEq for Vec4<T>
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

impl<T: VecItem> Vector for Vec4<T>
[src]

impl<T: VecItem + Debug> Debug for Vec4<T>
[src]

Formats the value using the given formatter. Read more

impl<T: VecItem + Display> Display for Vec4<T>
[src]

Formats the value using the given formatter. Read more

impl<T: VecItem> From<[T; 4]> for Vec4<T>
[src]

Performs the conversion.

impl<T: VecItem> From<(T, T, T, T)> for Vec4<T>
[src]

Performs the conversion.

impl<T> Add for Vec4<T> where
    T: VecItem + Add,
    T::Output: VecItem + Add
[src]

The resulting type after applying the + operator.

Performs the + operation.

impl<T> Sub for Vec4<T> where
    T: VecItem + Sub,
    T::Output: VecItem + Sub
[src]

The resulting type after applying the - operator.

Performs the - operation.

impl<T> Mul for Vec4<T> where
    T: VecItem + Mul,
    T::Output: VecItem + Mul
[src]

The resulting type after applying the * operator.

Performs the * operation.

impl<T> Div for Vec4<T> where
    T: VecItem + Div,
    T::Output: VecItem + Div
[src]

The resulting type after applying the / operator.

Performs the / operation.

impl<T> Add<T> for Vec4<T> where
    T: VecItem + Add,
    T::Output: VecItem + Add
[src]

The resulting type after applying the + operator.

Performs the + operation.

impl<T> Sub<T> for Vec4<T> where
    T: VecItem + Sub,
    T::Output: VecItem + Sub
[src]

The resulting type after applying the - operator.

Performs the - operation.

impl<T> Mul<T> for Vec4<T> where
    T: VecItem + Mul,
    T::Output: VecItem + Mul
[src]

The resulting type after applying the * operator.

Performs the * operation.

impl<T> Div<T> for Vec4<T> where
    T: VecItem + Div,
    T::Output: VecItem + Div
[src]

The resulting type after applying the / operator.

Performs the / operation.

impl<T> AddAssign for Vec4<T> where
    T: VecItem + Add<Output = T>, 
[src]

Performs the += operation.

impl<T> SubAssign for Vec4<T> where
    T: VecItem + Sub<Output = T>, 
[src]

Performs the -= operation.

impl<T> MulAssign for Vec4<T> where
    T: VecItem + Mul<Output = T>, 
[src]

Performs the *= operation.

impl<T> DivAssign for Vec4<T> where
    T: VecItem + Div<Output = T>, 
[src]

Performs the /= operation.

impl<T> AddAssign<T> for Vec4<T> where
    T: VecItem + Add<Output = T>, 
[src]

Performs the += operation.

impl<T> SubAssign<T> for Vec4<T> where
    T: VecItem + Sub<Output = T>, 
[src]

Performs the -= operation.

impl<T> MulAssign<T> for Vec4<T> where
    T: VecItem + Mul<Output = T>, 
[src]

Performs the *= operation.

impl<T> DivAssign<T> for Vec4<T> where
    T: VecItem + Div<Output = T>, 
[src]

Performs the /= operation.

impl<T> VecNum for Vec4<T> where
    T: VecItem + Num
[src]

Calculates the sum of all components of the vector

Calculates the produce of all components of the vector

impl<T> VecInt for Vec4<T> where
    T: VecItem + Integer
[src]

Performs a Eucledian division (i.e: rounds towards negative infinity) operation upon the vector

impl<T> VecSigned for Vec4<T> where
    T: VecItem + Signed
[src]

Calculates the snake length (also known as 'manhattan distance') of the vector Read more

impl<T> VecFloat for Vec4<T> where
    T: VecItem + Float
[src]

Calculates the magnitude of the vector

Calculates the normalized form of the vector (i.e: a vector with identical direction but a magnitude of 1)

Rounds each element of the vector down to the nearest whole number

Rounds each element of the vector up to the nearest whole number

Rounds each element of the vector to the nearest whole number

Auto Trait Implementations

impl<T> Send for Vec4<T> where
    T: Send

impl<T> Sync for Vec4<T> where
    T: Sync