diff options
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Region/Physics/OdePlugin/ODECharacter.cs | 13 | ||||
-rw-r--r-- | OpenSim/Region/Physics/OdePlugin/OdePlugin.cs | 3 |
2 files changed, 11 insertions, 5 deletions
diff --git a/OpenSim/Region/Physics/OdePlugin/ODECharacter.cs b/OpenSim/Region/Physics/OdePlugin/ODECharacter.cs index a62409c..1808fa0 100644 --- a/OpenSim/Region/Physics/OdePlugin/ODECharacter.cs +++ b/OpenSim/Region/Physics/OdePlugin/ODECharacter.cs | |||
@@ -95,8 +95,11 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
95 | // taints and their non-tainted counterparts | 95 | // taints and their non-tainted counterparts |
96 | public bool m_isPhysical = false; // the current physical status | 96 | public bool m_isPhysical = false; // the current physical status |
97 | public bool m_tainted_isPhysical = false; // set when the physical status is tainted (false=not existing in physics engine, true=existing) | 97 | public bool m_tainted_isPhysical = false; // set when the physical status is tainted (false=not existing in physics engine, true=existing) |
98 | public float MinimumGroundFlightOffset = 3f; | ||
99 | |||
98 | private float m_tainted_CAPSULE_LENGTH; // set when the capsule length changes. | 100 | private float m_tainted_CAPSULE_LENGTH; // set when the capsule length changes. |
99 | 101 | ||
102 | |||
100 | private float m_buoyancy = 0f; | 103 | private float m_buoyancy = 0f; |
101 | 104 | ||
102 | // private CollisionLocker ode; | 105 | // private CollisionLocker ode; |
@@ -834,12 +837,12 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
834 | vec.Z += ((-1 * _parent_scene.gravityz)*m_mass); | 837 | vec.Z += ((-1 * _parent_scene.gravityz)*m_mass); |
835 | 838 | ||
836 | //Added for auto fly height. Kitto Flora | 839 | //Added for auto fly height. Kitto Flora |
837 | d.Vector3 pos = d.BodyGetPosition(Body); | 840 | //d.Vector3 pos = d.BodyGetPosition(Body); |
838 | float ground_height = _parent_scene.GetTerrainHeightAtXY(pos.X, pos.Y); | 841 | float target_altitude = _parent_scene.GetTerrainHeightAtXY(_position.X, _position.Y) + MinimumGroundFlightOffset; |
839 | float target_altitude = ground_height + 3.0f; // This is the min fly height | 842 | |
840 | if (pos.Z < target_altitude) | 843 | if (_position.Z < target_altitude) |
841 | { | 844 | { |
842 | vec.Z += (target_altitude - pos.Z) * PID_P * 5.0f; | 845 | vec.Z += (target_altitude - _position.Z) * PID_P * 5.0f; |
843 | } | 846 | } |
844 | // end add Kitto Flora | 847 | // end add Kitto Flora |
845 | 848 | ||
diff --git a/OpenSim/Region/Physics/OdePlugin/OdePlugin.cs b/OpenSim/Region/Physics/OdePlugin/OdePlugin.cs index 7a01702..779ad1a 100644 --- a/OpenSim/Region/Physics/OdePlugin/OdePlugin.cs +++ b/OpenSim/Region/Physics/OdePlugin/OdePlugin.cs | |||
@@ -181,6 +181,7 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
181 | private float avHeightFudgeFactor = 0.52f; | 181 | private float avHeightFudgeFactor = 0.52f; |
182 | private float avMovementDivisorWalk = 1.3f; | 182 | private float avMovementDivisorWalk = 1.3f; |
183 | private float avMovementDivisorRun = 0.8f; | 183 | private float avMovementDivisorRun = 0.8f; |
184 | private float minimumGroundFlightOffset = 3f; | ||
184 | 185 | ||
185 | public bool meshSculptedPrim = true; | 186 | public bool meshSculptedPrim = true; |
186 | 187 | ||
@@ -432,6 +433,7 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
432 | physics_logging_append_existing_logfile = physicsconfig.GetBoolean("physics_logging_append_existing_logfile", false); | 433 | physics_logging_append_existing_logfile = physicsconfig.GetBoolean("physics_logging_append_existing_logfile", false); |
433 | 434 | ||
434 | m_NINJA_physics_joints_enabled = physicsconfig.GetBoolean("use_NINJA_physics_joints", false); | 435 | m_NINJA_physics_joints_enabled = physicsconfig.GetBoolean("use_NINJA_physics_joints", false); |
436 | minimumGroundFlightOffset = physicsconfig.GetFloat("minimum_ground_flight_offset", 3f); | ||
435 | 437 | ||
436 | } | 438 | } |
437 | } | 439 | } |
@@ -1336,6 +1338,7 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
1336 | pos.Z = position.Z; | 1338 | pos.Z = position.Z; |
1337 | OdeCharacter newAv = new OdeCharacter(avName, this, pos, ode, size, avPIDD, avPIDP, avCapRadius, avStandupTensor, avDensity, avHeightFudgeFactor, avMovementDivisorWalk, avMovementDivisorRun); | 1339 | OdeCharacter newAv = new OdeCharacter(avName, this, pos, ode, size, avPIDD, avPIDP, avCapRadius, avStandupTensor, avDensity, avHeightFudgeFactor, avMovementDivisorWalk, avMovementDivisorRun); |
1338 | newAv.Flying = isFlying; | 1340 | newAv.Flying = isFlying; |
1341 | newAv.MinimumGroundFlightOffset = minimumGroundFlightOffset; | ||
1339 | _characters.Add(newAv); | 1342 | _characters.Add(newAv); |
1340 | return newAv; | 1343 | return newAv; |
1341 | } | 1344 | } |