aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/PhysicsModules/ubOde/ODEScene.cs
diff options
context:
space:
mode:
authorUbitUmarov2017-04-15 01:21:47 +0100
committerUbitUmarov2017-04-15 01:21:47 +0100
commit4f8f04d9499f040631a4056dfd11aa2ff95761dd (patch)
tree0df69bb6987d3c53e7542c243d57884144413e14 /OpenSim/Region/PhysicsModules/ubOde/ODEScene.cs
parentincrease the updates priority of linkset where avatar is sitting (diff)
downloadopensim-SC-4f8f04d9499f040631a4056dfd11aa2ff95761dd.zip
opensim-SC-4f8f04d9499f040631a4056dfd11aa2ff95761dd.tar.gz
opensim-SC-4f8f04d9499f040631a4056dfd11aa2ff95761dd.tar.bz2
opensim-SC-4f8f04d9499f040631a4056dfd11aa2ff95761dd.tar.xz
still issues with volume detectors and sleeping bodies
Diffstat (limited to 'OpenSim/Region/PhysicsModules/ubOde/ODEScene.cs')
-rw-r--r--OpenSim/Region/PhysicsModules/ubOde/ODEScene.cs50
1 files changed, 33 insertions, 17 deletions
diff --git a/OpenSim/Region/PhysicsModules/ubOde/ODEScene.cs b/OpenSim/Region/PhysicsModules/ubOde/ODEScene.cs
index 4a82f77..883038f 100644
--- a/OpenSim/Region/PhysicsModules/ubOde/ODEScene.cs
+++ b/OpenSim/Region/PhysicsModules/ubOde/ODEScene.cs
@@ -1668,11 +1668,15 @@ namespace OpenSim.Region.PhysicsModule.ubOde
1668 1668
1669// d.WorldSetQuickStepNumIterations(world, curphysiteractions); 1669// d.WorldSetQuickStepNumIterations(world, curphysiteractions);
1670 1670
1671 int loopstartMS = Util.EnvironmentTickCount(); 1671 double loopstartMS = Util.GetTimeStampMS();
1672 int looptimeMS = 0; 1672 double looptimeMS = 0;
1673 int changestimeMS = 0; 1673 double changestimeMS = 0;
1674 int maxChangestime = (int)(reqTimeStep * 500f); // half the time 1674 double maxChangestime = (int)(reqTimeStep * 500f); // half the time
1675 int maxLoopTime = (int)(reqTimeStep * 1200f); // 1.2 the time 1675 double maxLoopTime = (int)(reqTimeStep * 1200f); // 1.2 the time
1676
1677// double collisionTime = 0;
1678// double qstepTIme = 0;
1679// double tmpTime = 0;
1676 1680
1677 d.AllocateODEDataForThread(~0U); 1681 d.AllocateODEDataForThread(~0U);
1678 1682
@@ -1695,7 +1699,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde
1695 item.actor.Name, item.what.ToString()); 1699 item.actor.Name, item.what.ToString());
1696 } 1700 }
1697 } 1701 }
1698 changestimeMS = Util.EnvironmentTickCountSubtract(loopstartMS); 1702 changestimeMS = Util.GetTimeStampMS() - loopstartMS;
1699 if (changestimeMS > maxChangestime) 1703 if (changestimeMS > maxChangestime)
1700 break; 1704 break;
1701 } 1705 }
@@ -1740,9 +1744,19 @@ namespace OpenSim.Region.PhysicsModule.ubOde
1740 1744
1741 m_rayCastManager.ProcessQueuedRequests(); 1745 m_rayCastManager.ProcessQueuedRequests();
1742 1746
1747// tmpTime = Util.GetTimeStampMS();
1743 collision_optimized(); 1748 collision_optimized();
1744 List<OdePrim> sleepers = new List<OdePrim>(); 1749// collisionTime += Util.GetTimeStampMS() - tmpTime;
1750
1751 lock(_collisionEventPrimRemove)
1752 {
1753 foreach (PhysicsActor obj in _collisionEventPrimRemove)
1754 _collisionEventPrim.Remove(obj);
1755
1756 _collisionEventPrimRemove.Clear();
1757 }
1745 1758
1759 List<OdePrim> sleepers = new List<OdePrim>();
1746 foreach (PhysicsActor obj in _collisionEventPrim) 1760 foreach (PhysicsActor obj in _collisionEventPrim)
1747 { 1761 {
1748 if (obj == null) 1762 if (obj == null)
@@ -1772,18 +1786,12 @@ namespace OpenSim.Region.PhysicsModule.ubOde
1772 foreach(OdePrim prm in sleepers) 1786 foreach(OdePrim prm in sleepers)
1773 prm.SleeperAddCollisionEvents(); 1787 prm.SleeperAddCollisionEvents();
1774 sleepers.Clear(); 1788 sleepers.Clear();
1775 1789
1776 lock(_collisionEventPrimRemove)
1777 {
1778 foreach (PhysicsActor obj in _collisionEventPrimRemove)
1779 _collisionEventPrim.Remove(obj);
1780
1781 _collisionEventPrimRemove.Clear();
1782 }
1783
1784 // do a ode simulation step 1790 // do a ode simulation step
1791// tmpTime = Util.GetTimeStampMS();
1785 d.WorldQuickStep(world, ODE_STEPSIZE); 1792 d.WorldQuickStep(world, ODE_STEPSIZE);
1786 d.JointGroupEmpty(contactgroup); 1793 d.JointGroupEmpty(contactgroup);
1794// qstepTIme += Util.GetTimeStampMS() - tmpTime;
1787 1795
1788 // update managed ideia of physical data and do updates to core 1796 // update managed ideia of physical data and do updates to core
1789 /* 1797 /*
@@ -1824,7 +1832,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde
1824 step_time -= ODE_STEPSIZE; 1832 step_time -= ODE_STEPSIZE;
1825 nodeframes++; 1833 nodeframes++;
1826 1834
1827 looptimeMS = Util.EnvironmentTickCountSubtract(loopstartMS); 1835 looptimeMS = Util.GetTimeStampMS() - loopstartMS;
1828 if (looptimeMS > maxLoopTime) 1836 if (looptimeMS > maxLoopTime)
1829 break; 1837 break;
1830 } 1838 }
@@ -1893,6 +1901,14 @@ namespace OpenSim.Region.PhysicsModule.ubOde
1893 int nbodies = d.NTotalBodies; 1901 int nbodies = d.NTotalBodies;
1894 int ngeoms = d.NTotalGeoms; 1902 int ngeoms = d.NTotalGeoms;
1895*/ 1903*/
1904/*
1905 looptimeMS /= nodeframes;
1906 if(looptimeMS > 0.080)
1907 {
1908 collisionTime /= nodeframes;
1909 qstepTIme /= nodeframes;
1910 }
1911*/
1896 // Finished with all sim stepping. If requested, dump world state to file for debugging. 1912 // Finished with all sim stepping. If requested, dump world state to file for debugging.
1897 // TODO: This call to the export function is already inside lock (OdeLock) - but is an extra lock needed? 1913 // TODO: This call to the export function is already inside lock (OdeLock) - but is an extra lock needed?
1898 // TODO: This overwrites all dump files in-place. Should this be a growing logfile, or separate snapshots? 1914 // TODO: This overwrites all dump files in-place. Should this be a growing logfile, or separate snapshots?