Struct glm::Vector3 [] [src]

#[repr(C)]
pub struct Vector3<T: Primitive> { pub x: T, pub y: T, pub z: T, }

Fields

Methods

impl<T: Primitive> Vector3<T>
[src]

impl<T: Primitive> Vector3<T>
[src]

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);

Truncates self to a Vector2 by remove the ith element.

Parameter i is 0 based index.

Panic

It is a panic if i is larger than 2.

Example

use glm::*;

let v3 = vec3(1., 2., 3.);
let v2 = vec2(1., 3.);
assert_eq!(v3.truncate(1), v2);

Trait Implementations

impl<T: Copy + Primitive> Copy for Vector3<T>
[src]

impl<T: Clone + Primitive> Clone for Vector3<T>
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl<T: PartialEq + Primitive> PartialEq for Vector3<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: Debug + Primitive> Debug for Vector3<T>
[src]

Formats the value using the given formatter. Read more

impl<T: Primitive> GenVec<T> for Vector3<T>
[src]

Returns the dimension of the vector. Read more

impl<T: Primitive> Index<usize> for Vector3<T>
[src]

The returned type after indexing.

Performs the indexing (container[index]) operation.

impl<T: Primitive> IndexMut<usize> for Vector3<T>
[src]

Performs the mutable indexing (container[index]) operation.

impl<T: Primitive> Rand for Vector3<T>
[src]

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 Eq for Vector3<bool>
[src]

impl GenBVec for Vector3<bool>
[src]

Returns true if all components of the receiver are true. Read more

Returns true if there is any component of the receiver is true. Read more

Returns the component-wise logical complement of the receiver. Read more

impl<T: BaseNum> Add<Vector3<T>> for Vector3<T>
[src]

The resulting type after applying the + operator.

Performs the + operation.

impl<T: BaseNum> Add<T> for Vector3<T>
[src]

The resulting type after applying the + operator.

Performs the + operation.

impl<T: BaseNum> Mul<Vector3<T>> for Vector3<T>
[src]

The resulting type after applying the * operator.

Performs the * operation.

impl<T: BaseNum> Mul<T> for Vector3<T>
[src]

The resulting type after applying the * operator.

Performs the * operation.

impl<T: BaseNum> Div<Vector3<T>> for Vector3<T>
[src]

The resulting type after applying the / operator.

Performs the / operation.

impl<T: BaseNum> Div<T> for Vector3<T>
[src]

The resulting type after applying the / operator.

Performs the / operation.

impl<T: BaseNum> Rem<Vector3<T>> for Vector3<T>
[src]

The resulting type after applying the % operator.

Performs the % operation.

impl<T: BaseNum> Rem<T> for Vector3<T>
[src]

The resulting type after applying the % operator.

Performs the % operation.

impl<T: BaseNum> One for Vector3<T>
[src]

Returns the multiplicative identity element of Self, 1. Read more

Returns true if self is equal to the multiplicative identity. Read more

impl<T: BaseNum> Zero for Vector3<T>
[src]

Returns the additive identity element of Self, 0. Read more

Returns true if self is equal to the additive identity.

impl<T: BaseNum> GenNum<T> for Vector3<T>
[src]

Constructs from a scalar number.

impl<T: BaseNum> GenNumVec<T> for Vector3<T>
[src]

Returns the sum of all components. # Example Read more

Multiplies all components. Read more

Returns the minimal value of all components. Read more

Returns the maximal value of all components. Read more

impl<T: SignedNum + BaseNum> Neg for Vector3<T>
[src]

The resulting type after applying the - operator.

Performs the unary - operation.

impl<T: SignedNum + BaseNum> Sub<Vector3<T>> for Vector3<T>
[src]

The resulting type after applying the - operator.

Performs the - operation.

impl<T: SignedNum + BaseNum> Sub<T> for Vector3<T>
[src]

The resulting type after applying the - operator.

Performs the - operation.

impl<T: SignedNum + BaseNum> SignedNum for Vector3<T>
[src]

Returns the absolute value of the receiver.

Returns the sign number of the receiver. Read more

impl<T: BaseInt> Eq for Vector3<T>
[src]

impl<T: BaseInt> Not for Vector3<T>
[src]

The resulting type after applying the ! operator.

Performs the unary ! operation.

impl<T: BaseInt> BitAnd<T> for Vector3<T>
[src]

The resulting type after applying the & operator.

Performs the & operation.

impl<T: BaseInt> BitAnd<Vector3<T>> for Vector3<T>
[src]

The resulting type after applying the & operator.

Performs the & operation.

impl<T: BaseInt> BitOr<T> for Vector3<T>
[src]

The resulting type after applying the | operator.

Performs the | operation.

impl<T: BaseInt> BitOr<Vector3<T>> for Vector3<T>
[src]

The resulting type after applying the | operator.

Performs the | operation.

impl<T: BaseInt> BitXor<T> for Vector3<T>
[src]

The resulting type after applying the ^ operator.

Performs the ^ operation.

impl<T: BaseInt> BitXor<Vector3<T>> for Vector3<T>
[src]

The resulting type after applying the ^ operator.

Performs the ^ operation.

impl<T: BaseInt> Shl<usize> for Vector3<T>
[src]

The resulting type after applying the << operator.

Performs the << operation.

impl<T: BaseInt> Shr<usize> for Vector3<T>
[src]

The resulting type after applying the >> operator.

Performs the >> operation.

impl<T: BaseInt> GenInt<T> for Vector3<T>
[src]

impl<T: BaseFloat> ApproxEq for Vector3<T>
[src]

Returns true if the difference between x and y is less than max_diff. Read more

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]

Computes and returns a * b + c.

impl<T: BaseFloat> GenFloatVec<T> for Vector3<T>
[src]

impl<T: BaseFloat> Mul<Vector3<T>> for Matrix3x2<T>
[src]

The resulting type after applying the * operator.

Performs the * operation.

impl<T: BaseFloat> GenMat<T, Vector3<T>> for Matrix2x3<T>
[src]

Type of row vectors.

Type of transpose matrix.

Returns the transpose matrix. Read more

Component-wise multiplication. Read more

impl<T: BaseFloat> Mul<Vector3<T>> for Matrix3<T>
[src]

The resulting type after applying the * operator.

Performs the * operation.

impl<T: BaseFloat> GenMat<T, Vector3<T>> for Matrix3<T>
[src]

Type of row vectors.

Type of transpose matrix.

Returns the transpose matrix. Read more

Component-wise multiplication. Read more

impl<T: BaseFloat> GenMat<T, Vector3<T>> for Matrix4x3<T>
[src]

Type of row vectors.

Type of transpose matrix.

Returns the transpose matrix. Read more

Component-wise multiplication. Read more

impl<T: BaseFloat> Mul<Vector3<T>> for Matrix3x4<T>
[src]

The resulting type after applying the * operator.

Performs the * operation.

impl<T: BaseFloat> GenSquareMat<T, Vector3<T>> for Matrix3<T>
[src]

Returns the determinant of a square matrix. Read more

Returns the inverse matrix of a square matrix, or None if the matrix is not invertible. Read more

Auto Trait Implementations

impl<T> Send for Vector3<T>

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