MCPcopy Create free account
hub / github.com/PerroEngine/Perro / project_uv

Function project_uv

perro_source/core/perro_builtin_meshes/src/lib.rs:495–506  ·  view source on GitHub ↗
(pos: [f32; 3], normal: [f32; 3])

Source from the content-addressed store, hash-verified

493}
494
495fn 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]
509fn add3(a: [f32; 3], b: [f32; 3]) -> [f32; 3] {

Callers 1

push_triangleFunction · 0.85

Calls 1

absMethod · 0.45

Tested by

no test coverage detected