Struct glm::Vector2 
                   
                       [−]
                   
               [src]
#[repr(C)]pub struct Vector2<T: Primitive> { pub x: T, pub y: T, }
Fields
x: T
                           
                           
                           
                           y: T
                           
                    Methods
impl<T: Primitive> Vector2<T>[src] 
impl<T: Primitive> Vector2<T>pub fn new(x: T, y: T) -> Vector2<T>[src] 
pub fn new(x: T, y: T) -> Vector2<T>pub fn from_array(ary: &[T; 2]) -> &Vector2<T>[src] 
pub fn from_array(ary: &[T; 2]) -> &Vector2<T>pub fn from_array_mut(ary: &mut [T; 2]) -> &mut Vector2<T>[src] 
pub fn from_array_mut(ary: &mut [T; 2]) -> &mut Vector2<T>pub fn as_array(&self) -> &[T; 2][src] 
pub fn as_array(&self) -> &[T; 2]pub fn as_array_mut(&mut self) -> &mut [T; 2][src] 
pub fn as_array_mut(&mut self) -> &mut [T; 2]impl<T: Primitive> Vector2<T>[src] 
impl<T: Primitive> Vector2<T>pub fn extend(&self, z: T) -> Vector3<T>[src] 
pub fn extend(&self, z: T) -> Vector3<T>Extends self to a Vector3 by appending z.
Example
use glm::*; let v2 = vec2(1., 2.); let v3 = vec3(1., 2., 3.); assert_eq!(v2.extend(3.), v3);
Trait Implementations
impl<T: Copy + Primitive> Copy for Vector2<T>[src] 
impl<T: Copy + Primitive> Copy for Vector2<T>impl<T: Clone + Primitive> Clone for Vector2<T>[src] 
impl<T: Clone + Primitive> Clone for Vector2<T>fn clone(&self) -> Vector2<T>[src] 
fn clone(&self) -> Vector2<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 Vector2<T>[src] 
impl<T: PartialEq + Primitive> PartialEq for Vector2<T>fn eq(&self, __arg_0: &Vector2<T>) -> bool[src] 
fn eq(&self, __arg_0: &Vector2<T>) -> boolThis method tests for self and other values to be equal, and is used by ==. Read more
fn ne(&self, __arg_0: &Vector2<T>) -> bool[src] 
fn ne(&self, __arg_0: &Vector2<T>) -> boolThis method tests for !=.
impl<T: Debug + Primitive> Debug for Vector2<T>[src] 
impl<T: Debug + Primitive> Debug for Vector2<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 Vector2<T>[src] 
impl<T: Primitive> GenVec<T> for Vector2<T>impl<T: Primitive> Index<usize> for Vector2<T>[src] 
impl<T: Primitive> Index<usize> for Vector2<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 Vector2<T>[src] 
impl<T: Primitive> IndexMut<usize> for Vector2<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 Vector2<T>[src] 
impl<T: Primitive> Rand for Vector2<T>fn rand<R: Rng>(rng: &mut R) -> Vector2<T>[src] 
fn rand<R: Rng>(rng: &mut R) -> Vector2<T>Generates a random instance of this type using the specified source of randomness. Read more
impl<T: Primitive + Arbitrary> Arbitrary for Vector2<T>[src] 
impl<T: Primitive + Arbitrary> Arbitrary for Vector2<T>fn arbitrary<G: Gen>(g: &mut G) -> Vector2<T>[src] 
fn arbitrary<G: Gen>(g: &mut G) -> Vector2<T>fn shrink(&self) -> Box<Iterator<Item = Self> + 'static>[src] 
fn shrink(&self) -> Box<Iterator<Item = Self> + 'static>impl Eq for Vector2<bool>[src] 
impl Eq for Vector2<bool>impl GenBVec for Vector2<bool>[src] 
impl GenBVec for Vector2<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) -> Vector2<bool>[src] 
fn not(&self) -> Vector2<bool>Returns the component-wise logical complement of the receiver. Read more
impl<T: BaseNum> Add<Vector2<T>> for Vector2<T>[src] 
impl<T: BaseNum> Add<Vector2<T>> for Vector2<T>type Output = Vector2<T>
The resulting type after applying the + operator.
fn add(self, rhs: Vector2<T>) -> Vector2<T>[src] 
fn add(self, rhs: Vector2<T>) -> Vector2<T>Performs the + operation.
impl<T: BaseNum> Add<T> for Vector2<T>[src] 
impl<T: BaseNum> Add<T> for Vector2<T>type Output = Vector2<T>
The resulting type after applying the + operator.
fn add(self, rhs: T) -> Vector2<T>[src] 
fn add(self, rhs: T) -> Vector2<T>Performs the + operation.
impl<T: BaseNum> Mul<Vector2<T>> for Vector2<T>[src] 
impl<T: BaseNum> Mul<Vector2<T>> for Vector2<T>type Output = Vector2<T>
The resulting type after applying the * operator.
fn mul(self, rhs: Vector2<T>) -> Vector2<T>[src] 
fn mul(self, rhs: Vector2<T>) -> Vector2<T>Performs the * operation.
impl<T: BaseNum> Mul<T> for Vector2<T>[src] 
impl<T: BaseNum> Mul<T> for Vector2<T>type Output = Vector2<T>
The resulting type after applying the * operator.
fn mul(self, rhs: T) -> Vector2<T>[src] 
fn mul(self, rhs: T) -> Vector2<T>Performs the * operation.
impl<T: BaseNum> Div<Vector2<T>> for Vector2<T>[src] 
impl<T: BaseNum> Div<Vector2<T>> for Vector2<T>type Output = Vector2<T>
The resulting type after applying the / operator.
fn div(self, rhs: Vector2<T>) -> Vector2<T>[src] 
fn div(self, rhs: Vector2<T>) -> Vector2<T>Performs the / operation.
impl<T: BaseNum> Div<T> for Vector2<T>[src] 
impl<T: BaseNum> Div<T> for Vector2<T>type Output = Vector2<T>
The resulting type after applying the / operator.
fn div(self, rhs: T) -> Vector2<T>[src] 
fn div(self, rhs: T) -> Vector2<T>Performs the / operation.
impl<T: BaseNum> Rem<Vector2<T>> for Vector2<T>[src] 
impl<T: BaseNum> Rem<Vector2<T>> for Vector2<T>type Output = Vector2<T>
The resulting type after applying the % operator.
fn rem(self, rhs: Vector2<T>) -> Vector2<T>[src] 
fn rem(self, rhs: Vector2<T>) -> Vector2<T>Performs the % operation.
impl<T: BaseNum> Rem<T> for Vector2<T>[src] 
impl<T: BaseNum> Rem<T> for Vector2<T>type Output = Vector2<T>
The resulting type after applying the % operator.
fn rem(self, rhs: T) -> Vector2<T>[src] 
fn rem(self, rhs: T) -> Vector2<T>Performs the % operation.
impl<T: BaseNum> One for Vector2<T>[src] 
impl<T: BaseNum> One for Vector2<T>fn one() -> Vector2<T>[src] 
fn one() -> Vector2<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 Vector2<T>[src] 
impl<T: BaseNum> Zero for Vector2<T>fn zero() -> Vector2<T>[src] 
fn zero() -> Vector2<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 Vector2<T>[src] 
impl<T: BaseNum> GenNum<T> for Vector2<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) -> Vector2<T>[src] 
fn map<F: Fn(T) -> T>(self, f: F) -> Vector2<T>fn zip<F: Fn(T, T) -> T>(self, y: Vector2<T>, f: F) -> Vector2<T>[src] 
fn zip<F: Fn(T, T) -> T>(self, y: Vector2<T>, f: F) -> Vector2<T>fn split<F: Fn(T) -> (T, T)>(self, f: F) -> (Vector2<T>, Vector2<T>)[src] 
fn split<F: Fn(T) -> (T, T)>(self, f: F) -> (Vector2<T>, Vector2<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 Vector2<T>[src] 
impl<T: BaseNum> GenNumVec<T> for Vector2<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 Vector2<T>[src] 
impl<T: SignedNum + BaseNum> Neg for Vector2<T>type Output = Vector2<T>
The resulting type after applying the - operator.
fn neg(self) -> Vector2<T>[src] 
fn neg(self) -> Vector2<T>Performs the unary - operation.
impl<T: SignedNum + BaseNum> Sub<Vector2<T>> for Vector2<T>[src] 
impl<T: SignedNum + BaseNum> Sub<Vector2<T>> for Vector2<T>type Output = Vector2<T>
The resulting type after applying the - operator.
fn sub(self, rhs: Vector2<T>) -> Vector2<T>[src] 
fn sub(self, rhs: Vector2<T>) -> Vector2<T>Performs the - operation.
impl<T: SignedNum + BaseNum> Sub<T> for Vector2<T>[src] 
impl<T: SignedNum + BaseNum> Sub<T> for Vector2<T>type Output = Vector2<T>
The resulting type after applying the - operator.
fn sub(self, rhs: T) -> Vector2<T>[src] 
fn sub(self, rhs: T) -> Vector2<T>Performs the - operation.
impl<T: SignedNum + BaseNum> SignedNum for Vector2<T>[src] 
impl<T: SignedNum + BaseNum> SignedNum for Vector2<T>fn abs(&self) -> Vector2<T>[src] 
fn abs(&self) -> Vector2<T>Returns the absolute value of the receiver.
fn sign(&self) -> Vector2<T>[src] 
fn sign(&self) -> Vector2<T>Returns the sign number of the receiver. Read more
impl<T: BaseInt> Eq for Vector2<T>[src] 
impl<T: BaseInt> Eq for Vector2<T>impl<T: BaseInt> Not for Vector2<T>[src] 
impl<T: BaseInt> Not for Vector2<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 Vector2<T>[src] 
impl<T: BaseInt> BitAnd<T> for Vector2<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<Vector2<T>> for Vector2<T>[src] 
impl<T: BaseInt> BitAnd<Vector2<T>> for Vector2<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 Vector2<T>[src] 
impl<T: BaseInt> BitOr<T> for Vector2<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<Vector2<T>> for Vector2<T>[src] 
impl<T: BaseInt> BitOr<Vector2<T>> for Vector2<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 Vector2<T>[src] 
impl<T: BaseInt> BitXor<T> for Vector2<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<Vector2<T>> for Vector2<T>[src] 
impl<T: BaseInt> BitXor<Vector2<T>> for Vector2<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 Vector2<T>[src] 
impl<T: BaseInt> Shl<usize> for Vector2<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 Vector2<T>[src] 
impl<T: BaseInt> Shr<usize> for Vector2<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 Vector2<T>[src] 
impl<T: BaseInt> GenInt<T> for Vector2<T>impl<T: BaseFloat> ApproxEq for Vector2<T>[src] 
impl<T: BaseFloat> ApproxEq for Vector2<T>type BaseType = T
fn is_close_to(&self, rhs: &Vector2<T>, max_diff: T) -> bool[src] 
fn is_close_to(&self, rhs: &Vector2<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 Vector2<T>[src] 
impl<T: BaseFloat> GenFloat<T> for Vector2<T>impl<T: BaseFloat> GenFloatVec<T> for Vector2<T>[src] 
impl<T: BaseFloat> GenFloatVec<T> for Vector2<T>impl<T: BaseFloat> Mul<Vector2<T>> for Matrix2<T>[src] 
impl<T: BaseFloat> Mul<Vector2<T>> for Matrix2<T>type Output = Vector2<T>
The resulting type after applying the * operator.
fn mul(self, rhs: Vector2<T>) -> Vector2<T>[src] 
fn mul(self, rhs: Vector2<T>) -> Vector2<T>Performs the * operation.
impl<T: BaseFloat> GenMat<T, Vector2<T>> for Matrix2<T>[src] 
impl<T: BaseFloat> GenMat<T, Vector2<T>> for Matrix2<T>type R = Vector2<T>
Type of row vectors.
type Transpose = Matrix2<T>
Type of transpose matrix.
fn transpose(&self) -> Matrix2<T>[src] 
fn transpose(&self) -> Matrix2<T>Returns the transpose matrix. Read more
fn mul_c(&self, rhs: &Matrix2<T>) -> Matrix2<T>[src] 
fn mul_c(&self, rhs: &Matrix2<T>) -> Matrix2<T>Component-wise multiplication. Read more
impl<T: BaseFloat> GenMat<T, Vector2<T>> for Matrix3x2<T>[src] 
impl<T: BaseFloat> GenMat<T, Vector2<T>> for Matrix3x2<T>type R = Vector3<T>
Type of row vectors.
type Transpose = Matrix2x3<T>
Type of transpose matrix.
fn transpose(&self) -> Matrix2x3<T>[src] 
fn transpose(&self) -> Matrix2x3<T>Returns the transpose matrix. Read more
fn mul_c(&self, rhs: &Matrix3x2<T>) -> Matrix3x2<T>[src] 
fn mul_c(&self, rhs: &Matrix3x2<T>) -> Matrix3x2<T>Component-wise multiplication. Read more
impl<T: BaseFloat> GenMat<T, Vector2<T>> for Matrix4x2<T>[src] 
impl<T: BaseFloat> GenMat<T, Vector2<T>> for Matrix4x2<T>type R = Vector4<T>
Type of row vectors.
type Transpose = Matrix2x4<T>
Type of transpose matrix.
fn transpose(&self) -> Matrix2x4<T>[src] 
fn transpose(&self) -> Matrix2x4<T>Returns the transpose matrix. Read more
fn mul_c(&self, rhs: &Matrix4x2<T>) -> Matrix4x2<T>[src] 
fn mul_c(&self, rhs: &Matrix4x2<T>) -> Matrix4x2<T>Component-wise multiplication. Read more
impl<T: BaseFloat> Mul<Vector2<T>> for Matrix2x3<T>[src] 
impl<T: BaseFloat> Mul<Vector2<T>> for Matrix2x3<T>type Output = Vector3<T>
The resulting type after applying the * operator.
fn mul(self, rhs: Vector2<T>) -> Vector3<T>[src] 
fn mul(self, rhs: Vector2<T>) -> Vector3<T>Performs the * operation.
impl<T: BaseFloat> Mul<Vector2<T>> for Matrix2x4<T>[src] 
impl<T: BaseFloat> Mul<Vector2<T>> for Matrix2x4<T>type Output = Vector4<T>
The resulting type after applying the * operator.
fn mul(self, rhs: Vector2<T>) -> Vector4<T>[src] 
fn mul(self, rhs: Vector2<T>) -> Vector4<T>Performs the * operation.
impl<T: BaseFloat> GenSquareMat<T, Vector2<T>> for Matrix2<T>[src] 
impl<T: BaseFloat> GenSquareMat<T, Vector2<T>> for Matrix2<T>