diff options
Diffstat (limited to 'OpenSim/Region/Physics/Meshing/Mesh.cs')
-rw-r--r-- | OpenSim/Region/Physics/Meshing/Mesh.cs | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/OpenSim/Region/Physics/Meshing/Mesh.cs b/OpenSim/Region/Physics/Meshing/Mesh.cs index 4c3cf33..f781ff9 100644 --- a/OpenSim/Region/Physics/Meshing/Mesh.cs +++ b/OpenSim/Region/Physics/Meshing/Mesh.cs | |||
@@ -31,6 +31,7 @@ using System.IO; | |||
31 | using System.Runtime.InteropServices; | 31 | using System.Runtime.InteropServices; |
32 | using OpenSim.Region.Physics.Manager; | 32 | using OpenSim.Region.Physics.Manager; |
33 | using PrimMesher; | 33 | using PrimMesher; |
34 | using OpenMetaverse; | ||
34 | 35 | ||
35 | namespace OpenSim.Region.Physics.Meshing | 36 | namespace OpenSim.Region.Physics.Meshing |
36 | { | 37 | { |
@@ -141,12 +142,12 @@ namespace OpenSim.Region.Physics.Meshing | |||
141 | } | 142 | } |
142 | } | 143 | } |
143 | 144 | ||
144 | public List<PhysicsVector> getVertexList() | 145 | public List<Vector3> getVertexList() |
145 | { | 146 | { |
146 | List<PhysicsVector> result = new List<PhysicsVector>(); | 147 | List<Vector3> result = new List<Vector3>(); |
147 | foreach (Vertex v in m_vertices.Keys) | 148 | foreach (Vertex v in m_vertices.Keys) |
148 | { | 149 | { |
149 | result.Add(v); | 150 | result.Add(new Vector3(v.X, v.Y, v.Z)); |
150 | } | 151 | } |
151 | return result; | 152 | return result; |
152 | } | 153 | } |
@@ -174,6 +175,9 @@ namespace OpenSim.Region.Physics.Meshing | |||
174 | 175 | ||
175 | float[] result = getVertexListAsFloat(); | 176 | float[] result = getVertexListAsFloat(); |
176 | m_pinnedVertexes = GCHandle.Alloc(result, GCHandleType.Pinned); | 177 | m_pinnedVertexes = GCHandle.Alloc(result, GCHandleType.Pinned); |
178 | // Inform the garbage collector of this unmanaged allocation so it can schedule | ||
179 | // the next GC round more intelligently | ||
180 | GC.AddMemoryPressure(Buffer.ByteLength(result)); | ||
177 | 181 | ||
178 | return result; | 182 | return result; |
179 | } | 183 | } |
@@ -223,6 +227,9 @@ namespace OpenSim.Region.Physics.Meshing | |||
223 | 227 | ||
224 | int[] result = getIndexListAsInt(); | 228 | int[] result = getIndexListAsInt(); |
225 | m_pinnedIndex = GCHandle.Alloc(result, GCHandleType.Pinned); | 229 | m_pinnedIndex = GCHandle.Alloc(result, GCHandleType.Pinned); |
230 | // Inform the garbage collector of this unmanaged allocation so it can schedule | ||
231 | // the next GC round more intelligently | ||
232 | GC.AddMemoryPressure(Buffer.ByteLength(result)); | ||
226 | 233 | ||
227 | return result; | 234 | return result; |
228 | } | 235 | } |