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