MCPcopy Create free account
hub / github.com/Bloom-Engine/engine / mat4_multiply

Function mat4_multiply

native/shared/src/renderer/util.rs:74–82  ·  view source on GitHub ↗
(a: [[f32; 4]; 4], b: [[f32; 4]; 4])

Source from the content-addressed store, hash-verified

72}
73
74pub fn mat4_multiply(a: [[f32; 4]; 4], b: [[f32; 4]; 4]) -> [[f32; 4]; 4] {
75 let mut out = [[0.0f32; 4]; 4];
76 for col in 0..4 {
77 for row in 0..4 {
78 out[col][row] = a[0][row]*b[col][0] + a[1][row]*b[col][1] + a[2][row]*b[col][2] + a[3][row]*b[col][3];
79 }
80 }
81 out
82}
83
84/// Multiply a column-major 4x4 matrix by a column vector.
85pub fn mat4_mul_vec4(m: &[[f32; 4]; 4], v: &[f32; 4]) -> [f32; 4] {

Callers 6

compute_cascade_vpsMethod · 0.85
begin_mode_3dMethod · 0.85
draw_model_cachedMethod · 0.85
submit_material_drawMethod · 0.85
mirrored_viewFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected