From bd3a4e5f01cff3831817eb5dd4adf8ea1ed7fac0 Mon Sep 17 00:00:00 2001
From: Dahlia Trimble
Date: Fri, 8 May 2009 03:04:45 +0000
Subject: Added a Copy() method to PrimMesh and SculptMesh as suggested by
dmiles. Sync PrimMesher.cs and SculptMesh.cs with PrimMesher.dll r36.
---
OpenSim/Region/Physics/Meshing/SculptMesh.cs | 18 ++++++++++++++++++
1 file changed, 18 insertions(+)
(limited to 'OpenSim/Region/Physics/Meshing/SculptMesh.cs')
diff --git a/OpenSim/Region/Physics/Meshing/SculptMesh.cs b/OpenSim/Region/Physics/Meshing/SculptMesh.cs
index 5b8a5be..77b1771 100644
--- a/OpenSim/Region/Physics/Meshing/SculptMesh.cs
+++ b/OpenSim/Region/Physics/Meshing/SculptMesh.cs
@@ -376,6 +376,24 @@ namespace PrimMesher
calcVertexNormals(sculptType, width, height);
}
+ ///
+ /// Duplicates a SculptMesh object. All object properties are copied by value, including lists.
+ ///
+ ///
+ public SculptMesh Copy()
+ {
+ return new SculptMesh(this);
+ }
+
+ public SculptMesh(SculptMesh sm)
+ {
+ coords = new List(sm.coords);
+ faces = new List(sm.faces);
+ viewerFaces = new List(sm.viewerFaces);
+ normals = new List(sm.normals);
+ uvs = new List(sm.uvs);
+ }
+
private void calcVertexNormals(SculptType sculptType, int xSize, int ySize)
{ // compute vertex normals by summing all the surface normals of all the triangles sharing
// each vertex and then normalizing
--
cgit v1.1