diff options
author | Dahlia Trimble | 2009-02-12 07:58:10 +0000 |
---|---|---|
committer | Dahlia Trimble | 2009-02-12 07:58:10 +0000 |
commit | d21601d497e81108860e880653757dc3773cdb47 (patch) | |
tree | 1d444ac43c11d8f66e3193f6dce69fe7c63f0761 /OpenSim/Region/Physics/OdePlugin/ODECharacter.cs | |
parent | Sending this to Justin, so that he can see what's wrong with the StandaloneTe... (diff) | |
download | opensim-SC_OLD-d21601d497e81108860e880653757dc3773cdb47.zip opensim-SC_OLD-d21601d497e81108860e880653757dc3773cdb47.tar.gz opensim-SC_OLD-d21601d497e81108860e880653757dc3773cdb47.tar.bz2 opensim-SC_OLD-d21601d497e81108860e880653757dc3773cdb47.tar.xz |
Thanks Kitto Flora for a patch that adds automatic min fly height to ODE - Mantis #3134
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 | } |