aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim
diff options
context:
space:
mode:
authorUbitUmarov2017-04-15 01:21:47 +0100
committerUbitUmarov2017-04-15 01:21:47 +0100
commit4f8f04d9499f040631a4056dfd11aa2ff95761dd (patch)
tree0df69bb6987d3c53e7542c243d57884144413e14 /OpenSim
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')
-rw-r--r--OpenSim/Region/PhysicsModules/ubOde/ODEPrim.cs14
-rw-r--r--OpenSim/Region/PhysicsModules/ubOde/ODEScene.cs50
2 files changed, 41 insertions, 23 deletions
diff --git a/OpenSim/Region/PhysicsModules/ubOde/ODEPrim.cs b/OpenSim/Region/PhysicsModules/ubOde/ODEPrim.cs
index 98bea09..f8ee6c0 100644
--- a/OpenSim/Region/PhysicsModules/ubOde/ODEPrim.cs
+++ b/OpenSim/Region/PhysicsModules/ubOde/ODEPrim.cs
@@ -1210,14 +1210,17 @@ namespace OpenSim.Region.PhysicsModule.ubOde
1210 if (m_cureventsubscription < 50000) 1210 if (m_cureventsubscription < 50000)
1211 m_cureventsubscription += timestep; 1211 m_cureventsubscription += timestep;
1212 1212
1213 if(CollisionVDTCEventsThisFrame != null && CollisionVDTCEventsThisFrame.Count >0 && (Body == IntPtr.Zero || d.BodyIsEnabled(Body)))
1214 CollisionVDTCEventsThisFrame.Clear();
1215
1216 if (m_cureventsubscription < m_eventsubscription)
1217 return;
1218
1213 if (CollisionEventsThisFrame == null) 1219 if (CollisionEventsThisFrame == null)
1214 return; 1220 return;
1215 1221
1216 int ncolisions = CollisionEventsThisFrame.m_objCollisionList.Count; 1222 int ncolisions = CollisionEventsThisFrame.m_objCollisionList.Count;
1217 1223
1218 if (m_cureventsubscription < m_eventsubscription)
1219 return;
1220
1221 if (!SentEmptyCollisionsEvent || ncolisions > 0) 1224 if (!SentEmptyCollisionsEvent || ncolisions > 0)
1222 { 1225 {
1223 base.SendCollisionUpdate(CollisionEventsThisFrame); 1226 base.SendCollisionUpdate(CollisionEventsThisFrame);
@@ -1234,8 +1237,6 @@ namespace OpenSim.Region.PhysicsModule.ubOde
1234 CollisionEventsThisFrame.Clear(); 1237 CollisionEventsThisFrame.Clear();
1235 } 1238 }
1236 } 1239 }
1237 if(CollisionVDTCEventsThisFrame != null && (Body == IntPtr.Zero || d.BodyIsEnabled(Body)))
1238 CollisionVDTCEventsThisFrame.Clear();
1239 } 1240 }
1240 1241
1241 public override bool SubscribedEvents() 1242 public override bool SubscribedEvents()
@@ -2938,7 +2939,8 @@ namespace OpenSim.Region.PhysicsModule.ubOde
2938 { 2939 {
2939 d.GeomSetPosition(prim_geom, newPos.X, newPos.Y, newPos.Z); 2940 d.GeomSetPosition(prim_geom, newPos.X, newPos.Y, newPos.Z);
2940 _position = newPos; 2941 _position = newPos;
2941 m_bodyMoveCoolDown = -5; 2942 if (Body != IntPtr.Zero && !m_disabled)
2943 m_bodyMoveCoolDown = -5;
2942 } 2944 }
2943 if (Body != IntPtr.Zero && !d.BodyIsEnabled(Body)) 2945 if (Body != IntPtr.Zero && !d.BodyIsEnabled(Body))
2944 { 2946 {
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?