aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneObjectPart.cs2
-rw-r--r--OpenSim/Region/Framework/Scenes/ScenePresence.cs2
-rw-r--r--OpenSim/Region/Physics/OdePlugin/OdePlugin.cs13
-rw-r--r--bin/OpenSim.ini.example3
4 files changed, 15 insertions, 5 deletions
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
index e1588ce..a99a802 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
@@ -2394,7 +2394,7 @@ if (m_shape != null) {
2394 /// </summary> 2394 /// </summary>
2395 public void SendScheduledUpdates() 2395 public void SendScheduledUpdates()
2396 { 2396 {
2397 const float VELOCITY_TOLERANCE = 0.01f; 2397 const float VELOCITY_TOLERANCE = 0.0001f;
2398 const float POSITION_TOLERANCE = 0.1f; 2398 const float POSITION_TOLERANCE = 0.1f;
2399 const int TIME_MS_TOLERANCE = 3000; 2399 const int TIME_MS_TOLERANCE = 3000;
2400 2400
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
index 92f00c4..9ba19d3 100644
--- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs
+++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
@@ -2362,7 +2362,7 @@ namespace OpenSim.Region.Framework.Scenes
2362 2362
2363 public override void Update() 2363 public override void Update()
2364 { 2364 {
2365 const float VELOCITY_TOLERANCE = 0.01f; 2365 const float VELOCITY_TOLERANCE = 0.0001f;
2366 const float POSITION_TOLERANCE = 10.0f; 2366 const float POSITION_TOLERANCE = 10.0f;
2367 const int TIME_MS_TOLERANCE = 3000; 2367 const int TIME_MS_TOLERANCE = 3000;
2368 2368
diff --git a/OpenSim/Region/Physics/OdePlugin/OdePlugin.cs b/OpenSim/Region/Physics/OdePlugin/OdePlugin.cs
index 8382233..6ca415b 100644
--- a/OpenSim/Region/Physics/OdePlugin/OdePlugin.cs
+++ b/OpenSim/Region/Physics/OdePlugin/OdePlugin.cs
@@ -178,8 +178,8 @@ namespace OpenSim.Region.Physics.OdePlugin
178 //private int m_returncollisions = 10; 178 //private int m_returncollisions = 10;
179 179
180 private readonly IntPtr contactgroup; 180 private readonly IntPtr contactgroup;
181 internal IntPtr LandGeom;
182 181
182 internal IntPtr LandGeom;
183 internal IntPtr WaterGeom; 183 internal IntPtr WaterGeom;
184 184
185 private float nmTerrainContactFriction = 255.0f; 185 private float nmTerrainContactFriction = 255.0f;
@@ -251,7 +251,7 @@ namespace OpenSim.Region.Physics.OdePlugin
251 private bool m_NINJA_physics_joints_enabled = false; 251 private bool m_NINJA_physics_joints_enabled = false;
252 //private Dictionary<String, IntPtr> jointpart_name_map = new Dictionary<String,IntPtr>(); 252 //private Dictionary<String, IntPtr> jointpart_name_map = new Dictionary<String,IntPtr>();
253 private readonly Dictionary<String, List<PhysicsJoint>> joints_connecting_actor = new Dictionary<String, List<PhysicsJoint>>(); 253 private readonly Dictionary<String, List<PhysicsJoint>> joints_connecting_actor = new Dictionary<String, List<PhysicsJoint>>();
254 private d.ContactGeom[] contacts = new d.ContactGeom[80]; 254 private d.ContactGeom[] contacts;
255 private readonly List<PhysicsJoint> requestedJointsToBeCreated = new List<PhysicsJoint>(); // lock only briefly. accessed by external code (to request new joints) and by OdeScene.Simulate() to move those joints into pending/active 255 private readonly List<PhysicsJoint> requestedJointsToBeCreated = new List<PhysicsJoint>(); // lock only briefly. accessed by external code (to request new joints) and by OdeScene.Simulate() to move those joints into pending/active
256 private readonly List<PhysicsJoint> pendingJoints = new List<PhysicsJoint>(); // can lock for longer. accessed only by OdeScene. 256 private readonly List<PhysicsJoint> pendingJoints = new List<PhysicsJoint>(); // can lock for longer. accessed only by OdeScene.
257 private readonly List<PhysicsJoint> activeJoints = new List<PhysicsJoint>(); // can lock for longer. accessed only by OdeScene. 257 private readonly List<PhysicsJoint> activeJoints = new List<PhysicsJoint>(); // can lock for longer. accessed only by OdeScene.
@@ -397,6 +397,8 @@ namespace OpenSim.Region.Physics.OdePlugin
397 avStandupTensor = 550000f; 397 avStandupTensor = 550000f;
398 } 398 }
399 399
400 int contactsPerCollision = 80;
401
400 if (m_config != null) 402 if (m_config != null)
401 { 403 {
402 IConfig physicsconfig = m_config.Configs["ODEPhysicsSettings"]; 404 IConfig physicsconfig = m_config.Configs["ODEPhysicsSettings"];
@@ -439,6 +441,8 @@ namespace OpenSim.Region.Physics.OdePlugin
439 avCapRadius = physicsconfig.GetFloat("av_capsule_radius", 0.37f); 441 avCapRadius = physicsconfig.GetFloat("av_capsule_radius", 0.37f);
440 avCapsuleTilted = physicsconfig.GetBoolean("av_capsule_tilted", true); 442 avCapsuleTilted = physicsconfig.GetBoolean("av_capsule_tilted", true);
441 443
444 contactsPerCollision = physicsconfig.GetInt("contacts_per_collision", 80);
445
442 geomContactPointsStartthrottle = physicsconfig.GetInt("geom_contactpoints_start_throttling", 3); 446 geomContactPointsStartthrottle = physicsconfig.GetInt("geom_contactpoints_start_throttling", 3);
443 geomUpdatesPerThrottledUpdate = physicsconfig.GetInt("geom_updates_before_throttled_update", 15); 447 geomUpdatesPerThrottledUpdate = physicsconfig.GetInt("geom_updates_before_throttled_update", 15);
444 geomCrossingFailuresBeforeOutofbounds = physicsconfig.GetInt("geom_crossing_failures_before_outofbounds", 5); 448 geomCrossingFailuresBeforeOutofbounds = physicsconfig.GetInt("geom_crossing_failures_before_outofbounds", 5);
@@ -476,10 +480,11 @@ namespace OpenSim.Region.Physics.OdePlugin
476 480
477 m_NINJA_physics_joints_enabled = physicsconfig.GetBoolean("use_NINJA_physics_joints", false); 481 m_NINJA_physics_joints_enabled = physicsconfig.GetBoolean("use_NINJA_physics_joints", false);
478 minimumGroundFlightOffset = physicsconfig.GetFloat("minimum_ground_flight_offset", 3f); 482 minimumGroundFlightOffset = physicsconfig.GetFloat("minimum_ground_flight_offset", 3f);
479
480 } 483 }
481 } 484 }
482 485
486 contacts = new d.ContactGeom[contactsPerCollision];
487
483 staticPrimspace = new IntPtr[(int)(300 / metersInSpace), (int)(300 / metersInSpace)]; 488 staticPrimspace = new IntPtr[(int)(300 / metersInSpace), (int)(300 / metersInSpace)];
484 489
485 // Centeral contact friction and bounce 490 // Centeral contact friction and bounce
@@ -773,6 +778,8 @@ namespace OpenSim.Region.Physics.OdePlugin
773 lock (contacts) 778 lock (contacts)
774 { 779 {
775 count = d.Collide(g1, g2, contacts.Length, contacts, d.ContactGeom.SizeOf); 780 count = d.Collide(g1, g2, contacts.Length, contacts, d.ContactGeom.SizeOf);
781 if (count > contacts.Length)
782 m_log.Error("[PHYSICS]: Got " + count + " contacts when we asked for a maximum of " + contacts.Length);
776 } 783 }
777 } 784 }
778 catch (SEHException) 785 catch (SEHException)
diff --git a/bin/OpenSim.ini.example b/bin/OpenSim.ini.example
index 43e6c85..63a9e11 100644
--- a/bin/OpenSim.ini.example
+++ b/bin/OpenSim.ini.example
@@ -577,6 +577,9 @@
577 ; used to control llMove2Target 577 ; used to control llMove2Target
578 body_pid_derivative = 35 578 body_pid_derivative = 35
579 body_pid_gain = 25 579 body_pid_gain = 25
580
581 ; maximum number of contact points to generate per collision
582 contacts_per_collision = 80
580 583
581 ; amount of time a geom/body will try to cross a region border before it gets disabled 584 ; amount of time a geom/body will try to cross a region border before it gets disabled
582 geom_crossing_failures_before_outofbounds = 5 585 geom_crossing_failures_before_outofbounds = 5