diff --git a/src/mesh.rs b/src/mesh.rs index 0e44b4d..391dd06 100644 --- a/src/mesh.rs +++ b/src/mesh.rs @@ -23,11 +23,11 @@ fn ingest_vertices2< AcquireVertexId, >( vertices:Vec, - mut acquire_pos_id:AcquirePosId, - mut acquire_tex_id:AcquireTexId, - mut acquire_normal_id:AcquireNormalId, - mut acquire_color_id:AcquireColorId, - mut acquire_vertex_id:AcquireVertexId, + acquire_pos_id:&mut AcquirePosId, + acquire_tex_id:&mut AcquireTexId, + acquire_normal_id:&mut AcquireNormalId, + acquire_color_id:&mut AcquireColorId, + acquire_vertex_id:&mut AcquireVertexId, )->Result,Error> where AcquirePosId:FnMut([f32;3])->Result, @@ -55,11 +55,11 @@ fn ingest_vertices_truncated2< AcquireVertexId, >( vertices:Vec, - mut acquire_pos_id:AcquirePosId, - mut acquire_tex_id:AcquireTexId, - mut acquire_normal_id:AcquireNormalId, + acquire_pos_id:&mut AcquirePosId, + acquire_tex_id:&mut AcquireTexId, + acquire_normal_id:&mut AcquireNormalId, static_color_id:ColorId,//pick one color and fill everything with it - mut acquire_vertex_id:AcquireVertexId, + acquire_vertex_id:&mut AcquireVertexId, )->Result,Error> where AcquirePosId:FnMut([f32;3])->Result, @@ -150,25 +150,25 @@ pub fn convert(roblox_mesh_bytes:crate::data::RobloxMeshBytes)->Result{ //pick white and make all the vertices white let color_id=acquire_color_id([1.0f32;4]); - ingest_vertices_truncated2(mesh.vertices_truncated,acquire_pos_id,acquire_tex_id,acquire_normal_id,color_id,acquire_vertex_id)? + ingest_vertices_truncated2(mesh.vertices_truncated,&mut acquire_pos_id,&mut acquire_tex_id,&mut acquire_normal_id,color_id,&mut acquire_vertex_id)? }, - rbx_mesh::mesh::SizeOfVertex2::Full=>ingest_vertices2(mesh.vertices,acquire_pos_id,acquire_tex_id,acquire_normal_id,acquire_color_id,acquire_vertex_id)?, + rbx_mesh::mesh::SizeOfVertex2::Full=>ingest_vertices2(mesh.vertices,&mut acquire_pos_id,&mut acquire_tex_id,&mut acquire_normal_id,&mut acquire_color_id,&mut acquire_vertex_id)?, }; }, rbx_mesh::mesh::VersionedMesh::Version3(mesh)=>{ let vertex_id_map=match mesh.header.sizeof_vertex{ rbx_mesh::mesh::SizeOfVertex2::Truncated=>{ let color_id=acquire_color_id([1.0f32;4]); - ingest_vertices_truncated2(mesh.vertices_truncated,acquire_pos_id,acquire_tex_id,acquire_normal_id,color_id,acquire_vertex_id)? + ingest_vertices_truncated2(mesh.vertices_truncated,&mut acquire_pos_id,&mut acquire_tex_id,&mut acquire_normal_id,color_id,&mut acquire_vertex_id)? }, - rbx_mesh::mesh::SizeOfVertex2::Full=>ingest_vertices2(mesh.vertices,acquire_pos_id,acquire_tex_id,acquire_normal_id,acquire_color_id,acquire_vertex_id)?, + rbx_mesh::mesh::SizeOfVertex2::Full=>ingest_vertices2(mesh.vertices,&mut acquire_pos_id,&mut acquire_tex_id,&mut acquire_normal_id,&mut acquire_color_id,&mut acquire_vertex_id)?, }; }, rbx_mesh::mesh::VersionedMesh::Version4(mesh)=>{ - let vertex_id_map=ingest_vertices2(mesh.vertices,acquire_pos_id,acquire_tex_id,acquire_normal_id,acquire_color_id,acquire_vertex_id)?; + let vertex_id_map=ingest_vertices2(mesh.vertices,&mut acquire_pos_id,&mut acquire_tex_id,&mut acquire_normal_id,&mut acquire_color_id,&mut acquire_vertex_id)?; }, rbx_mesh::mesh::VersionedMesh::Version5(mesh)=>{ - let vertex_id_map=ingest_vertices2(mesh.vertices,acquire_pos_id,acquire_tex_id,acquire_normal_id,acquire_color_id,acquire_vertex_id)?; + let vertex_id_map=ingest_vertices2(mesh.vertices,&mut acquire_pos_id,&mut acquire_tex_id,&mut acquire_normal_id,&mut acquire_color_id,&mut acquire_vertex_id)?; }, } Ok(model::Mesh{