Skip to content

Commit

Permalink
feat: clone indices (bevyengine#1574)
Browse files Browse the repository at this point in the history
Super simple and straight forward. I need this for the tilemap because if I need to update all chunk indices, then I can calculate it once and clone it. Of course, for now I'm just returning the Vec itself then wrapping it but would be nice if I didn't have to do that.
  • Loading branch information
joshuajbouw committed Mar 7, 2021
1 parent 58d687b commit 2b0a48d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions crates/bevy_render/src/mesh/mesh.rs
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ impl From<Vec<[u8; 4]>> for VertexAttributeValues {
/// An array of indices into the VertexAttributeValues for a mesh.
///
/// It describes the order in which the vertex attributes should be joined into faces.
#[derive(Debug)]
#[derive(Debug, Clone)]
pub enum Indices {
U16(Vec<u16>),
U32(Vec<u32>),
Expand All @@ -204,7 +204,7 @@ impl From<&Indices> for IndexFormat {
}

// TODO: allow values to be unloaded after been submitting to the GPU to conserve memory
#[derive(Debug, TypeUuid)]
#[derive(Debug, TypeUuid, Clone)]
#[uuid = "8ecbac0f-f545-4473-ad43-e1f4243af51e"]
pub struct Mesh {
primitive_topology: PrimitiveTopology,
Expand Down

0 comments on commit 2b0a48d

Please sign in to comment.