aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Physics/UbitOdePlugin/OdeScene.cs
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--OpenSim/Region/Physics/UbitOdePlugin/OdeScene.cs19
1 files changed, 15 insertions, 4 deletions
diff --git a/OpenSim/Region/Physics/UbitOdePlugin/OdeScene.cs b/OpenSim/Region/Physics/UbitOdePlugin/OdeScene.cs
index f3ac3ca..3ee5198 100644
--- a/OpenSim/Region/Physics/UbitOdePlugin/OdeScene.cs
+++ b/OpenSim/Region/Physics/UbitOdePlugin/OdeScene.cs
@@ -194,7 +194,8 @@ namespace OpenSim.Region.Physics.OdePlugin
194 private float metersInSpace = 25.6f; 194 private float metersInSpace = 25.6f;
195 private float m_timeDilation = 1.0f; 195 private float m_timeDilation = 1.0f;
196 196
197 DateTime m_lastframe; 197 private DateTime m_lastframe;
198 private DateTime m_lastMeshExpire;
198 199
199 public float gravityx = 0f; 200 public float gravityx = 0f;
200 public float gravityy = 0f; 201 public float gravityy = 0f;
@@ -203,6 +204,8 @@ namespace OpenSim.Region.Physics.OdePlugin
203 private float waterlevel = 0f; 204 private float waterlevel = 0f;
204 private int framecount = 0; 205 private int framecount = 0;
205 206
207 private int m_meshExpireCntr;
208
206// private IntPtr WaterGeom = IntPtr.Zero; 209// private IntPtr WaterGeom = IntPtr.Zero;
207// private IntPtr WaterHeightmapData = IntPtr.Zero; 210// private IntPtr WaterHeightmapData = IntPtr.Zero;
208// private GCHandle WaterMapHandler = new GCHandle(); 211// private GCHandle WaterMapHandler = new GCHandle();
@@ -263,7 +266,6 @@ namespace OpenSim.Region.Physics.OdePlugin
263 const int maxContactsbeforedeath = 4000; 266 const int maxContactsbeforedeath = 4000;
264 private volatile int m_global_contactcount = 0; 267 private volatile int m_global_contactcount = 0;
265 268
266
267 private IntPtr contactgroup; 269 private IntPtr contactgroup;
268 270
269 public ContactData[] m_materialContactsData = new ContactData[8]; 271 public ContactData[] m_materialContactsData = new ContactData[8];
@@ -594,6 +596,7 @@ namespace OpenSim.Region.Physics.OdePlugin
594 } 596 }
595 597
596 m_lastframe = DateTime.UtcNow; 598 m_lastframe = DateTime.UtcNow;
599 m_lastMeshExpire = m_lastframe;
597 } 600 }
598 601
599 internal void waitForSpaceUnlock(IntPtr space) 602 internal void waitForSpaceUnlock(IntPtr space)
@@ -1768,9 +1771,9 @@ namespace OpenSim.Region.Physics.OdePlugin
1768 { 1771 {
1769 1772
1770 DateTime now = DateTime.UtcNow; 1773 DateTime now = DateTime.UtcNow;
1771 TimeSpan SinceLastFrame = now - m_lastframe; 1774 TimeSpan timedif = now - m_lastframe;
1772 m_lastframe = now; 1775 m_lastframe = now;
1773 timeStep = (float)SinceLastFrame.TotalSeconds; 1776 timeStep = (float)timedif.TotalSeconds;
1774 1777
1775 // acumulate time so we can reduce error 1778 // acumulate time so we can reduce error
1776 step_time += timeStep; 1779 step_time += timeStep;
@@ -1972,6 +1975,14 @@ namespace OpenSim.Region.Physics.OdePlugin
1972 _badCharacter.Clear(); 1975 _badCharacter.Clear();
1973 } 1976 }
1974 } 1977 }
1978
1979 timedif = now - m_lastMeshExpire;
1980
1981 if (timedif.Seconds > 10)
1982 {
1983 mesher.ExpireReleaseMeshs();
1984 m_lastMeshExpire = now;
1985 }
1975/* 1986/*
1976 int nactivegeoms = d.SpaceGetNumGeoms(ActiveSpace); 1987 int nactivegeoms = d.SpaceGetNumGeoms(ActiveSpace);
1977 int nstaticgeoms = d.SpaceGetNumGeoms(StaticSpace); 1988 int nstaticgeoms = d.SpaceGetNumGeoms(StaticSpace);