1
Fork 0
mirror of https://github.com/redstrate/Physis.git synced 2025-04-23 13:17:44 +00:00

Begin support for importing models of different vertex/index counts

This commit is contained in:
Joshua Goins 2023-12-09 17:18:02 -05:00
parent c2426193ca
commit fc2d2f73cf

View file

@ -582,8 +582,12 @@ impl MDL {
pub fn replace_vertices(&mut self, lod_index: usize, part_index: usize, vertices: &[Vertex], indices: &[u16]) {
let part = &mut self.lods[lod_index].parts[part_index];
part.vertices.copy_from_slice(vertices);
part.indices.copy_from_slice(indices);
part.vertices = Vec::from(vertices);
part.indices = Vec::from(indices);
// Update vertex count in header
self.model_data.meshes[part.mesh_index as usize].vertex_count = part.vertices.len() as u16;
self.model_data.meshes[part.mesh_index as usize].index_count = part.indices.len() as u16 as u32;
}
pub fn write_to_buffer(&self) -> Option<ByteBuffer> {