Module mat4

Module mat4 

Source
Expand description

Row-major 4x4 matrices over [f64; 16] (m[r * 4 + c]), plus exact bridges to nalgebra::Matrix4<f64> and the f32 boundary casts.

Re-exports§

pub use super::tol::SINGULAR_DET_EPS;

Constants§

IDENTITY
The identity.

Functions§

affine_inverse
Inverse of an AFFINE row-major matrix (last row [0,0,0,1], which is not read): the upper 3x3 by cofactors, the translation by -R⁻¹·t.
apply3
The 3x3 r applied to v.
col_major_array
nalgebra’s own column-major storage as an array: the layout of the decoder’s placement-transform memo, and bit-for-bit what Matrix4::from_column_slice reads back.
compose_frame
Column-major frame composition a * b, with every zero entry +0.0.
from_na
nalgebra to row-major (the InstanceMeta convention).
mul
a . b. Each entry accumulates from 0.0 over k = 0..4, so an all-zero dot product is +0.0; this is the spelling export, processing, wasm and the server already share.
to_col_major_f32
Row-major f64 to the column-major [f32; 16] glTF and GPU uploads expect. The only f64 to f32 point besides to_f32.
to_f32
Elementwise f64 to f32, layout unchanged (row-major stays row-major).
to_na
Row-major to nalgebra. Exact inverse of from_na.
transform_point
m applied to the point p (translation included; the affine last row is not read).
transform_vector
The linear part of m applied to v (no translation).
translation
A pure translation by t.
transpose
Swap rows and columns. Moves values only, so it is exact (and sign-of-zero preserving).

Type Aliases§

M3
A row-major 3x3 matrix.
M4
A row-major 4x4 matrix.