aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Physics/OdePlugin/ODEPrim.cs
diff options
context:
space:
mode:
authorTeravus Ovares2008-05-25 02:39:58 +0000
committerTeravus Ovares2008-05-25 02:39:58 +0000
commitd3b013be1cdbf2c89847a3e900a6eeacdad5486e (patch)
tree1796d19c3397caa5b92e168a0aa07be4b59b6172 /OpenSim/Region/Physics/OdePlugin/ODEPrim.cs
parent* Disabling isSelected check on object persistence backup (at least temporari... (diff)
downloadopensim-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/OdePlugin/ODEPrim.cs')
-rw-r--r--OpenSim/Region/Physics/OdePlugin/ODEPrim.cs17
1 files changed, 15 insertions, 2 deletions
diff --git a/OpenSim/Region/Physics/OdePlugin/ODEPrim.cs b/OpenSim/Region/Physics/OdePlugin/ODEPrim.cs
index 1ba4bb1..4c8eb20 100644
--- a/OpenSim/Region/Physics/OdePlugin/ODEPrim.cs
+++ b/OpenSim/Region/Physics/OdePlugin/ODEPrim.cs
@@ -69,6 +69,7 @@ namespace OpenSim.Region.Physics.OdePlugin
69 private float PID_G = 25f; 69 private float PID_G = 25f;
70 private float m_tensor = 5f; 70 private float m_tensor = 5f;
71 private int body_autodisable_frames = 20; 71 private int body_autodisable_frames = 20;
72 private IMesh primMesh = null;
72 73
73 private bool m_usePID = false; 74 private bool m_usePID = false;
74 75
@@ -674,8 +675,13 @@ namespace OpenSim.Region.Physics.OdePlugin
674 disableBody(); 675 disableBody();
675 } 676 }
676 677
677 float[] vertexList = mesh.getVertexListAsFloatLocked(); // Note, that vertextList is pinned in memory 678 IMesh oldMesh = primMesh;
678 int[] indexList = mesh.getIndexListAsIntLocked(); // Also pinned, needs release after usage 679
680 primMesh = mesh;
681
682 float[] vertexList = primMesh.getVertexListAsFloatLocked(); // Note, that vertextList is pinned in memory
683 int[] indexList = primMesh.getIndexListAsIntLocked(); // Also pinned, needs release after usage
684
679 int VertexCount = vertexList.GetLength(0)/3; 685 int VertexCount = vertexList.GetLength(0)/3;
680 int IndexCount = indexList.GetLength(0); 686 int IndexCount = indexList.GetLength(0);
681 687
@@ -699,6 +705,13 @@ namespace OpenSim.Region.Physics.OdePlugin
699 m_log.Error("[PHYSICS]: MESH LOCKED"); 705 m_log.Error("[PHYSICS]: MESH LOCKED");
700 return; 706 return;
701 } 707 }
708
709 if (oldMesh != null)
710 {
711 oldMesh.releasePinned();
712 oldMesh = null;
713 }
714
702 if (IsPhysical && Body == (IntPtr) 0) 715 if (IsPhysical && Body == (IntPtr) 0)
703 { 716 {
704 // Recreate the body 717 // Recreate the body