Struct glm::Vector4
[−]
[src]
#[repr(C)]pub struct Vector4<T: Primitive> { pub x: T, pub y: T, pub z: T, pub w: T, }
Fields
x: T
y: T
z: T
w: T
Methods
impl<T: Primitive> Vector4<T>[src]
impl<T: Primitive> Vector4<T>pub fn new(x: T, y: T, z: T, w: T) -> Vector4<T>[src]
pub fn new(x: T, y: T, z: T, w: T) -> Vector4<T>pub fn from_array(ary: &[T; 4]) -> &Vector4<T>[src]
pub fn from_array(ary: &[T; 4]) -> &Vector4<T>pub fn from_array_mut(ary: &mut [T; 4]) -> &mut Vector4<T>[src]
pub fn from_array_mut(ary: &mut [T; 4]) -> &mut Vector4<T>pub fn as_array(&self) -> &[T; 4][src]
pub fn as_array(&self) -> &[T; 4]pub fn as_array_mut(&mut self) -> &mut [T; 4][src]
pub fn as_array_mut(&mut self) -> &mut [T; 4]impl<T: Primitive> Vector4<T>[src]
impl<T: Primitive> Vector4<T>pub fn truncate(&self, i: usize) -> Vector3<T>[src]
pub fn truncate(&self, i: usize) -> Vector3<T>Truncates self to a Vector3 by remove the ith element.
Parameter i is 0 based index.
Panic
It is a panic if i is larger than 3.
Trait Implementations
impl<T: Copy + Primitive> Copy for Vector4<T>[src]
impl<T: Copy + Primitive> Copy for Vector4<T>impl<T: Clone + Primitive> Clone for Vector4<T>[src]
impl<T: Clone + Primitive> 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 + Primitive> PartialEq for Vector4<T>[src]
impl<T: PartialEq + Primitive> PartialEq for Vector4<T>fn eq(&self, __arg_0: &Vector4<T>) -> bool[src]
fn eq(&self, __arg_0: &Vector4<T>) -> boolThis method tests for self and other values to be equal, and is used by ==. Read more
fn ne(&self, __arg_0: &Vector4<T>) -> bool[src]
fn ne(&self, __arg_0: &Vector4<T>) -> boolThis method tests for !=.
impl<T: Debug + Primitive> Debug for Vector4<T>[src]
impl<T: Debug + Primitive> Debug for Vector4<T>fn fmt(&self, __arg_0: &mut Formatter) -> Result[src]
fn fmt(&self, __arg_0: &mut Formatter) -> ResultFormats the value using the given formatter. Read more
impl<T: Primitive> GenVec<T> for Vector4<T>[src]
impl<T: Primitive> GenVec<T> for Vector4<T>impl<T: Primitive> Index<usize> for Vector4<T>[src]
impl<T: Primitive> Index<usize> for Vector4<T>type Output = T
The returned type after indexing.
fn index<'a>(&'a self, i: usize) -> &'a T[src]
fn index<'a>(&'a self, i: usize) -> &'a TPerforms the indexing (container[index]) operation.
impl<T: Primitive> IndexMut<usize> for Vector4<T>[src]
impl<T: Primitive> IndexMut<usize> for Vector4<T>fn index_mut<'a>(&'a mut self, i: usize) -> &'a mut T[src]
fn index_mut<'a>(&'a mut self, i: usize) -> &'a mut TPerforms the mutable indexing (container[index]) operation.
impl<T: Primitive> Rand for Vector4<T>[src]
impl<T: Primitive> Rand for Vector4<T>fn rand<R: Rng>(rng: &mut R) -> Vector4<T>[src]
fn rand<R: Rng>(rng: &mut R) -> Vector4<T>Generates a random instance of this type using the specified source of randomness. Read more
impl<T: Primitive + Arbitrary> Arbitrary for Vector4<T>[src]
impl<T: Primitive + Arbitrary> Arbitrary for Vector4<T>fn arbitrary<G: Gen>(g: &mut G) -> Vector4<T>[src]
fn arbitrary<G: Gen>(g: &mut G) -> Vector4<T>fn shrink(&self) -> Box<Iterator<Item = Self> + 'static>[src]
fn shrink(&self) -> Box<Iterator<Item = Self> + 'static>impl Eq for Vector4<bool>[src]
impl Eq for Vector4<bool>impl GenBVec for Vector4<bool>[src]
impl GenBVec for Vector4<bool>fn all(&self) -> bool[src]
fn all(&self) -> boolReturns true if all components of the receiver are true. Read more
fn any(&self) -> bool[src]
fn any(&self) -> boolReturns true if there is any component of the receiver is true. Read more
fn not(&self) -> Vector4<bool>[src]
fn not(&self) -> Vector4<bool>Returns the component-wise logical complement of the receiver. Read more
impl<T: BaseNum> Add<Vector4<T>> for Vector4<T>[src]
impl<T: BaseNum> Add<Vector4<T>> for Vector4<T>type Output = Vector4<T>
The resulting type after applying the + operator.
fn add(self, rhs: Vector4<T>) -> Vector4<T>[src]
fn add(self, rhs: Vector4<T>) -> Vector4<T>Performs the + operation.
impl<T: BaseNum> Add<T> for Vector4<T>[src]
impl<T: BaseNum> Add<T> for Vector4<T>type Output = Vector4<T>
The resulting type after applying the + operator.
fn add(self, rhs: T) -> Vector4<T>[src]
fn add(self, rhs: T) -> Vector4<T>Performs the + operation.
impl<T: BaseNum> Mul<Vector4<T>> for Vector4<T>[src]
impl<T: BaseNum> Mul<Vector4<T>> for Vector4<T>type Output = Vector4<T>
The resulting type after applying the * operator.
fn mul(self, rhs: Vector4<T>) -> Vector4<T>[src]
fn mul(self, rhs: Vector4<T>) -> Vector4<T>Performs the * operation.
impl<T: BaseNum> Mul<T> for Vector4<T>[src]
impl<T: BaseNum> Mul<T> for Vector4<T>type Output = Vector4<T>
The resulting type after applying the * operator.
fn mul(self, rhs: T) -> Vector4<T>[src]
fn mul(self, rhs: T) -> Vector4<T>Performs the * operation.
impl<T: BaseNum> Div<Vector4<T>> for Vector4<T>[src]
impl<T: BaseNum> Div<Vector4<T>> for Vector4<T>type Output = Vector4<T>
The resulting type after applying the / operator.
fn div(self, rhs: Vector4<T>) -> Vector4<T>[src]
fn div(self, rhs: Vector4<T>) -> Vector4<T>Performs the / operation.
impl<T: BaseNum> Div<T> for Vector4<T>[src]
impl<T: BaseNum> Div<T> for Vector4<T>type Output = Vector4<T>
The resulting type after applying the / operator.
fn div(self, rhs: T) -> Vector4<T>[src]
fn div(self, rhs: T) -> Vector4<T>Performs the / operation.
impl<T: BaseNum> Rem<Vector4<T>> for Vector4<T>[src]
impl<T: BaseNum> Rem<Vector4<T>> for Vector4<T>type Output = Vector4<T>
The resulting type after applying the % operator.
fn rem(self, rhs: Vector4<T>) -> Vector4<T>[src]
fn rem(self, rhs: Vector4<T>) -> Vector4<T>Performs the % operation.
impl<T: BaseNum> Rem<T> for Vector4<T>[src]
impl<T: BaseNum> Rem<T> for Vector4<T>type Output = Vector4<T>
The resulting type after applying the % operator.
fn rem(self, rhs: T) -> Vector4<T>[src]
fn rem(self, rhs: T) -> Vector4<T>Performs the % operation.
impl<T: BaseNum> One for Vector4<T>[src]
impl<T: BaseNum> One for Vector4<T>fn one() -> Vector4<T>[src]
fn one() -> Vector4<T>Returns the multiplicative identity element of Self, 1. Read more
fn is_one(&self) -> bool where
Self: PartialEq<Self>, [src]
fn is_one(&self) -> bool where
Self: PartialEq<Self>, Returns true if self is equal to the multiplicative identity. Read more
impl<T: BaseNum> Zero for Vector4<T>[src]
impl<T: BaseNum> Zero for Vector4<T>fn zero() -> Vector4<T>[src]
fn zero() -> Vector4<T>Returns the additive identity element of Self, 0. Read more
fn is_zero(&self) -> bool[src]
fn is_zero(&self) -> boolReturns true if self is equal to the additive identity.
impl<T: BaseNum> GenNum<T> for Vector4<T>[src]
impl<T: BaseNum> GenNum<T> for Vector4<T>fn from_s(x: T) -> Self[src]
fn from_s(x: T) -> SelfConstructs from a scalar number.
fn map<F: Fn(T) -> T>(self, f: F) -> Vector4<T>[src]
fn map<F: Fn(T) -> T>(self, f: F) -> Vector4<T>fn zip<F: Fn(T, T) -> T>(self, y: Vector4<T>, f: F) -> Vector4<T>[src]
fn zip<F: Fn(T, T) -> T>(self, y: Vector4<T>, f: F) -> Vector4<T>fn split<F: Fn(T) -> (T, T)>(self, f: F) -> (Vector4<T>, Vector4<T>)[src]
fn split<F: Fn(T) -> (T, T)>(self, f: F) -> (Vector4<T>, Vector4<T>)fn map2<F: Fn(T, T) -> (T, T)>(self, y: Self, f: F) -> (Self, Self)[src]
fn map2<F: Fn(T, T) -> (T, T)>(self, y: Self, f: F) -> (Self, Self)impl<T: BaseNum> GenNumVec<T> for Vector4<T>[src]
impl<T: BaseNum> GenNumVec<T> for Vector4<T>fn sum(&self) -> T[src]
fn sum(&self) -> TReturns the sum of all components. # Example Read more
fn product(&self) -> T[src]
fn product(&self) -> TMultiplies all components. Read more
fn min(&self) -> T[src]
fn min(&self) -> TReturns the minimal value of all components. Read more
fn max(&self) -> T[src]
fn max(&self) -> TReturns the maximal value of all components. Read more
impl<T: SignedNum + BaseNum> Neg for Vector4<T>[src]
impl<T: SignedNum + BaseNum> Neg for Vector4<T>type Output = Vector4<T>
The resulting type after applying the - operator.
fn neg(self) -> Vector4<T>[src]
fn neg(self) -> Vector4<T>Performs the unary - operation.
impl<T: SignedNum + BaseNum> Sub<Vector4<T>> for Vector4<T>[src]
impl<T: SignedNum + BaseNum> Sub<Vector4<T>> for Vector4<T>type Output = Vector4<T>
The resulting type after applying the - operator.
fn sub(self, rhs: Vector4<T>) -> Vector4<T>[src]
fn sub(self, rhs: Vector4<T>) -> Vector4<T>Performs the - operation.
impl<T: SignedNum + BaseNum> Sub<T> for Vector4<T>[src]
impl<T: SignedNum + BaseNum> Sub<T> for Vector4<T>type Output = Vector4<T>
The resulting type after applying the - operator.
fn sub(self, rhs: T) -> Vector4<T>[src]
fn sub(self, rhs: T) -> Vector4<T>Performs the - operation.
impl<T: SignedNum + BaseNum> SignedNum for Vector4<T>[src]
impl<T: SignedNum + BaseNum> SignedNum for Vector4<T>fn abs(&self) -> Vector4<T>[src]
fn abs(&self) -> Vector4<T>Returns the absolute value of the receiver.
fn sign(&self) -> Vector4<T>[src]
fn sign(&self) -> Vector4<T>Returns the sign number of the receiver. Read more
impl<T: BaseInt> Eq for Vector4<T>[src]
impl<T: BaseInt> Eq for Vector4<T>impl<T: BaseInt> Not for Vector4<T>[src]
impl<T: BaseInt> Not for Vector4<T>type Output = Self
The resulting type after applying the ! operator.
fn not(self) -> Self[src]
fn not(self) -> SelfPerforms the unary ! operation.
impl<T: BaseInt> BitAnd<T> for Vector4<T>[src]
impl<T: BaseInt> BitAnd<T> for Vector4<T>type Output = Self
The resulting type after applying the & operator.
fn bitand(self, rhs: T) -> Self[src]
fn bitand(self, rhs: T) -> SelfPerforms the & operation.
impl<T: BaseInt> BitAnd<Vector4<T>> for Vector4<T>[src]
impl<T: BaseInt> BitAnd<Vector4<T>> for Vector4<T>type Output = Self
The resulting type after applying the & operator.
fn bitand(self, rhs: Self) -> Self[src]
fn bitand(self, rhs: Self) -> SelfPerforms the & operation.
impl<T: BaseInt> BitOr<T> for Vector4<T>[src]
impl<T: BaseInt> BitOr<T> for Vector4<T>type Output = Self
The resulting type after applying the | operator.
fn bitor(self, rhs: T) -> Self[src]
fn bitor(self, rhs: T) -> SelfPerforms the | operation.
impl<T: BaseInt> BitOr<Vector4<T>> for Vector4<T>[src]
impl<T: BaseInt> BitOr<Vector4<T>> for Vector4<T>type Output = Self
The resulting type after applying the | operator.
fn bitor(self, rhs: Self) -> Self[src]
fn bitor(self, rhs: Self) -> SelfPerforms the | operation.
impl<T: BaseInt> BitXor<T> for Vector4<T>[src]
impl<T: BaseInt> BitXor<T> for Vector4<T>type Output = Self
The resulting type after applying the ^ operator.
fn bitxor(self, rhs: T) -> Self[src]
fn bitxor(self, rhs: T) -> SelfPerforms the ^ operation.
impl<T: BaseInt> BitXor<Vector4<T>> for Vector4<T>[src]
impl<T: BaseInt> BitXor<Vector4<T>> for Vector4<T>type Output = Self
The resulting type after applying the ^ operator.
fn bitxor(self, rhs: Self) -> Self[src]
fn bitxor(self, rhs: Self) -> SelfPerforms the ^ operation.
impl<T: BaseInt> Shl<usize> for Vector4<T>[src]
impl<T: BaseInt> Shl<usize> for Vector4<T>type Output = Self
The resulting type after applying the << operator.
fn shl(self, rhs: usize) -> Self[src]
fn shl(self, rhs: usize) -> SelfPerforms the << operation.
impl<T: BaseInt> Shr<usize> for Vector4<T>[src]
impl<T: BaseInt> Shr<usize> for Vector4<T>type Output = Self
The resulting type after applying the >> operator.
fn shr(self, rhs: usize) -> Self[src]
fn shr(self, rhs: usize) -> SelfPerforms the >> operation.
impl<T: BaseInt> GenInt<T> for Vector4<T>[src]
impl<T: BaseInt> GenInt<T> for Vector4<T>impl<T: BaseFloat> ApproxEq for Vector4<T>[src]
impl<T: BaseFloat> ApproxEq for Vector4<T>type BaseType = T
fn is_close_to(&self, rhs: &Vector4<T>, max_diff: T) -> bool[src]
fn is_close_to(&self, rhs: &Vector4<T>, max_diff: T) -> boolReturns true if the difference between x and y is less than max_diff. Read more
fn is_approx_eq(&self, rhs: &Self) -> bool[src]
fn is_approx_eq(&self, rhs: &Self) -> boolReturns true if the difference between x and y is less than machine epsilon. Read more
impl<T: BaseFloat> GenFloat<T> for Vector4<T>[src]
impl<T: BaseFloat> GenFloat<T> for Vector4<T>impl<T: BaseFloat> GenFloatVec<T> for Vector4<T>[src]
impl<T: BaseFloat> GenFloatVec<T> for Vector4<T>impl<T: BaseFloat> Mul<Vector4<T>> for Matrix4x2<T>[src]
impl<T: BaseFloat> Mul<Vector4<T>> for Matrix4x2<T>type Output = Vector2<T>
The resulting type after applying the * operator.
fn mul(self, rhs: Vector4<T>) -> Vector2<T>[src]
fn mul(self, rhs: Vector4<T>) -> Vector2<T>Performs the * operation.
impl<T: BaseFloat> Mul<Vector4<T>> for Matrix4x3<T>[src]
impl<T: BaseFloat> Mul<Vector4<T>> for Matrix4x3<T>type Output = Vector3<T>
The resulting type after applying the * operator.
fn mul(self, rhs: Vector4<T>) -> Vector3<T>[src]
fn mul(self, rhs: Vector4<T>) -> Vector3<T>Performs the * operation.
impl<T: BaseFloat> GenMat<T, Vector4<T>> for Matrix2x4<T>[src]
impl<T: BaseFloat> GenMat<T, Vector4<T>> for Matrix2x4<T>type R = Vector2<T>
Type of row vectors.
type Transpose = Matrix4x2<T>
Type of transpose matrix.
fn transpose(&self) -> Matrix4x2<T>[src]
fn transpose(&self) -> Matrix4x2<T>Returns the transpose matrix. Read more
fn mul_c(&self, rhs: &Matrix2x4<T>) -> Matrix2x4<T>[src]
fn mul_c(&self, rhs: &Matrix2x4<T>) -> Matrix2x4<T>Component-wise multiplication. Read more
impl<T: BaseFloat> GenMat<T, Vector4<T>> for Matrix3x4<T>[src]
impl<T: BaseFloat> GenMat<T, Vector4<T>> for Matrix3x4<T>type R = Vector3<T>
Type of row vectors.
type Transpose = Matrix4x3<T>
Type of transpose matrix.
fn transpose(&self) -> Matrix4x3<T>[src]
fn transpose(&self) -> Matrix4x3<T>Returns the transpose matrix. Read more
fn mul_c(&self, rhs: &Matrix3x4<T>) -> Matrix3x4<T>[src]
fn mul_c(&self, rhs: &Matrix3x4<T>) -> Matrix3x4<T>Component-wise multiplication. Read more
impl<T: BaseFloat> Mul<Vector4<T>> for Matrix4<T>[src]
impl<T: BaseFloat> Mul<Vector4<T>> for Matrix4<T>type Output = Vector4<T>
The resulting type after applying the * operator.
fn mul(self, rhs: Vector4<T>) -> Vector4<T>[src]
fn mul(self, rhs: Vector4<T>) -> Vector4<T>Performs the * operation.
impl<T: BaseFloat> GenMat<T, Vector4<T>> for Matrix4<T>[src]
impl<T: BaseFloat> GenMat<T, Vector4<T>> for Matrix4<T>type R = Vector4<T>
Type of row vectors.
type Transpose = Matrix4<T>
Type of transpose matrix.
fn transpose(&self) -> Matrix4<T>[src]
fn transpose(&self) -> Matrix4<T>Returns the transpose matrix. Read more
fn mul_c(&self, rhs: &Matrix4<T>) -> Matrix4<T>[src]
fn mul_c(&self, rhs: &Matrix4<T>) -> Matrix4<T>Component-wise multiplication. Read more
impl<T: BaseFloat> GenSquareMat<T, Vector4<T>> for Matrix4<T>[src]
impl<T: BaseFloat> GenSquareMat<T, Vector4<T>> for Matrix4<T>