diff options
author | Dahlia Trimble | 2009-05-08 03:04:45 +0000 |
---|---|---|
committer | Dahlia Trimble | 2009-05-08 03:04:45 +0000 |
commit | bd3a4e5f01cff3831817eb5dd4adf8ea1ed7fac0 (patch) | |
tree | 5e9ac07b13118999d1d88d20f9a1e06be4b6019f /OpenSim/Region/Physics/Meshing/SculptMesh.cs | |
parent | fix svn properties (diff) | |
download | opensim-SC-bd3a4e5f01cff3831817eb5dd4adf8ea1ed7fac0.zip opensim-SC-bd3a4e5f01cff3831817eb5dd4adf8ea1ed7fac0.tar.gz opensim-SC-bd3a4e5f01cff3831817eb5dd4adf8ea1ed7fac0.tar.bz2 opensim-SC-bd3a4e5f01cff3831817eb5dd4adf8ea1ed7fac0.tar.xz |
Added a Copy() method to PrimMesh and SculptMesh as suggested by dmiles. Sync PrimMesher.cs and SculptMesh.cs with PrimMesher.dll r36.
Diffstat (limited to 'OpenSim/Region/Physics/Meshing/SculptMesh.cs')
-rw-r--r-- | OpenSim/Region/Physics/Meshing/SculptMesh.cs | 18 |
1 files changed, 18 insertions, 0 deletions
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 | |||
376 | calcVertexNormals(sculptType, width, height); | 376 | calcVertexNormals(sculptType, width, height); |
377 | } | 377 | } |
378 | 378 | ||
379 | /// <summary> | ||
380 | /// Duplicates a SculptMesh object. All object properties are copied by value, including lists. | ||
381 | /// </summary> | ||
382 | /// <returns></returns> | ||
383 | public SculptMesh Copy() | ||
384 | { | ||
385 | return new SculptMesh(this); | ||
386 | } | ||
387 | |||
388 | public SculptMesh(SculptMesh sm) | ||
389 | { | ||
390 | coords = new List<Coord>(sm.coords); | ||
391 | faces = new List<Face>(sm.faces); | ||
392 | viewerFaces = new List<ViewerFace>(sm.viewerFaces); | ||
393 | normals = new List<Coord>(sm.normals); | ||
394 | uvs = new List<UVCoord>(sm.uvs); | ||
395 | } | ||
396 | |||
379 | private void calcVertexNormals(SculptType sculptType, int xSize, int ySize) | 397 | private void calcVertexNormals(SculptType sculptType, int xSize, int ySize) |
380 | { // compute vertex normals by summing all the surface normals of all the triangles sharing | 398 | { // compute vertex normals by summing all the surface normals of all the triangles sharing |
381 | // each vertex and then normalizing | 399 | // each vertex and then normalizing |