Struct matmath::game::vec4::Vector4 [−][src]
pub struct Vector4<T> { pub x: T, pub y: T, pub z: T, pub w: T, }
Fields
x: T
y: T
z: T
w: T
Methods
impl<T> Vector4<T>
[src]
impl<T> Vector4<T>
pub fn new(x: T, y: T, z: T, w: T) -> Self
[src]
pub fn new(x: T, y: T, z: T, w: T) -> Self
pub fn scaled<U, O>(self, scalar: U) -> Vector4<O> where
T: Mul<U, Output = O>,
U: Clone,
[src]
pub fn scaled<U, O>(self, scalar: U) -> Vector4<O> where
T: Mul<U, Output = O>,
U: Clone,
Multiplies the vector with a scalar
pub fn zip<U>(self, other: Vector4<U>) -> Vector4<(T, U)>
[src]
pub fn zip<U>(self, other: Vector4<U>) -> Vector4<(T, U)>
pub fn map<F, U>(self, f: F) -> Vector4<U> where
F: Fn(T) -> U,
[src]
pub fn map<F, U>(self, f: F) -> Vector4<U> where
F: Fn(T) -> U,
Applies a function to every element of the vector
Trait Implementations
impl<T: Debug> Debug for Vector4<T>
[src]
impl<T: Debug> Debug for Vector4<T>
fn fmt(&self, f: &mut Formatter) -> Result
[src]
fn fmt(&self, f: &mut Formatter) -> Result
Formats the value using the given formatter. Read more
impl<T: Clone> Clone for Vector4<T>
[src]
impl<T: Clone> Clone for Vector4<T>
fn clone(&self) -> Vector4<T>
[src]
fn clone(&self) -> Vector4<T>
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
impl<T: PartialEq> PartialEq for Vector4<T>
[src]
impl<T: PartialEq> PartialEq for Vector4<T>
fn eq(&self, other: &Vector4<T>) -> bool
[src]
fn eq(&self, other: &Vector4<T>) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, other: &Vector4<T>) -> bool
[src]
fn ne(&self, other: &Vector4<T>) -> bool
This method tests for !=
.
impl<T: Eq> Eq for Vector4<T>
[src]
impl<T: Eq> Eq for Vector4<T>
impl<T> Display for Vector4<T> where
T: Display + Clone,
[src]
impl<T> Display for Vector4<T> where
T: Display + Clone,
fn fmt(&self, f: &mut Formatter) -> Result
[src]
fn fmt(&self, f: &mut Formatter) -> Result
Formats the value using the given formatter. Read more
impl<T> Into<Matrix<T>> for Vector4<T>
[src]
impl<T> Into<Matrix<T>> for Vector4<T>
impl<T> From<Matrix<T>> for Vector4<T> where
T: Clone,
[src]
impl<T> From<Matrix<T>> for Vector4<T> where
T: Clone,
impl<T> Into<Vector<T>> for Vector4<T>
[src]
impl<T> Into<Vector<T>> for Vector4<T>
impl<T> From<Vector<T>> for Vector4<T> where
T: Clone,
[src]
impl<T> From<Vector<T>> for Vector4<T> where
T: Clone,
impl<T> Into<(T, T, T, T)> for Vector4<T>
[src]
impl<T> Into<(T, T, T, T)> for Vector4<T>
impl<T> From<(T, T, T, T)> for Vector4<T>
[src]
impl<T> From<(T, T, T, T)> for Vector4<T>
impl<T, U, O> Add<Vector4<U>> for Vector4<T> where
T: Add<U, Output = O>,
[src]
impl<T, U, O> Add<Vector4<U>> for Vector4<T> where
T: Add<U, Output = O>,
Adds two vectors element by element
type Output = Vector4<O>
The resulting type after applying the +
operator.
fn add(self, rhs: Vector4<U>) -> Vector4<O>
[src]
fn add(self, rhs: Vector4<U>) -> Vector4<O>
Performs the +
operation.
impl<T, U, O> Sub<Vector4<U>> for Vector4<T> where
T: Sub<U, Output = O>,
[src]
impl<T, U, O> Sub<Vector4<U>> for Vector4<T> where
T: Sub<U, Output = O>,
Subtracts two vectors element by element
type Output = Vector4<O>
The resulting type after applying the -
operator.
fn sub(self, rhs: Vector4<U>) -> Vector4<O>
[src]
fn sub(self, rhs: Vector4<U>) -> Vector4<O>
Performs the -
operation.
impl<T, O> Neg for Vector4<T> where
T: Neg<Output = O>,
[src]
impl<T, O> Neg for Vector4<T> where
T: Neg<Output = O>,
type Output = Vector4<O>
The resulting type after applying the -
operator.
fn neg(self) -> Vector4<O>
[src]
fn neg(self) -> Vector4<O>
Performs the unary -
operation.
impl<T, U, O> Rem<U> for Vector4<T> where
T: Rem<U, Output = O>,
U: Clone,
[src]
impl<T, U, O> Rem<U> for Vector4<T> where
T: Rem<U, Output = O>,
U: Clone,
type Output = Vector4<O>
The resulting type after applying the %
operator.
fn rem(self, rhs: U) -> Vector4<O>
[src]
fn rem(self, rhs: U) -> Vector4<O>
Performs the %
operation.
impl<T, U, O> BitAnd<U> for Vector4<T> where
T: BitAnd<U, Output = O>,
U: Clone,
[src]
impl<T, U, O> BitAnd<U> for Vector4<T> where
T: BitAnd<U, Output = O>,
U: Clone,
type Output = Vector4<O>
The resulting type after applying the &
operator.
fn bitand(self, rhs: U) -> Vector4<O>
[src]
fn bitand(self, rhs: U) -> Vector4<O>
Performs the &
operation.
impl<T, U, O> BitOr<U> for Vector4<T> where
T: BitOr<U, Output = O>,
U: Clone,
[src]
impl<T, U, O> BitOr<U> for Vector4<T> where
T: BitOr<U, Output = O>,
U: Clone,
type Output = Vector4<O>
The resulting type after applying the |
operator.
fn bitor(self, rhs: U) -> Vector4<O>
[src]
fn bitor(self, rhs: U) -> Vector4<O>
Performs the |
operation.
impl<T, U, O> BitXor<U> for Vector4<T> where
T: BitXor<U, Output = O>,
U: Clone,
[src]
impl<T, U, O> BitXor<U> for Vector4<T> where
T: BitXor<U, Output = O>,
U: Clone,
type Output = Vector4<O>
The resulting type after applying the ^
operator.
fn bitxor(self, rhs: U) -> Vector4<O>
[src]
fn bitxor(self, rhs: U) -> Vector4<O>
Performs the ^
operation.
impl<T, O> Not for Vector4<T> where
T: Not<Output = O>,
[src]
impl<T, O> Not for Vector4<T> where
T: Not<Output = O>,
type Output = Vector4<O>
The resulting type after applying the !
operator.
fn not(self) -> Vector4<O>
[src]
fn not(self) -> Vector4<O>
Performs the unary !
operation.
impl<T, U, O> Shl<U> for Vector4<T> where
T: Shl<U, Output = O>,
U: Clone,
[src]
impl<T, U, O> Shl<U> for Vector4<T> where
T: Shl<U, Output = O>,
U: Clone,
type Output = Vector4<O>
The resulting type after applying the <<
operator.
fn shl(self, rhs: U) -> Vector4<O>
[src]
fn shl(self, rhs: U) -> Vector4<O>
Performs the <<
operation.
impl<T, U, O> Shr<U> for Vector4<T> where
T: Shr<U, Output = O>,
U: Clone,
[src]
impl<T, U, O> Shr<U> for Vector4<T> where
T: Shr<U, Output = O>,
U: Clone,