diff options
author | Teravus Ovares | 2007-11-09 21:01:55 +0000 |
---|---|---|
committer | Teravus Ovares | 2007-11-09 21:01:55 +0000 |
commit | e9e72fe9079ab011dc43199496fb9a9dc7ea5b3a (patch) | |
tree | 5c202b24b748e147b7aa4692044d618bfec522d0 /OpenSim/Region/Physics | |
parent | add a few more verbose bits (diff) | |
download | opensim-SC-e9e72fe9079ab011dc43199496fb9a9dc7ea5b3a.zip opensim-SC-e9e72fe9079ab011dc43199496fb9a9dc7ea5b3a.tar.gz opensim-SC-e9e72fe9079ab011dc43199496fb9a9dc7ea5b3a.tar.bz2 opensim-SC-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 '')
5 files changed, 56 insertions, 5 deletions
diff --git a/OpenSim/Region/Physics/BasicPhysicsPlugin/BasicPhysicsPlugin.cs b/OpenSim/Region/Physics/BasicPhysicsPlugin/BasicPhysicsPlugin.cs index d5cb99f..6377392 100644 --- a/OpenSim/Region/Physics/BasicPhysicsPlugin/BasicPhysicsPlugin.cs +++ b/OpenSim/Region/Physics/BasicPhysicsPlugin/BasicPhysicsPlugin.cs | |||
@@ -201,7 +201,11 @@ namespace OpenSim.Region.Physics.BasicPhysicsPlugin | |||
201 | get { return false; } | 201 | get { return false; } |
202 | set { return; } | 202 | set { return; } |
203 | } | 203 | } |
204 | 204 | public override bool ThrottleUpdates | |
205 | { | ||
206 | get { return false; } | ||
207 | set { return; } | ||
208 | } | ||
205 | public override bool Flying | 209 | public override bool Flying |
206 | { | 210 | { |
207 | get { return flying; } | 211 | get { return flying; } |
diff --git a/OpenSim/Region/Physics/BulletXPlugin/BulletXPlugin.cs b/OpenSim/Region/Physics/BulletXPlugin/BulletXPlugin.cs index 2e6e40f..c733adb 100644 --- a/OpenSim/Region/Physics/BulletXPlugin/BulletXPlugin.cs +++ b/OpenSim/Region/Physics/BulletXPlugin/BulletXPlugin.cs | |||
@@ -742,6 +742,11 @@ namespace OpenSim.Region.Physics.BulletXPlugin | |||
742 | get { return flying; } | 742 | get { return flying; } |
743 | set { flying = value; } | 743 | set { flying = value; } |
744 | } | 744 | } |
745 | public override bool ThrottleUpdates | ||
746 | { | ||
747 | get { return false; } | ||
748 | set { return; } | ||
749 | } | ||
745 | public override bool IsColliding | 750 | public override bool IsColliding |
746 | { | 751 | { |
747 | get { return iscolliding; } | 752 | get { return iscolliding; } |
diff --git a/OpenSim/Region/Physics/Manager/PhysicsActor.cs b/OpenSim/Region/Physics/Manager/PhysicsActor.cs index 049da96..9ce7cf3 100644 --- a/OpenSim/Region/Physics/Manager/PhysicsActor.cs +++ b/OpenSim/Region/Physics/Manager/PhysicsActor.cs | |||
@@ -88,6 +88,8 @@ namespace OpenSim.Region.Physics.Manager | |||
88 | 88 | ||
89 | public abstract bool Flying { get; set; } | 89 | public abstract bool Flying { get; set; } |
90 | 90 | ||
91 | public abstract bool ThrottleUpdates { get; set; } | ||
92 | |||
91 | public abstract bool IsColliding { get; set; } | 93 | public abstract bool IsColliding { get; set; } |
92 | public abstract PhysicsVector RotationalVelocity { get; set; } | 94 | public abstract PhysicsVector RotationalVelocity { get; set; } |
93 | 95 | ||
@@ -148,6 +150,11 @@ namespace OpenSim.Region.Physics.Manager | |||
148 | get { return false; } | 150 | get { return false; } |
149 | set { return; } | 151 | set { return; } |
150 | } | 152 | } |
153 | public override bool ThrottleUpdates | ||
154 | { | ||
155 | get { return false; } | ||
156 | set { return; } | ||
157 | } | ||
151 | 158 | ||
152 | public override bool IsColliding | 159 | public override bool IsColliding |
153 | { | 160 | { |
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 | } |
diff --git a/OpenSim/Region/Physics/PhysXPlugin/PhysXPlugin.cs b/OpenSim/Region/Physics/PhysXPlugin/PhysXPlugin.cs index d282e9d..76121ae 100644 --- a/OpenSim/Region/Physics/PhysXPlugin/PhysXPlugin.cs +++ b/OpenSim/Region/Physics/PhysXPlugin/PhysXPlugin.cs | |||
@@ -204,7 +204,11 @@ namespace OpenSim.Region.Physics.PhysXPlugin | |||
204 | get { return false; } | 204 | get { return false; } |
205 | set { return; } | 205 | set { return; } |
206 | } | 206 | } |
207 | 207 | public override bool ThrottleUpdates | |
208 | { | ||
209 | get { return false; } | ||
210 | set { return; } | ||
211 | } | ||
208 | public override bool Flying | 212 | public override bool Flying |
209 | { | 213 | { |
210 | get { return flying; } | 214 | get { return flying; } |
@@ -335,6 +339,11 @@ namespace OpenSim.Region.Physics.PhysXPlugin | |||
335 | get { return false; } | 339 | get { return false; } |
336 | set { return; } | 340 | set { return; } |
337 | } | 341 | } |
342 | public override bool ThrottleUpdates | ||
343 | { | ||
344 | get { return false; } | ||
345 | set { return; } | ||
346 | } | ||
338 | public override PhysicsVector RotationalVelocity | 347 | public override PhysicsVector RotationalVelocity |
339 | { | 348 | { |
340 | get { return m_rotationalVelocity; } | 349 | get { return m_rotationalVelocity; } |