(pos: [f32; 3], normal: [f32; 3])
| 493 | } |
| 494 | |
| 495 | fn project_uv(pos: [f32; 3], normal: [f32; 3]) -> [f32; 2] { |
| 496 | let ax = normal[0].abs(); |
| 497 | let ay = normal[1].abs(); |
| 498 | let az = normal[2].abs(); |
| 499 | if ay >= ax && ay >= az { |
| 500 | [pos[0] + 0.5, pos[2] + 0.5] |
| 501 | } else if ax >= az { |
| 502 | [pos[2] + 0.5, pos[1] + 0.5] |
| 503 | } else { |
| 504 | [pos[0] + 0.5, pos[1] + 0.5] |
| 505 | } |
| 506 | } |
| 507 | |
| 508 | #[inline] |
| 509 | fn add3(a: [f32; 3], b: [f32; 3]) -> [f32; 3] { |