aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Physics/Meshing/Mesh.cs
diff options
context:
space:
mode:
authorDahlia Trimble2008-08-29 08:19:47 +0000
committerDahlia Trimble2008-08-29 08:19:47 +0000
commit35ad484b6b2d0e47d16eaf3e846b4982e86fe050 (patch)
treecd56f2bb7cb9f5aa8377b2114162e13f0020604b /OpenSim/Region/Physics/Meshing/Mesh.cs
parentMantis #1903 (diff)
downloadopensim-SC-35ad484b6b2d0e47d16eaf3e846b4982e86fe050.zip
opensim-SC-35ad484b6b2d0e47d16eaf3e846b4982e86fe050.tar.gz
opensim-SC-35ad484b6b2d0e47d16eaf3e846b4982e86fe050.tar.bz2
opensim-SC-35ad484b6b2d0e47d16eaf3e846b4982e86fe050.tar.xz
fixed some ugliness in the conversion from the new mesher format to the old that should speed up region startup a little and maybe even use less memory if the GC decides to play friendly with the other kids.
Diffstat (limited to 'OpenSim/Region/Physics/Meshing/Mesh.cs')
-rw-r--r--OpenSim/Region/Physics/Meshing/Mesh.cs22
1 files changed, 13 insertions, 9 deletions
diff --git a/OpenSim/Region/Physics/Meshing/Mesh.cs b/OpenSim/Region/Physics/Meshing/Mesh.cs
index 4630d98..16ac453 100644
--- a/OpenSim/Region/Physics/Meshing/Mesh.cs
+++ b/OpenSim/Region/Physics/Meshing/Mesh.cs
@@ -179,13 +179,14 @@ namespace OpenSim.Region.Physics.Meshing
179 for (int i = 0; i < count; i++) 179 for (int i = 0; i < count; i++)
180 { 180 {
181 Coord c = primMesh.coords[i]; 181 Coord c = primMesh.coords[i];
182 int resultIndex = 3 * i; 182 {
183 result[resultIndex++] = c.X; 183 int resultIndex = 3 * i;
184 result[resultIndex++] = c.Y; 184 result[resultIndex] = c.X;
185 result[resultIndex] = c.Z; 185 result[resultIndex + 1] = c.Y;
186 result[resultIndex + 2] = c.Z;
187 }
186 188
187 } 189 }
188 //primMesh.coords = null;
189 pinnedVirtexes = GCHandle.Alloc(result, GCHandleType.Pinned); 190 pinnedVirtexes = GCHandle.Alloc(result, GCHandleType.Pinned);
190 } 191 }
191 return result; 192 return result;
@@ -213,12 +214,15 @@ namespace OpenSim.Region.Physics.Meshing
213 for (int i = 0; i < numFaces; i++) 214 for (int i = 0; i < numFaces; i++)
214 { 215 {
215 Face f = primMesh.faces[i]; 216 Face f = primMesh.faces[i];
217 Coord c1 = primMesh.coords[f.v1];
218 Coord c2 = primMesh.coords[f.v2];
219 Coord c3 = primMesh.coords[f.v3];
220
216 int resultIndex = i * 3; 221 int resultIndex = i * 3;
217 result[resultIndex++] = f.v1; 222 result[resultIndex] = f.v1;
218 result[resultIndex++] = f.v2; 223 result[resultIndex + 1] = f.v2;
219 result[resultIndex] = f.v3; 224 result[resultIndex + 2] = f.v3;
220 } 225 }
221 //primMesh.faces = null;
222 } 226 }
223 return result; 227 return result;
224 } 228 }