Skip to main content

Crate math

Crate math 

Source

Re-exports§

pub use from_normal as look_down;

Modules§

collision
cube
macros
mat
multi dimensional row-major matrix with generic mat2, mat3, mat34 and mat4 implementations there is a mat43 type for mat34 transposes but it does not support the full functionality
plane
ray
sphere

Macros§

assert_float_eq
assert_float_eq_with_epsilon
assert_vec3f_near

Structs§

ShaderMatrix4
The ShaderMatrix4 struct provides the 4-by-4 matrix layout that graphics backends expect from CPU data.
ShaderMatrix4x3
The ShaderMatrix4x3 struct provides the compact affine matrix layout used to send model transforms to the GPU.

Traits§

Base
base trait for scalar and vector numerical operations, arithmetic and generic constants
Magnitude
trait for operations involve vector magnitude or dot product
Number
base number trait for signed or unsigned, floating point or integer numbers.
VecN
generic vec trait to allow sized vectors to be treated generically

Functions§

are_colinear
cross
returns the vector cross product of a x b, makes sense only for 3 or 7 dimensional vectors
direction_from_orientation
dot
returns the vector dot product between a . b
from_normal
from_rotation
inverse
Returns the inverse of a left-handed, row-major 4-by-4 matrix.
length
returns the scalar magnitude or length of vector a
magnitude
returns the scalar magnitude or length of vector a
magnitude_squared
returns the scalar magnitude or length of vector a squared to avoid using sqrt
normalize
returns a normalized unit vector of a
orientation_from_direction
orthographic_matrix
orthographic_matrix_centered
plane_navigation
Converts a camera-relative movement command to a direction on the horizontal plane.
projection_matrix
Returns a left-handed perspective projection matrix with a depth range from 0 to 1.

Type Aliases§

Matrix3
Matrix4
Quaternion
Vector2
opinionated type abbreviations
Vector3
Vector4