Module glm::ext [] [src]

Functions that extend the functionalities of GLSL data types.

Note

  • Unlike built-in functions, extension functions are not re-exported to the root module of glm. You have to use glm::ext.
  • Also unlike the built-in functions, the naming of extension functions follows the Rust convention, instead of the GLSL's. That is, snake case is used.
  • The parameters of matrix related functions are passed by reference.

Reexports

pub use self::consts::Consts;
pub use self::consts::epsilon;
pub use self::consts::pi;
pub use self::consts::tau;
pub use self::consts::root_pi;
pub use self::consts::half_pi;
pub use self::consts::one_third_pi;
pub use self::consts::quarter_pi;
pub use self::consts::one_over_pi;
pub use self::consts::one_over_tau;
pub use self::consts::two_over_pi;
pub use self::consts::four_over_pi;
pub use self::consts::two_over_root_pi;
pub use self::consts::one_over_root_two;
pub use self::consts::root_half_pi;
pub use self::consts::root_tau;
pub use self::consts::root_ln_four;
pub use self::consts::e;
pub use self::consts::euler;
pub use self::consts::root_two;
pub use self::consts::root_three;
pub use self::consts::root_five;
pub use self::consts::ln_two;
pub use self::consts::ln_ten;
pub use self::consts::ln_ln_two;
pub use self::consts::one_third;
pub use self::consts::two_thirds;
pub use self::consts::golden_ratio;

Modules

consts

Functions

angle

Returns angle between vectors x and y.

cbrt

Returns the cubic root.

is_invertible

Returns true if the square matrix m is invertible, i.e., its determinant does not close or equal to 0.

is_perpendicular

Returns true if vector x is perpendicular to y, i.e., angle between x and y is π/2.

look_at

Build a look at view matrix based on the default handedness.

look_at_rh

Build a right handed look at view matrix.

normalize_to

Normalizes vector x of specific length len.

perspective

Creates a matrix for a symetric perspective-view frustum based on the default handedness.

perspective_rh

Creates a matrix for a right handed, symetric perspective-view frustum.

pow2

x * x.

pow3

x * x * x.

powi

Raise a number to an integer power.

projection

Projects x on y.

recip

Returns the reciprocal (inverse) of float number x.

recip_length

Returns the reciprocal (inverse) of the length of vector x.

rotate

Builds a rotation 4 * 4 matrix created from an axis vector and an angle.

scale

Builds a scale 4 * 4 matrix created from 3 scalars.

sin_cos

Simultaneously computes the sine and cosine of x, returns (sin(x), cos(x)).

sqlength

Returns the squre of the length of vector x.

trace

Returns the trace of a square matrix m.

translate

Builds a translation 4 * 4 matrix created from a vector of 3 components.