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

Function tri_normal

perro_source/render_stack/perro_meshlets/src/lib.rs:665–670  ·  view source on GitHub ↗
(vertices: &[LodVertex], tri: [u32; 3])

Source from the content-addressed store, hash-verified

663
664fn build_topology(vertices: &[LodVertex], triangles: &[[u32; 3]], scratch: &mut SimplifyScratch) {
665 for (tri_index, tri) in triangles.iter().enumerate() {
666 for (a, b) in [(tri[0], tri[1]), (tri[1], tri[2]), (tri[2], tri[0])] {
667 let key = if a <= b { (a, b) } else { (b, a) };
668 scratch
669 .edges
670 .entry(key)
671 .and_modify(|edge: &mut EdgeInfo| edge.count = edge.count.saturating_add(1))
672 .or_insert(EdgeInfo { count: 1 });
673 }

Callers 2

build_topologyFunction · 0.85
normal_dot_afterFunction · 0.85

Calls 4

normalize3Function · 0.70
cross3Function · 0.70
sub3Function · 0.70
getMethod · 0.45

Tested by

no test coverage detected