rbx_loader: never do &Vec + deconstruct Face2 (style)

This commit is contained in:
Quaternions 2025-03-09 23:46:43 -07:00
parent bfea49ffae
commit a2369b4211

@ -84,13 +84,13 @@ where
fn ingest_faces2_lods3( fn ingest_faces2_lods3(
polygon_groups:&mut Vec<PolygonGroup>, polygon_groups:&mut Vec<PolygonGroup>,
vertex_id_map:&HashMap<rbx_mesh::mesh::VertexId2,VertexId>, vertex_id_map:&HashMap<rbx_mesh::mesh::VertexId2,VertexId>,
faces:&Vec<rbx_mesh::mesh::Face2>, faces:&[rbx_mesh::mesh::Face2],
lods:&Vec<rbx_mesh::mesh::Lod3> lods:&[rbx_mesh::mesh::Lod3],
){ ){
//faces have to be split into polygon groups based on lod //faces have to be split into polygon groups based on lod
polygon_groups.extend(lods.windows(2).map(|lod_pair| polygon_groups.extend(lods.windows(2).map(|lod_pair|
PolygonGroup::PolygonList(PolygonList::new(faces[lod_pair[0].0 as usize..lod_pair[1].0 as usize].iter().map(|face| PolygonGroup::PolygonList(PolygonList::new(faces[lod_pair[0].0 as usize..lod_pair[1].0 as usize].iter().map(|rbx_mesh::mesh::Face2(v0,v1,v2)|
vec![vertex_id_map[&face.0],vertex_id_map[&face.1],vertex_id_map[&face.2]] vec![vertex_id_map[&v0],vertex_id_map[&v1],vertex_id_map[&v2]]
).collect())) ).collect()))
)) ))
} }