From fb2cabd6b35bdbc966598de361044e2ff0164e5c Mon Sep 17 00:00:00 2001
From: dahlia
Date: Fri, 25 Sep 2009 13:00:49 -0700
Subject: corrections to viewerMode AddPos()

---
 OpenSim/Region/Physics/Meshing/PrimMesher.cs | 27 +++++++++++++++++++++++++++
 OpenSim/Region/Physics/Meshing/SculptMesh.cs | 14 +++++++++++++-
 2 files changed, 40 insertions(+), 1 deletion(-)

diff --git a/OpenSim/Region/Physics/Meshing/PrimMesher.cs b/OpenSim/Region/Physics/Meshing/PrimMesher.cs
index 0d19c01..abfd400 100644
--- a/OpenSim/Region/Physics/Meshing/PrimMesher.cs
+++ b/OpenSim/Region/Physics/Meshing/PrimMesher.cs
@@ -345,6 +345,21 @@ namespace PrimMesher
             this.v3.Z *= z;
         }
 
+        public void AddPos(float x, float y, float z)
+        {
+            this.v1.X += x;
+            this.v2.X += x;
+            this.v3.X += x;
+
+            this.v1.Y += y;
+            this.v2.Y += y;
+            this.v3.Y += y;
+
+            this.v1.Z += z;
+            this.v2.Z += z;
+            this.v3.Z += z;
+        }
+
         public void AddRot(Quat q)
         {
             this.v1 *= q;
@@ -2141,6 +2156,18 @@ namespace PrimMesher
                 vert.Z += z;
                 this.coords[i] = vert;
             }
+
+            if (this.viewerFaces != null)
+            {
+                int numViewerFaces = this.viewerFaces.Count;
+
+                for (i = 0; i < numViewerFaces; i++)
+                {
+                    ViewerFace v = this.viewerFaces[i];
+                    v.AddPos(x, y, z);
+                    this.viewerFaces[i] = v;
+                }
+            }
         }
 
         /// <summary>
diff --git a/OpenSim/Region/Physics/Meshing/SculptMesh.cs b/OpenSim/Region/Physics/Meshing/SculptMesh.cs
index bf42fee..bd63aef 100644
--- a/OpenSim/Region/Physics/Meshing/SculptMesh.cs
+++ b/OpenSim/Region/Physics/Meshing/SculptMesh.cs
@@ -494,6 +494,18 @@ namespace PrimMesher
                 vert.Z += z;
                 this.coords[i] = vert;
             }
+
+            if (this.viewerFaces != null)
+            {
+                int numViewerFaces = this.viewerFaces.Count;
+
+                for (i = 0; i < numViewerFaces; i++)
+                {
+                    ViewerFace v = this.viewerFaces[i];
+                    v.AddPos(x, y, z);
+                    this.viewerFaces[i] = v;
+                }
+            }
         }
 
         /// <summary>
@@ -556,7 +568,7 @@ namespace PrimMesher
             if (path == null)
                 return;
             String fileName = name + "_" + title + ".raw";
-            String completePath = Path.Combine(path, fileName);
+            String completePath = System.IO.Path.Combine(path, fileName);
             StreamWriter sw = new StreamWriter(completePath);
 
             for (int i = 0; i < this.faces.Count; i++)
-- 
cgit v1.1