diff options
author | UbitUmarov | 2012-10-28 11:55:11 +0000 |
---|---|---|
committer | UbitUmarov | 2012-10-28 11:55:11 +0000 |
commit | 8bb29054165b1fa3284b200ca6682eb1c81e977f (patch) | |
tree | 9c97db916b3a724954466d8a6ae3bd166d47f58e /OpenSim/Region/Physics/UbitOdePlugin/OdeScene.cs | |
parent | more debug (diff) | |
download | opensim-SC-8bb29054165b1fa3284b200ca6682eb1c81e977f.zip opensim-SC-8bb29054165b1fa3284b200ca6682eb1c81e977f.tar.gz opensim-SC-8bb29054165b1fa3284b200ca6682eb1c81e977f.tar.bz2 opensim-SC-8bb29054165b1fa3284b200ca6682eb1c81e977f.tar.xz |
test limit ode exec time by time not number of loops done
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Region/Physics/UbitOdePlugin/OdeScene.cs | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/OpenSim/Region/Physics/UbitOdePlugin/OdeScene.cs b/OpenSim/Region/Physics/UbitOdePlugin/OdeScene.cs index cce8946..5e01ff1 100644 --- a/OpenSim/Region/Physics/UbitOdePlugin/OdeScene.cs +++ b/OpenSim/Region/Physics/UbitOdePlugin/OdeScene.cs | |||
@@ -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 | { |