diff options
Diffstat (limited to 'OpenSim/Region/Physics/OdePlugin/ODECharacter.cs')
-rw-r--r-- | OpenSim/Region/Physics/OdePlugin/ODECharacter.cs | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/OpenSim/Region/Physics/OdePlugin/ODECharacter.cs b/OpenSim/Region/Physics/OdePlugin/ODECharacter.cs index 2cdc988..b2981fe 100644 --- a/OpenSim/Region/Physics/OdePlugin/ODECharacter.cs +++ b/OpenSim/Region/Physics/OdePlugin/ODECharacter.cs | |||
@@ -832,8 +832,18 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
832 | if (flying) | 832 | if (flying) |
833 | { | 833 | { |
834 | vec.Z += ((-1 * _parent_scene.gravityz)*m_mass); | 834 | vec.Z += ((-1 * _parent_scene.gravityz)*m_mass); |
835 | } | ||
836 | 835 | ||
836 | //Added for auto fly height. Kitto Flora | ||
837 | d.Vector3 pos = d.BodyGetPosition(Body); | ||
838 | float ground_height = _parent_scene.GetTerrainHeightAtXY(pos.X, pos.Y); | ||
839 | float target_altitude = ground_height + 3.0f; // This is the min fly height | ||
840 | if(pos.Z < target_altitude) | ||
841 | { | ||
842 | vec.Z += (target_altitude - pos.Z) * PID_P * 5.0f; | ||
843 | } | ||
844 | // end add Kitto Flora | ||
845 | |||
846 | } | ||
837 | 847 | ||
838 | doForce(vec); | 848 | doForce(vec); |
839 | } | 849 | } |