mesh model name

This commit is contained in:
Robin Appelman 2023-12-15 23:00:28 +01:00
commit ab311b7f60

View file

@ -65,7 +65,7 @@ impl Model {
model model
.meshes .meshes
.iter() .iter()
.map(|mesh| (mesh, model.vertex_offset as usize)) .map(|mesh| (mesh, model.name.as_str(), model.vertex_offset as usize))
}); });
let vtx_meshes = self let vtx_meshes = self
@ -78,8 +78,9 @@ impl Model {
mdl_meshes mdl_meshes
.zip(vtx_meshes) .zip(vtx_meshes)
.map(|((mdl, model_vertex_offset), vtx)| Mesh { .map(|((mdl, model_name, model_vertex_offset), vtx)| Mesh {
model_vertex_offset, model_vertex_offset,
model_name,
vertices: self.vertices(), vertices: self.vertices(),
tangents: self.tangents(), tangents: self.tangents(),
mdl, mdl,
@ -108,6 +109,7 @@ impl<'a> SkinTable<'a> {
} }
pub struct Mesh<'a> { pub struct Mesh<'a> {
pub model_name: &'a str,
model_vertex_offset: usize, model_vertex_offset: usize,
vertices: &'a [Vertex], vertices: &'a [Vertex],
tangents: &'a [[f32; 4]], tangents: &'a [[f32; 4]],