From ddc442865253b0aa0b704c88593748fef48b5478 Mon Sep 17 00:00:00 2001 From: HampusM Date: Tue, 14 Jan 2025 13:53:59 +0100 Subject: feat(engine): add fns to get mut mesh vertices & indices slices --- engine/src/mesh.rs | 12 ++++++++++++ 1 file changed, 12 insertions(+) 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 @@ -26,12 +26,24 @@ impl Mesh &self.vertices } + #[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<'_> -- cgit v1.2.3-18-g5258