aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Physics/UbitOdePlugin/OdeScene.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/Physics/UbitOdePlugin/OdeScene.cs')
-rw-r--r--OpenSim/Region/Physics/UbitOdePlugin/OdeScene.cs68
1 files changed, 32 insertions, 36 deletions
diff --git a/OpenSim/Region/Physics/UbitOdePlugin/OdeScene.cs b/OpenSim/Region/Physics/UbitOdePlugin/OdeScene.cs
index eb5c687..129db5d 100644
--- a/OpenSim/Region/Physics/UbitOdePlugin/OdeScene.cs
+++ b/OpenSim/Region/Physics/UbitOdePlugin/OdeScene.cs
@@ -155,7 +155,7 @@ namespace OpenSim.Region.Physics.OdePlugin
155 private readonly ILog m_log; 155 private readonly ILog m_log;
156 // private Dictionary<string, sCollisionData> m_storedCollisions = new Dictionary<string, sCollisionData>(); 156 // private Dictionary<string, sCollisionData> m_storedCollisions = new Dictionary<string, sCollisionData>();
157 157
158 private int threadid = 0; 158// private int threadid = 0;
159 private Random fluidRandomizer = new Random(Environment.TickCount); 159 private Random fluidRandomizer = new Random(Environment.TickCount);
160 160
161 const d.ContactFlags comumContactFlags = d.ContactFlags.SoftERP | d.ContactFlags.SoftCFM |d.ContactFlags.Approx1 | d.ContactFlags.Bounce; 161 const d.ContactFlags comumContactFlags = d.ContactFlags.SoftERP | d.ContactFlags.SoftCFM |d.ContactFlags.Approx1 | d.ContactFlags.Bounce;
@@ -168,7 +168,7 @@ namespace OpenSim.Region.Physics.OdePlugin
168 float frictionMovementMult = 0.3f; 168 float frictionMovementMult = 0.3f;
169 169
170 float TerrainBounce = 0.1f; 170 float TerrainBounce = 0.1f;
171 float TerrainFriction = 0.1f; 171 float TerrainFriction = 0.3f;
172 172
173 public float AvatarBounce = 0.3f; 173 public float AvatarBounce = 0.3f;
174 public float AvatarFriction = 0;// 0.9f * 0.5f; 174 public float AvatarFriction = 0;// 0.9f * 0.5f;
@@ -189,8 +189,8 @@ namespace OpenSim.Region.Physics.OdePlugin
189 189
190 internal IntPtr WaterGeom; 190 internal IntPtr WaterGeom;
191 191
192 public float avPIDD = 3200f; // make it visible 192 public float avPIDD = 2200f; // make it visible
193 public float avPIDP = 1400f; // make it visible 193 public float avPIDP = 900f; // make it visible
194 private float avCapRadius = 0.37f; 194 private float avCapRadius = 0.37f;
195 private float avDensity = 3f; 195 private float avDensity = 3f;
196 private float avMovementDivisorWalk = 1.3f; 196 private float avMovementDivisorWalk = 1.3f;
@@ -202,7 +202,7 @@ namespace OpenSim.Region.Physics.OdePlugin
202 public bool forceSimplePrimMeshing = false; 202 public bool forceSimplePrimMeshing = false;
203 203
204 public float meshSculptLOD = 32; 204 public float meshSculptLOD = 32;
205 public float MeshSculptphysicalLOD = 16; 205 public float MeshSculptphysicalLOD = 32;
206 206
207 public float geomDefaultDensity = 10.000006836f; 207 public float geomDefaultDensity = 10.000006836f;
208 208
@@ -212,12 +212,11 @@ namespace OpenSim.Region.Physics.OdePlugin
212 public float bodyPIDD = 35f; 212 public float bodyPIDD = 35f;
213 public float bodyPIDG = 25; 213 public float bodyPIDG = 25;
214 214
215 public int geomCrossingFailuresBeforeOutofbounds = 6; 215// public int geomCrossingFailuresBeforeOutofbounds = 6;
216 216
217 public int bodyFramesAutoDisable = 20; 217 public int bodyFramesAutoDisable = 20;
218 218
219 private float[] _watermap; 219 private float[] _watermap;
220 private bool m_filterCollisions = true;
221 220
222 private d.NearCallback nearCallback; 221 private d.NearCallback nearCallback;
223 222
@@ -388,9 +387,6 @@ namespace OpenSim.Region.Physics.OdePlugin
388 387
389 // Defaults 388 // Defaults
390 389
391 avPIDD = 2200.0f;
392 avPIDP = 900.0f;
393
394 int contactsPerCollision = 80; 390 int contactsPerCollision = 80;
395 391
396 if (m_config != null) 392 if (m_config != null)
@@ -398,57 +394,56 @@ namespace OpenSim.Region.Physics.OdePlugin
398 IConfig physicsconfig = m_config.Configs["ODEPhysicsSettings"]; 394 IConfig physicsconfig = m_config.Configs["ODEPhysicsSettings"];
399 if (physicsconfig != null) 395 if (physicsconfig != null)
400 { 396 {
401 gravityx = physicsconfig.GetFloat("world_gravityx", 0f); 397 gravityx = physicsconfig.GetFloat("world_gravityx", gravityx);
402 gravityy = physicsconfig.GetFloat("world_gravityy", 0f); 398 gravityy = physicsconfig.GetFloat("world_gravityy", gravityy);
403 gravityz = physicsconfig.GetFloat("world_gravityz", -9.8f); 399 gravityz = physicsconfig.GetFloat("world_gravityz", gravityz);
404 400
405 metersInSpace = physicsconfig.GetFloat("meters_in_small_space", 29.9f); 401 metersInSpace = physicsconfig.GetFloat("meters_in_small_space", metersInSpace);
406 402
407 contactsurfacelayer = physicsconfig.GetFloat("world_contact_surface_layer", contactsurfacelayer); 403 contactsurfacelayer = physicsconfig.GetFloat("world_contact_surface_layer", contactsurfacelayer);
408 404
409 ODE_STEPSIZE = physicsconfig.GetFloat("world_stepsize", 0.020f); 405 ODE_STEPSIZE = physicsconfig.GetFloat("world_stepsize", ODE_STEPSIZE);
410 m_physicsiterations = physicsconfig.GetInt("world_internal_steps_without_collisions", 10); 406 m_physicsiterations = physicsconfig.GetInt("world_internal_steps_without_collisions", m_physicsiterations);
411 407
412 avDensity = physicsconfig.GetFloat("av_density", avDensity); 408 avDensity = physicsconfig.GetFloat("av_density", avDensity);
413 avMovementDivisorWalk = physicsconfig.GetFloat("av_movement_divisor_walk", 1.3f); 409 avMovementDivisorWalk = physicsconfig.GetFloat("av_movement_divisor_walk", avMovementDivisorWalk);
414 avMovementDivisorRun = physicsconfig.GetFloat("av_movement_divisor_run", 0.8f); 410 avMovementDivisorRun = physicsconfig.GetFloat("av_movement_divisor_run", avMovementDivisorRun);
415 avCapRadius = physicsconfig.GetFloat("av_capsule_radius", 0.37f); 411 avCapRadius = physicsconfig.GetFloat("av_capsule_radius", avCapRadius);
416 412
417 contactsPerCollision = physicsconfig.GetInt("contacts_per_collision", 80); 413 contactsPerCollision = physicsconfig.GetInt("contacts_per_collision", contactsPerCollision);
418 414
419 geomContactPointsStartthrottle = physicsconfig.GetInt("geom_contactpoints_start_throttling", 3); 415 geomContactPointsStartthrottle = physicsconfig.GetInt("geom_contactpoints_start_throttling", 3);
420 geomUpdatesPerThrottledUpdate = physicsconfig.GetInt("geom_updates_before_throttled_update", 15); 416 geomUpdatesPerThrottledUpdate = physicsconfig.GetInt("geom_updates_before_throttled_update", 15);
421 geomCrossingFailuresBeforeOutofbounds = physicsconfig.GetInt("geom_crossing_failures_before_outofbounds", 5); 417// geomCrossingFailuresBeforeOutofbounds = physicsconfig.GetInt("geom_crossing_failures_before_outofbounds", 5);
422 418
423 geomDefaultDensity = physicsconfig.GetFloat("geometry_default_density", 10.000006836f); 419 geomDefaultDensity = physicsconfig.GetFloat("geometry_default_density", geomDefaultDensity);
424 bodyFramesAutoDisable = physicsconfig.GetInt("body_frames_auto_disable", 20); 420 bodyFramesAutoDisable = physicsconfig.GetInt("body_frames_auto_disable", bodyFramesAutoDisable);
425 421
426 bodyPIDD = physicsconfig.GetFloat("body_pid_derivative", 35f); 422 bodyPIDD = physicsconfig.GetFloat("body_pid_derivative", bodyPIDD);
427 bodyPIDG = physicsconfig.GetFloat("body_pid_gain", 25f); 423 bodyPIDG = physicsconfig.GetFloat("body_pid_gain", bodyPIDG);
428 424
429 forceSimplePrimMeshing = physicsconfig.GetBoolean("force_simple_prim_meshing", forceSimplePrimMeshing); 425 forceSimplePrimMeshing = physicsconfig.GetBoolean("force_simple_prim_meshing", forceSimplePrimMeshing);
430 meshSculptedPrim = physicsconfig.GetBoolean("mesh_sculpted_prim", true); 426 meshSculptedPrim = physicsconfig.GetBoolean("mesh_sculpted_prim", meshSculptedPrim);
431 meshSculptLOD = physicsconfig.GetFloat("mesh_lod", 32f); 427 meshSculptLOD = physicsconfig.GetFloat("mesh_lod", meshSculptLOD);
432 MeshSculptphysicalLOD = physicsconfig.GetFloat("mesh_physical_lod", 16f); 428 MeshSculptphysicalLOD = physicsconfig.GetFloat("mesh_physical_lod", MeshSculptphysicalLOD);
433 m_filterCollisions = physicsconfig.GetBoolean("filter_collisions", false);
434 429
435 if (Environment.OSVersion.Platform == PlatformID.Unix) 430 if (Environment.OSVersion.Platform == PlatformID.Unix)
436 { 431 {
437 avPIDD = physicsconfig.GetFloat("av_pid_derivative_linux", 2200.0f); 432 avPIDD = physicsconfig.GetFloat("av_pid_derivative_linux", avPIDD);
438 avPIDP = physicsconfig.GetFloat("av_pid_proportional_linux", 900.0f); 433 avPIDP = physicsconfig.GetFloat("av_pid_proportional_linux", avPIDP);
439 } 434 }
440 else 435 else
441 { 436 {
442 avPIDD = physicsconfig.GetFloat("av_pid_derivative_win", 2200.0f); 437 avPIDD = physicsconfig.GetFloat("av_pid_derivative_win", avPIDD);
443 avPIDP = physicsconfig.GetFloat("av_pid_proportional_win", 900.0f); 438 avPIDP = physicsconfig.GetFloat("av_pid_proportional_win", avPIDP);
444 } 439 }
445 440
446 physics_logging = physicsconfig.GetBoolean("physics_logging", false); 441 physics_logging = physicsconfig.GetBoolean("physics_logging", false);
447 physics_logging_interval = physicsconfig.GetInt("physics_logging_interval", 0); 442 physics_logging_interval = physicsconfig.GetInt("physics_logging_interval", 0);
448 physics_logging_append_existing_logfile = physicsconfig.GetBoolean("physics_logging_append_existing_logfile", false); 443 physics_logging_append_existing_logfile = physicsconfig.GetBoolean("physics_logging_append_existing_logfile", false);
449 444
450 minimumGroundFlightOffset = physicsconfig.GetFloat("minimum_ground_flight_offset", 3f); 445 minimumGroundFlightOffset = physicsconfig.GetFloat("minimum_ground_flight_offset", minimumGroundFlightOffset);
451 maximumMassObject = physicsconfig.GetFloat("maximum_mass_object", 10000.01f); 446 maximumMassObject = physicsconfig.GetFloat("maximum_mass_object", maximumMassObject);
452 } 447 }
453 } 448 }
454 449
@@ -1941,13 +1936,14 @@ namespace OpenSim.Region.Physics.OdePlugin
1941 yy += regionsize; 1936 yy += regionsize;
1942 1937
1943 val = heightMap[yy + xx]; 1938 val = heightMap[yy + xx];
1939 if (val < 0.0f)
1940 val = 0.0f; // no neg terrain as in chode
1944 _heightmap[xt + y] = val; 1941 _heightmap[xt + y] = val;
1945 1942
1946 if (hfmin > val) 1943 if (hfmin > val)
1947 hfmin = val; 1944 hfmin = val;
1948 if (hfmax < val) 1945 if (hfmax < val)
1949 hfmax = val; 1946 hfmax = val;
1950
1951 } 1947 }
1952 xt += heightmapHeightSamples; 1948 xt += heightmapHeightSamples;
1953 } 1949 }