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