From 35ad484b6b2d0e47d16eaf3e846b4982e86fe050 Mon Sep 17 00:00:00 2001 From: Dahlia Trimble Date: Fri, 29 Aug 2008 08:19:47 +0000 Subject: 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. --- OpenSim/Region/Physics/Meshing/Mesh.cs | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) (limited to 'OpenSim/Region/Physics/Meshing/Mesh.cs') 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 for (int i = 0; i < count; i++) { Coord c = primMesh.coords[i]; - int resultIndex = 3 * i; - result[resultIndex++] = c.X; - result[resultIndex++] = c.Y; - result[resultIndex] = c.Z; + { + int resultIndex = 3 * i; + result[resultIndex] = c.X; + result[resultIndex + 1] = c.Y; + result[resultIndex + 2] = c.Z; + } } - //primMesh.coords = null; pinnedVirtexes = GCHandle.Alloc(result, GCHandleType.Pinned); } return result; @@ -213,12 +214,15 @@ namespace OpenSim.Region.Physics.Meshing for (int i = 0; i < numFaces; i++) { Face f = primMesh.faces[i]; + Coord c1 = primMesh.coords[f.v1]; + Coord c2 = primMesh.coords[f.v2]; + Coord c3 = primMesh.coords[f.v3]; + int resultIndex = i * 3; - result[resultIndex++] = f.v1; - result[resultIndex++] = f.v2; - result[resultIndex] = f.v3; + result[resultIndex] = f.v1; + result[resultIndex + 1] = f.v2; + result[resultIndex + 2] = f.v3; } - //primMesh.faces = null; } return result; } -- cgit v1.1