Skip to main content

Module math

Module math 

Source
Expand description

Math backend implementations.

This module provides backend-agnostic math type implementations. The active backend is selected via feature flags.

Functions§

mat3
Get element at (row, col) from a Mat3.
mat4
Get element at (row, col) from a DMat4.
mat3_as_slice
Get Mat3 data as a &[f32] slice (column-major order).
mat3_from_column_slice
Create a Mat3 from a column-major slice.
mat3_from_diagonal_element
Create a diagonal Mat3 with v on the diagonal.
mat3_from_row_slice
Create a Mat3 from a row-major slice.
mat3_identity
Return the identity Mat3.
mat3_iter
Iterate over Mat3 elements (column-major order).
mat3_row
Extract a row from a Mat3 as [f32; 3].
mat3_sub
Subtract two Mat3 matrices element-wise.
mat3_zeros
Return a zero Mat3.
mat4_as_slice
Return DMat4 data as a &[f64] slice.
mat4_from_row_slice
Create a DMat4 from a row-major slice.
mat4_identity
Return the identity DMat4.
mat4_iter
Iterate over DMat4 elements (column-major order).
mat4_sub
Subtract two DMat4 matrices element-wise.
mat4_zeros
Return a zero DMat4.
point3_as_ref
Get point coordinates as a &[f32; 3] ref.
point3_as_slice
Get point coordinates as a slice.
point3_origin
Return the origin point (zero vector).
vec2_as_ref
Get Vec2 data as a &[f32; 2] ref.
vec2_as_slice
Get Vec2 data as a &[f32] slice.
vec2_zeros
Create a zero Vec2.
vec3_as_ref
Get Vec3 data as a &[f32; 3] ref.
vec3_as_slice
Get Vec3 data as a &[f32] slice.
vec3_normalized
Return a normalized copy of a Vec3.
vec3_zeros
Create a zero Vec3.

Type Aliases§

Mat3Impl
Mat4Impl
Point3Impl
Vec2Impl
Vec3Impl