diff options
author | Melanie | 2009-10-05 12:58:52 +0100 |
---|---|---|
committer | Melanie | 2009-10-05 12:58:52 +0100 |
commit | 8d5a40aad03cb0f46aa90a90e3e8d9464041faf7 (patch) | |
tree | 05e5908228936457563e031bbaa1d4a65b9c2544 /OpenSim/Region/Physics/OdePlugin/ODEPrim.cs | |
parent | Fix build break (diff) | |
parent | Eliminate pinned Mesh data on managed heap by using IntPtrs to memory allocat... (diff) | |
download | opensim-SC_OLD-8d5a40aad03cb0f46aa90a90e3e8d9464041faf7.zip opensim-SC_OLD-8d5a40aad03cb0f46aa90a90e3e8d9464041faf7.tar.gz opensim-SC_OLD-8d5a40aad03cb0f46aa90a90e3e8d9464041faf7.tar.bz2 opensim-SC_OLD-8d5a40aad03cb0f46aa90a90e3e8d9464041faf7.tar.xz |
Merge branch 'master' into vehicles
Diffstat (limited to 'OpenSim/Region/Physics/OdePlugin/ODEPrim.cs')
-rw-r--r-- | OpenSim/Region/Physics/OdePlugin/ODEPrim.cs | 13 |
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); |