aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Physics/OdePlugin/ODEPrim.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/Physics/OdePlugin/ODEPrim.cs')
-rw-r--r--OpenSim/Region/Physics/OdePlugin/ODEPrim.cs13
1 files changed, 6 insertions, 7 deletions
diff --git a/OpenSim/Region/Physics/OdePlugin/ODEPrim.cs b/OpenSim/Region/Physics/OdePlugin/ODEPrim.cs
index 86ed3bd..08aa32b 100644
--- a/OpenSim/Region/Physics/OdePlugin/ODEPrim.cs
+++ b/OpenSim/Region/Physics/OdePlugin/ODEPrim.cs
@@ -824,18 +824,17 @@ namespace OpenSim.Region.Physics.OdePlugin
824 } 824 }
825 } 825 }
826 826
827 float[] vertexList = mesh.getVertexListAsFloatLocked(); // Note, that vertextList is pinned in memory 827 IntPtr vertices, indices;
828 int[] indexList = mesh.getIndexListAsIntLocked(); // Also pinned, needs release after usage 828 int vertexCount, indexCount;
829 int vertexStride, triStride;
830 mesh.getVertexListAsPtrToFloatArray( out vertices, out vertexStride, out vertexCount ); // Note, that vertices are fixed in unmanaged heap
831 mesh.getIndexListAsPtrToIntArray( out indices, out triStride, out indexCount ); // Also fixed, needs release after usage
829 832
830 mesh.releaseSourceMeshData(); // free up the original mesh data to save memory 833 mesh.releaseSourceMeshData(); // free up the original mesh data to save memory
831 834
832 int VertexCount = vertexList.GetLength(0)/3;
833 int IndexCount = indexList.GetLength(0);
834
835 _triMeshData = d.GeomTriMeshDataCreate(); 835 _triMeshData = d.GeomTriMeshDataCreate();
836 836
837 d.GeomTriMeshDataBuildSimple(_triMeshData, vertexList, 3*sizeof (float), VertexCount, indexList, IndexCount, 837 d.GeomTriMeshDataBuildSimple(_triMeshData, vertices, vertexStride, vertexCount, indices, indexCount, triStride);
838 3*sizeof (int));
839 d.GeomTriMeshDataPreprocess(_triMeshData); 838 d.GeomTriMeshDataPreprocess(_triMeshData);
840 839
841 _parent_scene.waitForSpaceUnlock(m_targetSpace); 840 _parent_scene.waitForSpaceUnlock(m_targetSpace);