mirror of
https://github.com/redstrate/Physis.git
synced 2025-04-21 12:17:45 +00:00
Add MDL::replace_vertices function
Will be used for model writing in the future
This commit is contained in:
parent
8efbe484a5
commit
c2426193ca
1 changed files with 8 additions and 1 deletions
|
@ -305,7 +305,7 @@ struct VertexElement {
|
|||
usage_index: u8,
|
||||
}
|
||||
|
||||
#[derive(Clone)]
|
||||
#[derive(Clone, Copy)]
|
||||
#[repr(C)]
|
||||
pub struct Vertex {
|
||||
pub position: [f32; 3],
|
||||
|
@ -579,6 +579,13 @@ 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);
|
||||
}
|
||||
|
||||
pub fn write_to_buffer(&self) -> Option<ByteBuffer> {
|
||||
let mut buffer = ByteBuffer::new();
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue