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

Function collapse_cost

perro_source/render_stack/perro_meshlets/src/lib.rs:464–486  ·  view source on GitHub ↗
(vertices: &[LodVertex], quadrics: &[[f64; 10]], keep: u32, remove: u32)

Source from the content-addressed store, hash-verified

462 &triangles,
463 &quadrics,
464 &scratch.edge_list,
465 &scratch.adjacency,
466 &scratch.tri_normals,
467 metric,
468 );
469 if collapses.is_empty() {
470 break;
471 }
472 let collapse_limit = triangles.len().saturating_sub(keep_tris).div_ceil(2).max(1);
473 let selected = select_independent_collapses(
474 &collapses,
475 &triangles,
476 &scratch.adjacency,
477 collapse_limit,
478 &mut scratch.locked_vertices,
479 &mut scratch.selected_collapses,
480 );
481 if selected == 0 {
482 break;
483 }
484 let Some(next_len) = apply_best_collapse_prefix(
485 &triangles,
486 &scratch.selected_collapses[..selected],
487 keep_tris,
488 &mut scratch.next_triangles,
489 &mut scratch.seen_triangles,

Callers 1

best_collapseFunction · 0.85

Calls 9

eval_quadricFunction · 0.85
dist2_2Function · 0.85
dist2_3Function · 0.85
dot3Function · 0.70
getMethod · 0.45
iter_mutMethod · 0.45
iterMethod · 0.45
maxMethod · 0.45
clampMethod · 0.45

Tested by

no test coverage detected