diff options
author | Teravus Ovares | 2007-11-28 06:18:07 +0000 |
---|---|---|
committer | Teravus Ovares | 2007-11-28 06:18:07 +0000 |
commit | b7d596a6af51bea7dba642cdc768ac5ff77af5f3 (patch) | |
tree | 967b749b10b548f6ed687d8ade4680e411793da4 /OpenSim/Region/Physics/OdePlugin | |
parent | build ThrottleCheck function to clear up bits of the throttle (diff) | |
download | opensim-SC_OLD-b7d596a6af51bea7dba642cdc768ac5ff77af5f3.zip opensim-SC_OLD-b7d596a6af51bea7dba642cdc768ac5ff77af5f3.tar.gz opensim-SC_OLD-b7d596a6af51bea7dba642cdc768ac5ff77af5f3.tar.bz2 opensim-SC_OLD-b7d596a6af51bea7dba642cdc768ac5ff77af5f3.tar.xz |
* Restaring the sim works fine in grid mode now. Sims announce themselves to their neighbors when they start up. Neighbors get this message and tell their agents that there's a new sim up.
* Certain unrecoverable physics based crashes in ODE are now hooked up to the 'restart the sim' routine.
Diffstat (limited to 'OpenSim/Region/Physics/OdePlugin')
-rw-r--r-- | OpenSim/Region/Physics/OdePlugin/OdePlugin.cs | 22 |
1 files changed, 18 insertions, 4 deletions
diff --git a/OpenSim/Region/Physics/OdePlugin/OdePlugin.cs b/OpenSim/Region/Physics/OdePlugin/OdePlugin.cs index ec7d04d..7193886 100644 --- a/OpenSim/Region/Physics/OdePlugin/OdePlugin.cs +++ b/OpenSim/Region/Physics/OdePlugin/OdePlugin.cs | |||
@@ -32,6 +32,7 @@ using Axiom.Math; | |||
32 | using Ode.NET; | 32 | using Ode.NET; |
33 | using OpenSim.Framework; | 33 | using OpenSim.Framework; |
34 | using OpenSim.Region.Physics.Manager; | 34 | using OpenSim.Region.Physics.Manager; |
35 | |||
35 | //using OpenSim.Region.Physics.OdePlugin.Meshing; | 36 | //using OpenSim.Region.Physics.OdePlugin.Meshing; |
36 | 37 | ||
37 | namespace OpenSim.Region.Physics.OdePlugin | 38 | namespace OpenSim.Region.Physics.OdePlugin |
@@ -234,9 +235,16 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
234 | //System.Console.WriteLine("near: A collision was detected between {1} and {2}", 0, name1, name2); | 235 | //System.Console.WriteLine("near: A collision was detected between {1} and {2}", 0, name1, name2); |
235 | } | 236 | } |
236 | 237 | ||
237 | int count; | 238 | int count = 0; |
238 | 239 | try | |
240 | { | ||
239 | count = d.Collide(g1, g2, contacts.GetLength(0), contacts, d.ContactGeom.SizeOf); | 241 | count = d.Collide(g1, g2, contacts.GetLength(0), contacts, d.ContactGeom.SizeOf); |
242 | } | ||
243 | catch (System.Runtime.InteropServices.SEHException) | ||
244 | { | ||
245 | OpenSim.Framework.Console.MainLog.Instance.Error("PHYSICS", "The Operating system shut down ODE because of corrupt memory. This could be a result of really irregular terrain. If this repeats continuously, restart using Basic Physics and terrain fill your terrain. Restarting the sim."); | ||
246 | base.TriggerPhysicsBasedRestart(); | ||
247 | } | ||
240 | 248 | ||
241 | for (int i = 0; i < count; i++) | 249 | for (int i = 0; i < count; i++) |
242 | { | 250 | { |
@@ -805,8 +813,14 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
805 | { | 813 | { |
806 | // Process 10 frames if the sim is running normal.. | 814 | // Process 10 frames if the sim is running normal.. |
807 | // process 5 frames if the sim is running slow | 815 | // process 5 frames if the sim is running slow |
808 | d.WorldSetQuickStepNumIterations(world, m_physicsiterations); | 816 | try{ |
809 | 817 | d.WorldSetQuickStepNumIterations(world, m_physicsiterations); | |
818 | } | ||
819 | catch (System.StackOverflowException) | ||
820 | { | ||
821 | OpenSim.Framework.Console.MainLog.Instance.Error("PHYSICS", "The operating system wasn't able to allocate enough memory for the simulation. Restarting the sim."); | ||
822 | base.TriggerPhysicsBasedRestart(); | ||
823 | } | ||
810 | 824 | ||
811 | int i = 0; | 825 | int i = 0; |
812 | while (step_time > 0.0f) | 826 | while (step_time > 0.0f) |