aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Physics/OdePlugin
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/Physics/OdePlugin')
-rw-r--r--OpenSim/Region/Physics/OdePlugin/ODEPrim.cs13
-rw-r--r--OpenSim/Region/Physics/OdePlugin/OdePlugin.cs7
2 files changed, 8 insertions, 12 deletions
diff --git a/OpenSim/Region/Physics/OdePlugin/ODEPrim.cs b/OpenSim/Region/Physics/OdePlugin/ODEPrim.cs
index 032b5df..c041243 100644
--- a/OpenSim/Region/Physics/OdePlugin/ODEPrim.cs
+++ b/OpenSim/Region/Physics/OdePlugin/ODEPrim.cs
@@ -813,18 +813,17 @@ namespace OpenSim.Region.Physics.OdePlugin
813 } 813 }
814 } 814 }
815 815
816 float[] vertexList = mesh.getVertexListAsFloatLocked(); // Note, that vertextList is pinned in memory 816 IntPtr vertices, indices;
817 int[] indexList = mesh.getIndexListAsIntLocked(); // Also pinned, needs release after usage 817 int vertexCount, indexCount;
818 int vertexStride, triStride;
819 mesh.getVertexListAsPtrToFloatArray( out vertices, out vertexStride, out vertexCount ); // Note, that vertices are fixed in unmanaged heap
820 mesh.getIndexListAsPtrToIntArray( out indices, out triStride, out indexCount ); // Also fixed, needs release after usage
818 821
819 mesh.releaseSourceMeshData(); // free up the original mesh data to save memory 822 mesh.releaseSourceMeshData(); // free up the original mesh data to save memory
820 823
821 int VertexCount = vertexList.GetLength(0)/3;
822 int IndexCount = indexList.GetLength(0);
823
824 _triMeshData = d.GeomTriMeshDataCreate(); 824 _triMeshData = d.GeomTriMeshDataCreate();
825 825
826 d.GeomTriMeshDataBuildSimple(_triMeshData, vertexList, 3*sizeof (float), VertexCount, indexList, IndexCount, 826 d.GeomTriMeshDataBuildSimple(_triMeshData, vertices, vertexStride, vertexCount, indices, indexCount, triStride);
827 3*sizeof (int));
828 d.GeomTriMeshDataPreprocess(_triMeshData); 827 d.GeomTriMeshDataPreprocess(_triMeshData);
829 828
830 _parent_scene.waitForSpaceUnlock(m_targetSpace); 829 _parent_scene.waitForSpaceUnlock(m_targetSpace);
diff --git a/OpenSim/Region/Physics/OdePlugin/OdePlugin.cs b/OpenSim/Region/Physics/OdePlugin/OdePlugin.cs
index 0769c90..f5ab1de 100644
--- a/OpenSim/Region/Physics/OdePlugin/OdePlugin.cs
+++ b/OpenSim/Region/Physics/OdePlugin/OdePlugin.cs
@@ -3476,7 +3476,7 @@ namespace OpenSim.Region.Physics.OdePlugin
3476 public override void UnCombine(PhysicsScene pScene) 3476 public override void UnCombine(PhysicsScene pScene)
3477 { 3477 {
3478 IntPtr localGround = IntPtr.Zero; 3478 IntPtr localGround = IntPtr.Zero;
3479 float[] localHeightfield; 3479 //float[] localHeightfield;
3480 bool proceed = false; 3480 bool proceed = false;
3481 List<IntPtr> geomDestroyList = new List<IntPtr>(); 3481 List<IntPtr> geomDestroyList = new List<IntPtr>();
3482 3482
@@ -3771,16 +3771,13 @@ namespace OpenSim.Region.Physics.OdePlugin
3771 sides.Z = 0.5f; 3771 sides.Z = 0.5f;
3772 3772
3773 ds.DrawBox(ref pos, ref R, ref sides); 3773 ds.DrawBox(ref pos, ref R, ref sides);
3774
3775
3776 } 3774 }
3777 } 3775 }
3778 } 3776 }
3779 } 3777 }
3780 3778
3781 public void start(int unused) 3779 public void start(int unused)
3782 { 3780 {
3783
3784 ds.SetViewpoint(ref xyz, ref hpr); 3781 ds.SetViewpoint(ref xyz, ref hpr);
3785 } 3782 }
3786#endif 3783#endif