diff options
-rw-r--r-- | OpenSim/Region/Framework/Scenes/EventManager.cs | 2 | ||||
-rw-r--r-- | OpenSim/Region/Framework/Scenes/Scene.cs | 10 | ||||
-rw-r--r-- | OpenSim/Region/Physics/UbitOdePlugin/ODEMeshWorker.cs | 5 | ||||
-rw-r--r-- | OpenSim/Region/Physics/UbitOdePlugin/ODEPrim.cs | 2 | ||||
-rw-r--r-- | OpenSim/Region/Physics/UbitOdePlugin/OdeScene.cs | 28 |
5 files changed, 33 insertions, 14 deletions
diff --git a/OpenSim/Region/Framework/Scenes/EventManager.cs b/OpenSim/Region/Framework/Scenes/EventManager.cs index eee5960..7916c42 100644 --- a/OpenSim/Region/Framework/Scenes/EventManager.cs +++ b/OpenSim/Region/Framework/Scenes/EventManager.cs | |||
@@ -2458,6 +2458,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
2458 | { | 2458 | { |
2459 | foreach (Action<Scene> d in handler.GetInvocationList()) | 2459 | foreach (Action<Scene> d in handler.GetInvocationList()) |
2460 | { | 2460 | { |
2461 | m_log.InfoFormat("[EVENT MANAGER]: TriggerSceneShuttingDown invoque {0}", d.Method.Name.ToString()); | ||
2461 | try | 2462 | try |
2462 | { | 2463 | { |
2463 | d(s); | 2464 | d(s); |
@@ -2470,6 +2471,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
2470 | } | 2471 | } |
2471 | } | 2472 | } |
2472 | } | 2473 | } |
2474 | m_log.Info("[EVENT MANAGER]: TriggerSceneShuttingDown done"); | ||
2473 | } | 2475 | } |
2474 | 2476 | ||
2475 | public void TriggerOnRegionStarted(Scene scene) | 2477 | public void TriggerOnRegionStarted(Scene scene) |
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index 05ce00a..649d545 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs | |||
@@ -1255,9 +1255,11 @@ namespace OpenSim.Region.Framework.Scenes | |||
1255 | // Stop all client threads. | 1255 | // Stop all client threads. |
1256 | ForEachScenePresence(delegate(ScenePresence avatar) { avatar.ControllingClient.Close(); }); | 1256 | ForEachScenePresence(delegate(ScenePresence avatar) { avatar.ControllingClient.Close(); }); |
1257 | 1257 | ||
1258 | m_log.Debug("[SCENE]: Persisting changed objects"); | 1258 | m_log.Debug("[SCENE]: TriggerSceneShuttingDown"); |
1259 | EventManager.TriggerSceneShuttingDown(this); | 1259 | EventManager.TriggerSceneShuttingDown(this); |
1260 | 1260 | ||
1261 | m_log.Debug("[SCENE]: Persisting changed objects"); | ||
1262 | |||
1261 | EntityBase[] entities = GetEntities(); | 1263 | EntityBase[] entities = GetEntities(); |
1262 | foreach (EntityBase entity in entities) | 1264 | foreach (EntityBase entity in entities) |
1263 | { | 1265 | { |
@@ -1267,10 +1269,12 @@ namespace OpenSim.Region.Framework.Scenes | |||
1267 | } | 1269 | } |
1268 | } | 1270 | } |
1269 | 1271 | ||
1272 | m_log.Debug("[SCENE]: Graph close"); | ||
1270 | m_sceneGraph.Close(); | 1273 | m_sceneGraph.Close(); |
1271 | 1274 | ||
1272 | if (PhysicsScene != null) | 1275 | if (PhysicsScene != null) |
1273 | { | 1276 | { |
1277 | m_log.Debug("[SCENE]: Dispose Physics"); | ||
1274 | PhysicsScene phys = PhysicsScene; | 1278 | PhysicsScene phys = PhysicsScene; |
1275 | // remove the physics engine from both Scene and SceneGraph | 1279 | // remove the physics engine from both Scene and SceneGraph |
1276 | PhysicsScene = null; | 1280 | PhysicsScene = null; |
@@ -1282,6 +1286,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
1282 | m_log.WarnFormat("[SCENE]: Deregister from grid failed for region {0}", Name); | 1286 | m_log.WarnFormat("[SCENE]: Deregister from grid failed for region {0}", Name); |
1283 | 1287 | ||
1284 | // call the base class Close method. | 1288 | // call the base class Close method. |
1289 | m_log.Debug("[SCENE]: Base close"); | ||
1285 | base.Close(); | 1290 | base.Close(); |
1286 | } | 1291 | } |
1287 | 1292 | ||
@@ -1317,6 +1322,9 @@ namespace OpenSim.Region.Framework.Scenes | |||
1317 | } | 1322 | } |
1318 | // m_lastUpdate = Util.EnvironmentTickCount(); | 1323 | // m_lastUpdate = Util.EnvironmentTickCount(); |
1319 | 1324 | ||
1325 | // m_sceneGraph.PreparePhysicsSimulation(); | ||
1326 | |||
1327 | |||
1320 | m_heartbeatThread | 1328 | m_heartbeatThread |
1321 | = Watchdog.StartThread( | 1329 | = Watchdog.StartThread( |
1322 | Heartbeat, string.Format("Heartbeat ({0})", RegionInfo.RegionName), ThreadPriority.Normal, false, false); | 1330 | Heartbeat, string.Format("Heartbeat ({0})", RegionInfo.RegionName), ThreadPriority.Normal, false, false); |
diff --git a/OpenSim/Region/Physics/UbitOdePlugin/ODEMeshWorker.cs b/OpenSim/Region/Physics/UbitOdePlugin/ODEMeshWorker.cs index 73dd2fd..5030cec 100644 --- a/OpenSim/Region/Physics/UbitOdePlugin/ODEMeshWorker.cs +++ b/OpenSim/Region/Physics/UbitOdePlugin/ODEMeshWorker.cs | |||
@@ -914,8 +914,9 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
914 | if (repData.pbs.SculptTexture != repData.assetID) | 914 | if (repData.pbs.SculptTexture != repData.assetID) |
915 | return; | 915 | return; |
916 | 916 | ||
917 | repData.pbs.SculptData = new byte[asset.Data.Length]; | 917 | // repData.pbs.SculptData = new byte[asset.Data.Length]; |
918 | asset.Data.CopyTo(repData.pbs.SculptData,0); | 918 | // asset.Data.CopyTo(repData.pbs.SculptData,0); |
919 | repData.pbs.SculptData = asset.Data; | ||
919 | repData.meshState = MeshState.AssetOK; | 920 | repData.meshState = MeshState.AssetOK; |
920 | m_worker.AssetLoaded(repData); | 921 | m_worker.AssetLoaded(repData); |
921 | } | 922 | } |
diff --git a/OpenSim/Region/Physics/UbitOdePlugin/ODEPrim.cs b/OpenSim/Region/Physics/UbitOdePlugin/ODEPrim.cs index ce67cc4..76e42d4 100644 --- a/OpenSim/Region/Physics/UbitOdePlugin/ODEPrim.cs +++ b/OpenSim/Region/Physics/UbitOdePlugin/ODEPrim.cs | |||
@@ -1108,6 +1108,8 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
1108 | ODEPhysRepData repData = _parent_scene.m_meshWorker.NewActorPhysRep(this, _pbs, _size, m_shapetype); | 1108 | ODEPhysRepData repData = _parent_scene.m_meshWorker.NewActorPhysRep(this, _pbs, _size, m_shapetype); |
1109 | 1109 | ||
1110 | primVolume = repData.volume; | 1110 | primVolume = repData.volume; |
1111 | m_OBB = repData.OBB; | ||
1112 | m_OBBOffset = repData.OBBOffset; | ||
1111 | 1113 | ||
1112 | UpdatePrimBodyData(); | 1114 | UpdatePrimBodyData(); |
1113 | } | 1115 | } |
diff --git a/OpenSim/Region/Physics/UbitOdePlugin/OdeScene.cs b/OpenSim/Region/Physics/UbitOdePlugin/OdeScene.cs index b98f177..54bc29f 100644 --- a/OpenSim/Region/Physics/UbitOdePlugin/OdeScene.cs +++ b/OpenSim/Region/Physics/UbitOdePlugin/OdeScene.cs | |||
@@ -1689,11 +1689,10 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
1689 | /// <returns></returns> | 1689 | /// <returns></returns> |
1690 | public override float Simulate(float timeStep) | 1690 | public override float Simulate(float timeStep) |
1691 | { | 1691 | { |
1692 | |||
1693 | DateTime now = DateTime.UtcNow; | 1692 | DateTime now = DateTime.UtcNow; |
1694 | TimeSpan timedif = now - m_lastframe; | 1693 | TimeSpan timedif = now - m_lastframe; |
1695 | m_lastframe = now; | ||
1696 | timeStep = (float)timedif.TotalSeconds; | 1694 | timeStep = (float)timedif.TotalSeconds; |
1695 | m_lastframe = now; | ||
1697 | 1696 | ||
1698 | // acumulate time so we can reduce error | 1697 | // acumulate time so we can reduce error |
1699 | step_time += timeStep; | 1698 | step_time += timeStep; |
@@ -1704,6 +1703,7 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
1704 | if (framecount < 0) | 1703 | if (framecount < 0) |
1705 | framecount = 0; | 1704 | framecount = 0; |
1706 | 1705 | ||
1706 | |||
1707 | framecount++; | 1707 | framecount++; |
1708 | 1708 | ||
1709 | int curphysiteractions; | 1709 | int curphysiteractions; |
@@ -1714,9 +1714,8 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
1714 | else | 1714 | else |
1715 | curphysiteractions = m_physicsiterations; | 1715 | curphysiteractions = m_physicsiterations; |
1716 | 1716 | ||
1717 | int nodeframes = 0; | ||
1718 | |||
1719 | // checkThread(); | 1717 | // checkThread(); |
1718 | int nodeframes = 0; | ||
1720 | 1719 | ||
1721 | lock (SimulationLock) | 1720 | lock (SimulationLock) |
1722 | lock(OdeLock) | 1721 | lock(OdeLock) |
@@ -1733,7 +1732,11 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
1733 | 1732 | ||
1734 | d.WorldSetQuickStepNumIterations(world, curphysiteractions); | 1733 | d.WorldSetQuickStepNumIterations(world, curphysiteractions); |
1735 | 1734 | ||
1736 | while (step_time > HalfOdeStep && nodeframes < 10) //limit number of steps so we don't say here for ever | 1735 | int loopstartMS = Util.EnvironmentTickCount(); |
1736 | int looptimeMS = 0; | ||
1737 | |||
1738 | |||
1739 | while (step_time > HalfOdeStep) | ||
1737 | { | 1740 | { |
1738 | try | 1741 | try |
1739 | { | 1742 | { |
@@ -1742,9 +1745,8 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
1742 | 1745 | ||
1743 | if (ChangesQueue.Count > 0) | 1746 | if (ChangesQueue.Count > 0) |
1744 | { | 1747 | { |
1745 | int ttmpstart = Util.EnvironmentTickCount(); | 1748 | int changestartMS = Util.EnvironmentTickCount(); |
1746 | int ttmp; | 1749 | int ttmp; |
1747 | |||
1748 | while (ChangesQueue.Dequeue(out item)) | 1750 | while (ChangesQueue.Dequeue(out item)) |
1749 | { | 1751 | { |
1750 | if (item.actor != null) | 1752 | if (item.actor != null) |
@@ -1762,7 +1764,7 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
1762 | item.actor.Name, item.what.ToString()); | 1764 | item.actor.Name, item.what.ToString()); |
1763 | } | 1765 | } |
1764 | } | 1766 | } |
1765 | ttmp = Util.EnvironmentTickCountSubtract(ttmpstart); | 1767 | ttmp = Util.EnvironmentTickCountSubtract(changestartMS); |
1766 | if (ttmp > 20) | 1768 | if (ttmp > 20) |
1767 | break; | 1769 | break; |
1768 | } | 1770 | } |
@@ -1873,9 +1875,12 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
1873 | // ode.dunlock(world); | 1875 | // ode.dunlock(world); |
1874 | } | 1876 | } |
1875 | 1877 | ||
1876 | |||
1877 | step_time -= ODE_STEPSIZE; | 1878 | step_time -= ODE_STEPSIZE; |
1878 | nodeframes++; | 1879 | nodeframes++; |
1880 | |||
1881 | looptimeMS = Util.EnvironmentTickCountSubtract(loopstartMS); | ||
1882 | if (looptimeMS > 100) | ||
1883 | break; | ||
1879 | } | 1884 | } |
1880 | 1885 | ||
1881 | lock (_badCharacter) | 1886 | lock (_badCharacter) |
@@ -1963,7 +1968,7 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
1963 | 1968 | ||
1964 | // think time dilation as to do with dinamic step size that we dont' have | 1969 | // think time dilation as to do with dinamic step size that we dont' have |
1965 | // even so tell something to world | 1970 | // even so tell something to world |
1966 | if (nodeframes < 10) // we did the requested loops | 1971 | if (looptimeMS < 100) // we did the requested loops |
1967 | m_timeDilation = 1.0f; | 1972 | m_timeDilation = 1.0f; |
1968 | else if (step_time > 0) | 1973 | else if (step_time > 0) |
1969 | { | 1974 | { |
@@ -1972,6 +1977,7 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
1972 | m_timeDilation = 1; | 1977 | m_timeDilation = 1; |
1973 | if (step_time > m_SkipFramesAtms) | 1978 | if (step_time > m_SkipFramesAtms) |
1974 | step_time = 0; | 1979 | step_time = 0; |
1980 | m_lastframe = DateTime.UtcNow; // skip also the time lost | ||
1975 | } | 1981 | } |
1976 | } | 1982 | } |
1977 | 1983 | ||
@@ -2344,7 +2350,7 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
2344 | } | 2350 | } |
2345 | } | 2351 | } |
2346 | } | 2352 | } |
2347 | IntPtr HeightmapData = d.GeomHeightfieldDataCreate(); | 2353 | IntPtr HeightmapData = d.GeomUbitTerrainDataCreate(); |
2348 | 2354 | ||
2349 | const int wrap = 0; | 2355 | const int wrap = 0; |
2350 | float thickness = hfmin; | 2356 | float thickness = hfmin; |