macro_rules! mat4 { () => { ... }; ($expr:expr) => { ... }; ( $m00:expr, $m01:expr, $m02:expr, $m03:expr, $m10:expr, $m11:expr, $m12:expr, $m13:expr, $m20:expr, $m21:expr, $m22:expr, $m23:expr, $m30:expr, $m31:expr, $m32:expr, $m33:expr, ) => { ... }; }
Expand description
Single-precision 4x4 matrix macro constructor.
Examples
Identity
let empty = mat4!();
assert_eq!(
empty.as_ref(),
&[
[1.0, 0.0, 0.0, 0.0],
[0.0, 1.0, 0.0, 0.0],
[0.0, 0.0, 1.0, 0.0],
[0.0, 0.0, 0.0, 1.0],
]
);
Full
let full = mat4!(
0.1, 0.2, 0.3, 0.4,
0.5, 0.6, 0.7, 0.8,
0.9, 1.0, 1.1, 1.2,
1.3, 1.4, 1.5, 1.6,
);
assert_eq!(
full.as_ref(),
&[
[0.1, 0.2, 0.3, 0.4],
[0.5, 0.6, 0.7, 0.8],
[0.9, 1.0, 1.1, 1.2],
[1.3, 1.4, 1.5, 1.6],
]
);