diff options
author | Teravus Ovares | 2008-05-25 02:39:58 +0000 |
---|---|---|
committer | Teravus Ovares | 2008-05-25 02:39:58 +0000 |
commit | d3b013be1cdbf2c89847a3e900a6eeacdad5486e (patch) | |
tree | 1796d19c3397caa5b92e168a0aa07be4b59b6172 /OpenSim/Region/Physics/Meshing/Mesh.cs | |
parent | * Disabling isSelected check on object persistence backup (at least temporari... (diff) | |
download | opensim-SC_OLD-d3b013be1cdbf2c89847a3e900a6eeacdad5486e.zip opensim-SC_OLD-d3b013be1cdbf2c89847a3e900a6eeacdad5486e.tar.gz opensim-SC_OLD-d3b013be1cdbf2c89847a3e900a6eeacdad5486e.tar.bz2 opensim-SC_OLD-d3b013be1cdbf2c89847a3e900a6eeacdad5486e.tar.xz |
* Releases Pinned vertex/index list in ODE on next mesh request.
Diffstat (limited to 'OpenSim/Region/Physics/Meshing/Mesh.cs')
-rw-r--r-- | OpenSim/Region/Physics/Meshing/Mesh.cs | 14 |
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 | { |