Trait glm::GenNumVec [] [src]

pub trait GenNumVec<T: BaseNum>: GenNum<T> + GenVec<T> {
    fn sum(&self) -> T;
    fn product(&self) -> T;
    fn min(&self) -> T;
    fn max(&self) -> T;
}

Trait of all vector types that are GenNum.

Required Methods

Returns the sum of all components.

Example

use glm::GenNumVec;     // bring the method into scope.
let v = glm::vec3(1., 2., 3.);
assert_eq!(v.sum(), 6.0);

Multiplies all components.

Example

use glm::GenNumVec;     // bring the method into scope.
let v = glm::vec3(2., 3., 4.);
assert_eq!(v.product(), 24.);

Returns the minimal value of all components.

Example

use glm::GenNumVec;     // bring the method into scope.
let v = glm::vec3(1.0, 2.0, 3.0);
assert_eq!(v.min(), 1.0);

Returns the maximal value of all components.

Example

use glm::GenNumVec;     // bring the method into scope.

let v = glm::vec3(1.0, 2.0, 3.0);
assert_eq!(v.max(), 3.0);

Implementors