From db142d125b5b8f41b6b65f2c23e2a815e28ee7f9 Mon Sep 17 00:00:00 2001 From: Quaternions Date: Tue, 12 Mar 2024 21:42:19 -0700 Subject: [PATCH] add Clone for Mesh --- src/model.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/model.rs b/src/model.rs index 952d7cd..0fbd107 100644 --- a/src/model.rs +++ b/src/model.rs @@ -27,6 +27,7 @@ pub trait PolygonIter{ pub trait MapVertexId{ fn map_vertex_idVertexId>(self,f:F)->Self; } +#[derive(Clone)] pub struct PolygonList(Vec); impl PolygonList{ pub const fn new(list:Vec)->Self{ @@ -54,6 +55,7 @@ impl MapVertexId for PolygonList{ // } #[derive(Clone,Copy,Hash,id::Id,PartialEq,Eq)] pub struct PolygonGroupId(u32); +#[derive(Clone)] pub enum PolygonGroup{ PolygonList(PolygonList), //TriangleStrip(TriangleStrip), @@ -89,12 +91,13 @@ impl RenderConfig{ } } } +#[derive(Clone)] pub struct IndexedGraphicsGroup{ //Render pattern material/texture/shader/flat color pub render:RenderConfigId, pub groups:Vec, } -#[derive(Default)] +#[derive(Clone,Default)] pub struct IndexedPhysicsGroup{ //the polygons in this group are guaranteed to make a closed convex shape pub groups:Vec, @@ -102,6 +105,7 @@ pub struct IndexedPhysicsGroup{ //This is a superset of PhysicsModel and GraphicsModel #[derive(Clone,Copy,Hash,id::Id,Eq,PartialEq)] pub struct MeshId(u32); +#[derive(Clone)] pub struct Mesh{ pub unique_pos:Vec,//Unit32Vec3 pub unique_normal:Vec,//Unit32Vec3