(m: &[[f32; 4]; 4], p: &[f32; 3])
| 276 | } |
| 277 | |
| 278 | fn mat4_transform_point(m: &[[f32; 4]; 4], p: &[f32; 3]) -> [f32; 3] { |
| 279 | let v = mat4_mul_vec4(m, &[p[0], p[1], p[2], 1.0]); |
| 280 | if v[3].abs() > 1e-8 { |
| 281 | [v[0]/v[3], v[1]/v[3], v[2]/v[3]] |
| 282 | } else { |
| 283 | [v[0], v[1], v[2]] |
| 284 | } |
| 285 | } |
| 286 | |
| 287 | fn mat4_transform_dir(m: &[[f32; 4]; 4], d: &[f32; 3]) -> [f32; 3] { |
| 288 | // Transform direction (no translation, no perspective divide) |
no test coverage detected