aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Physics/Meshing/Mesh.cs
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--OpenSim/Region/Physics/Meshing/Mesh.cs14
1 files changed, 11 insertions, 3 deletions
diff --git a/OpenSim/Region/Physics/Meshing/Mesh.cs b/OpenSim/Region/Physics/Meshing/Mesh.cs
index 1b0444b..652bbd7 100644
--- a/OpenSim/Region/Physics/Meshing/Mesh.cs
+++ b/OpenSim/Region/Physics/Meshing/Mesh.cs
@@ -37,7 +37,8 @@ namespace OpenSim.Region.Physics.Meshing
37 { 37 {
38 public List<Vertex> vertices; 38 public List<Vertex> vertices;
39 public List<Triangle> triangles; 39 public List<Triangle> triangles;
40 40 GCHandle pinnedVirtexes;
41 GCHandle pinnedIndex;
41 public float[] normals; 42 public float[] normals;
42 43
43 public Mesh() 44 public Mesh()
@@ -164,7 +165,7 @@ namespace OpenSim.Region.Physics.Meshing
164 result[3*i + 1] = v.Y; 165 result[3*i + 1] = v.Y;
165 result[3*i + 2] = v.Z; 166 result[3*i + 2] = v.Z;
166 } 167 }
167 GCHandle.Alloc(result, GCHandleType.Pinned); 168 pinnedVirtexes = GCHandle.Alloc(result, GCHandleType.Pinned);
168 return result; 169 return result;
169 } 170 }
170 171
@@ -184,10 +185,17 @@ namespace OpenSim.Region.Physics.Meshing
184 public int[] getIndexListAsIntLocked() 185 public int[] getIndexListAsIntLocked()
185 { 186 {
186 int[] result = getIndexListAsInt(); 187 int[] result = getIndexListAsInt();
187 GCHandle.Alloc(result, GCHandleType.Pinned); 188 pinnedIndex = GCHandle.Alloc(result, GCHandleType.Pinned);
188 return result; 189 return result;
189 } 190 }
190 191
192 public void releasePinned()
193 {
194 pinnedVirtexes.Free();
195 pinnedIndex.Free();
196
197 }
198
191 199
192 public void Append(Mesh newMesh) 200 public void Append(Mesh newMesh)
193 { 201 {