diff options
Diffstat (limited to 'OpenSim/Region/Physics/OdePlugin')
-rw-r--r-- | OpenSim/Region/Physics/OdePlugin/OdePlugin.cs | 13 |
1 files changed, 10 insertions, 3 deletions
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) |