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

Method prepare

perro_source/render_stack/perro_meshlets/src/lib.rs:358–375  ·  view source on GitHub ↗
(&mut self, vertex_count: usize, tri_capacity: usize)

Source from the content-addressed store, hash-verified

356 }
357 if lods.is_empty() {
358 lods.push(LodSet {
359 indices: indices.to_vec(),
360 surface_ranges: base_surfaces,
361 });
362 }
363 Ok(lods)
364}
365
366fn build_surface_lods(
367 vertices: &[LodVertex],
368 surface_indices: &[u32],
369 ratios: &[f32],
370) -> Vec<Vec<u32>> {
371 let Some((&min_index, &max_index)) = surface_indices
372 .iter()
373 .min()
374 .zip(surface_indices.iter().max())
375 else {
376 return ratios.iter().map(|_| Vec::new()).collect();
377 };
378 let min_vertex = min_index as usize;

Callers 1

simplify_surfaceFunction · 0.45

Calls 4

resize_withMethod · 0.80
lenMethod · 0.45
clearMethod · 0.45
reserveMethod · 0.45

Tested by

no test coverage detected