diff options
author | HampusM <hampus@hampusmat.com> | 2025-01-14 13:53:59 +0100 |
---|---|---|
committer | HampusM <hampus@hampusmat.com> | 2025-01-14 13:53:59 +0100 |
commit | ddc442865253b0aa0b704c88593748fef48b5478 (patch) | |
tree | cbfe4b6baba0ca76f685e4c96afb32c39bcc66ea /engine/src/mesh.rs | |
parent | 5fa358a465d32d1420a8cdfd23dd1a88ca4ae797 (diff) |
feat(engine): add fns to get mut mesh vertices & indices slices
Diffstat (limited to 'engine/src/mesh.rs')
-rw-r--r-- | engine/src/mesh.rs | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/engine/src/mesh.rs b/engine/src/mesh.rs index a9914e7..917e7f7 100644 --- a/engine/src/mesh.rs +++ b/engine/src/mesh.rs @@ -27,11 +27,23 @@ impl Mesh } #[must_use] + pub fn vertices_mut(&mut self) -> &mut [Vertex] + { + &mut self.vertices + } + + #[must_use] pub fn indices(&self) -> Option<&[u32]> { self.indices.as_deref() } + #[must_use] + pub fn indices_mut(&mut self) -> Option<&mut [u32]> + { + self.indices.as_deref_mut() + } + /// Finds the vertex positions that are furthest in every 3D direction. Keep in mind /// that this can be quite time-expensive if the mesh has many vertices. pub fn find_furthest_vertex_positions(&self) -> DirectionPositions<'_> |