diff options
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Region/Physics/UbitOdePlugin/ODEDynamics.cs | 11 | ||||
-rw-r--r-- | OpenSim/Region/Physics/UbitOdePlugin/ODEPrim.cs | 12 | ||||
-rw-r--r-- | OpenSim/Region/Physics/UbitOdePlugin/OdeScene.cs | 68 |
3 files changed, 55 insertions, 36 deletions
diff --git a/OpenSim/Region/Physics/UbitOdePlugin/ODEDynamics.cs b/OpenSim/Region/Physics/UbitOdePlugin/ODEDynamics.cs index 4f82c24..0fabb56 100644 --- a/OpenSim/Region/Physics/UbitOdePlugin/ODEDynamics.cs +++ b/OpenSim/Region/Physics/UbitOdePlugin/ODEDynamics.cs | |||
@@ -120,6 +120,16 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
120 | private float m_lmEfect = 0; // current linear motor eficiency | 120 | private float m_lmEfect = 0; // current linear motor eficiency |
121 | private float m_amEfect = 0; // current angular motor eficiency | 121 | private float m_amEfect = 0; // current angular motor eficiency |
122 | 122 | ||
123 | public bool EngineActive | ||
124 | { | ||
125 | get | ||
126 | { | ||
127 | if (m_lmEfect > 0.01) | ||
128 | return true; | ||
129 | return false; | ||
130 | } | ||
131 | } | ||
132 | |||
123 | 133 | ||
124 | public ODEDynamics(OdePrim rootp) | 134 | public ODEDynamics(OdePrim rootp) |
125 | { | 135 | { |
@@ -152,6 +162,7 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
152 | m_linearMotorTimescale = vd.m_linearMotorTimescale; | 162 | m_linearMotorTimescale = vd.m_linearMotorTimescale; |
153 | if (m_linearMotorTimescale < timestep) m_linearMotorTimescale = timestep; | 163 | if (m_linearMotorTimescale < timestep) m_linearMotorTimescale = timestep; |
154 | 164 | ||
165 | |||
155 | m_linearMotorOffset = vd.m_linearMotorOffset; | 166 | m_linearMotorOffset = vd.m_linearMotorOffset; |
156 | 167 | ||
157 | //Angular properties | 168 | //Angular properties |
diff --git a/OpenSim/Region/Physics/UbitOdePlugin/ODEPrim.cs b/OpenSim/Region/Physics/UbitOdePlugin/ODEPrim.cs index 17f38e8..e5fa1d7 100644 --- a/OpenSim/Region/Physics/UbitOdePlugin/ODEPrim.cs +++ b/OpenSim/Region/Physics/UbitOdePlugin/ODEPrim.cs | |||
@@ -222,6 +222,18 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
222 | { | 222 | { |
223 | get | 223 | get |
224 | { | 224 | { |
225 | if (m_isphysical) | ||
226 | { | ||
227 | ODEDynamics veh; | ||
228 | if (_parent != null) | ||
229 | veh = ((OdePrim)_parent).m_vehicle; | ||
230 | else | ||
231 | veh = m_vehicle; | ||
232 | |||
233 | if (veh != null) | ||
234 | if (veh.Type != Vehicle.TYPE_NONE && veh.EngineActive) | ||
235 | return new ContactData(0, 0); | ||
236 | } | ||
225 | return primContactData; | 237 | return primContactData; |
226 | } | 238 | } |
227 | } | 239 | } |
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 | } |