aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Physics/OdePlugin
diff options
context:
space:
mode:
authorTeravus Ovares2007-11-09 21:01:55 +0000
committerTeravus Ovares2007-11-09 21:01:55 +0000
commite9e72fe9079ab011dc43199496fb9a9dc7ea5b3a (patch)
tree5c202b24b748e147b7aa4692044d618bfec522d0 /OpenSim/Region/Physics/OdePlugin
parentadd a few more verbose bits (diff)
downloadopensim-SC_OLD-e9e72fe9079ab011dc43199496fb9a9dc7ea5b3a.zip
opensim-SC_OLD-e9e72fe9079ab011dc43199496fb9a9dc7ea5b3a.tar.gz
opensim-SC_OLD-e9e72fe9079ab011dc43199496fb9a9dc7ea5b3a.tar.bz2
opensim-SC_OLD-e9e72fe9079ab011dc43199496fb9a9dc7ea5b3a.tar.xz
* Added an internal throttle on ODE physics updates
* Added a ThrottleUpdates member to PhysicsActor to expose 'throttle' ability to the Scene. * Updated the ode.dll file with a fix to invalid data passed to ODE's heightfield collision calculator.
Diffstat (limited to 'OpenSim/Region/Physics/OdePlugin')
-rw-r--r--OpenSim/Region/Physics/OdePlugin/OdePlugin.cs32
1 files changed, 29 insertions, 3 deletions
diff --git a/OpenSim/Region/Physics/OdePlugin/OdePlugin.cs b/OpenSim/Region/Physics/OdePlugin/OdePlugin.cs
index 79f51a1..decf93f 100644
--- a/OpenSim/Region/Physics/OdePlugin/OdePlugin.cs
+++ b/OpenSim/Region/Physics/OdePlugin/OdePlugin.cs
@@ -212,6 +212,11 @@ namespace OpenSim.Region.Physics.OdePlugin
212 212
213 // We only need to test p2 for 'jump crouch purposes' 213 // We only need to test p2 for 'jump crouch purposes'
214 p2.IsColliding = true; 214 p2.IsColliding = true;
215 if (count > 3)
216 {
217 p2.ThrottleUpdates = true;
218 }
219 //System.Console.WriteLine(count.ToString());
215 //System.Console.WriteLine("near: A collision was detected between {1} and {2}", 0, name1, name2); 220 //System.Console.WriteLine("near: A collision was detected between {1} and {2}", 0, name1, name2);
216 } 221 }
217 } 222 }
@@ -667,7 +672,11 @@ namespace OpenSim.Region.Physics.OdePlugin
667 get { return false; } 672 get { return false; }
668 set { return; } 673 set { return; }
669 } 674 }
670 675 public override bool ThrottleUpdates
676 {
677 get { return false; }
678 set { return; }
679 }
671 public override bool Flying 680 public override bool Flying
672 { 681 {
673 get { return flying; } 682 get { return flying; }
@@ -929,6 +938,8 @@ namespace OpenSim.Region.Physics.OdePlugin
929 public IntPtr _triMeshData; 938 public IntPtr _triMeshData;
930 private bool iscolliding = false; 939 private bool iscolliding = false;
931 private bool m_isphysical = false; 940 private bool m_isphysical = false;
941 private bool m_throttleUpdates = false;
942 private int throttleCounter = 0;
932 943
933 public bool _zeroFlag = false; 944 public bool _zeroFlag = false;
934 private bool m_lastUpdateSent = false; 945 private bool m_lastUpdateSent = false;
@@ -1098,7 +1109,11 @@ namespace OpenSim.Region.Physics.OdePlugin
1098 get { return iscolliding; } 1109 get { return iscolliding; }
1099 set { iscolliding = value; } 1110 set { iscolliding = value; }
1100 } 1111 }
1101 1112 public override bool ThrottleUpdates
1113 {
1114 get { return m_throttleUpdates; }
1115 set { m_throttleUpdates=value; }
1116 }
1102 1117
1103 public override PhysicsVector Position 1118 public override PhysicsVector Position
1104 { 1119 {
@@ -1347,6 +1362,8 @@ namespace OpenSim.Region.Physics.OdePlugin
1347 m_rotationalVelocity.Y = 0; 1362 m_rotationalVelocity.Y = 0;
1348 m_rotationalVelocity.Z = 0; 1363 m_rotationalVelocity.Z = 0;
1349 base.RequestPhysicsterseUpdate(); 1364 base.RequestPhysicsterseUpdate();
1365 m_throttleUpdates = false;
1366 throttleCounter = 0;
1350 _zeroFlag = true; 1367 _zeroFlag = true;
1351 } 1368 }
1352 1369
@@ -1382,6 +1399,8 @@ namespace OpenSim.Region.Physics.OdePlugin
1382 m_rotationalVelocity.Z = 0; 1399 m_rotationalVelocity.Z = 0;
1383 if (!m_lastUpdateSent) 1400 if (!m_lastUpdateSent)
1384 { 1401 {
1402 m_throttleUpdates = false;
1403 throttleCounter = 0;
1385 base.RequestPhysicsterseUpdate(); 1404 base.RequestPhysicsterseUpdate();
1386 m_lastUpdateSent = true; 1405 m_lastUpdateSent = true;
1387 } 1406 }
@@ -1406,7 +1425,14 @@ namespace OpenSim.Region.Physics.OdePlugin
1406 _orientation.y = ori.Y; 1425 _orientation.y = ori.Y;
1407 _orientation.z = ori.Z; 1426 _orientation.z = ori.Z;
1408 m_lastUpdateSent = false; 1427 m_lastUpdateSent = false;
1409 base.RequestPhysicsterseUpdate(); 1428 if (!m_throttleUpdates || throttleCounter > 15)
1429 {
1430 base.RequestPhysicsterseUpdate();
1431 }
1432 else
1433 {
1434 throttleCounter++;
1435 }
1410 } 1436 }
1411 m_lastposition = l_position; 1437 m_lastposition = l_position;
1412 } 1438 }